Karate UI Automation - Assertion fails with message "actual value is not JSON-like" for driver.title comparison - ui-automation

I am trying to use karate for UI automation but I am stuck with one basic scenario where I am trying to validate the page title
Below are my scenario steps:
Scenario: Validate page title
Given driver 'https://google.com'
And driver.maximize()
Then match driver.title == 'Google'
When I run it, I get the following error:
assertion failed: path: $.title, actual: 'Google', expected: ''Google'', reason: actual value is not JSON-like abc.feature:16 - path: $.title, actual: 'Google', expected: ''Google'', reason: actual value is not JSON-like
And If I use:
Then match driver.title == Google
I get below error:
javascript evaluation failed: driver.title, null
Additional details:
karate-junit4 = 9.4.0
* configure driver = { type: 'chrome', showDriverLog: false }
As suggested in the comments, used 0.9.5.RC3 as well.
Received this error:
assertion failed: path: $, actual: '', expected: 'Google', reason: not equal
Can anyone point out If I am missing anything here?

Last Update: This issue was a bug with 0.9.4. Please see detail description from the below link: Issue link: https://github.com/intuit/karate/issues/913

Related

Custom rule for application/problem+json using Stoplight Spectral CLI

I'm trying to make a custom rule based on the unkown-error-format that can be found here here. Using this Open API document as an example:
openapi-generated.yaml
openapi: 3.0.3
info:
title: API
version: 1.0.0
servers:
- url: https://api.com/
paths:
/:
get:
tags: []
summary: Your GET endpoint
description: Your GET endpoint
operationId: get-endpoint
responses:
"500":
description: Error
content:
application/json:
schema:
properties:
errorDescription:
type: string
and this rule set:
.spectral.yml
extends:
- https://raw.githubusercontent.com/openapi-contrib/style-guides/master/apisyouwonthate.yml
rules:
unknown-error-format: error
When running
spectral lint --ruleset .spectral.yml openapi-generated.yaml
I was expecting an error to be returned, because the 500 response content is application/json and not one of the allowed values application/vnd.api+json, application/problem+xml, and application/problem+json.
Instead no errors are found:
No results with a severity of 'error' or higher found!
I experimented with some other Spectral core functions that should make the linter return an error, but it does not. I suspect the expression in given is not returning the right result, internally.
Additionally, I tried using this JSON Path Demo to check if the output array with "application/json" is returned for the path in the rule's given. It does.
Is there a problem with this rule or am I doing something wrong?
I'm using Spectral version 6.1.0.
Thanks in advance.

Cloudformation - ECRImageURI failed to satisfy constraint

I have a parameter for an ECRImage URI. When I try to test with a dry run with taskcat, I get the following error
[ERROR ] : ClientError An error occurred (ValidationError) when calling the CreateStack operation: Parameter ECRImageURI failed to satisfy constraint: Allow all characters
But my regular expression for the pattern is already very lenient. Thoughts?
ECRImageURI:
AllowedPattern: ".*"
ConstraintDescription: "Allow all characters"
Default: 'http://464139160630.dkr.ecr.us-east-2.amazonaws.com/www.pulliam.sh:latest'
Description: ECR Docker image to use in ECS Task definition.
MaxLength: '64'
MinLength: '1'
Type: String
Edit:
Based on the documentation here, Cloudformation uses Java regular expressions. So I can only conclude there is some issue with taskcat, or something else going on.
The regex pattern is satisfied, although ^.*$ would probably be a bit more expressive. But the actual problem seems to be with the MaxLength parameter. For instance, your default value already violates the length limitation.

Filebeat : drop fields kubernetes again again

I m trying to remove some fields, I use filebeat 7.14 on Kubernetes
I tried as described in the doc
processors:
- drop_fields:
when:
contains
fields: ["host.os.name", "host.os.codename", "host.os.family"]
ignore_missing: false
container failed "ERROR instance/beat.go:989
Exiting: Failed to start crawler:
starting input failed: Error while initializing input:
missing or invalid condition
failed to initialize condition"
ignore_missing still messing
- drop_fields:
fields: ["host.os.name", "host.os.codename", "host.os.family"]
fields are still present
you don't seem to have a condition set under the when. take a look at https://www.elastic.co/guide/en/beats/filebeat/7.14/defining-processors.html#conditions and make sure you've got something for it to match

Unable to connect with CloudKit-JS CONFIGURATION_ERROR

I am trying to set up Cloudkit-JS to access an existing Cloudkit database through a web browser. The db itself works fine and I have an iOS app which connects to the db without any problems.
I've generated an API Token in the Cloudkit Dashboard and I've set it to allow any domain. I don't know if its significant but I'm trying to get this working through a local html file. It's not running on a web server.
CloudKit.configure({
containers: [{
containerIdentifier: 'iCloud.com.[My App]',
apiToken: '[API Token]',
environment: 'development'
}]
});
var container = CloudKit.getDefaultContainer();
The call to getDefaultContainer() triggers the following error message in the browser console.
ckErrorCode: CONFIGURATION_ERROR
extensionErrorCode: undefined
isCKError: true
isError: true
isServerError: true
isServerExtensionError: true
message: CONFIGURATION_ERROR: Please configure CloudKit
name: Error
reason: CONFIGURATION_ERROR: Please configure CloudKit
recordName: undefined
redirectURL: undefined
retryAfter: undefined
serverErrorCode: undefined
subscriptionID: undefined
uuid: undefined
zoneID: undefined
]
getDefaultContainer (cloudkit.js:12:1146)
Global Code (index.html:29)
Any ideas on what to try next?
Turns out to be a rookie error. I was trying to call getDefaultContainer() before the authentication had completed asynchronously.

Unable to test toast message using protractor

DOM for the toast message that i want to test is,
I tried the below code
When I run this code, I see the below error though it is able to locate the toast message. Please help me resolve this issue.
add_Button_loc = element(by.xpath("//button[#type='submit'][contains(text(),'Add')]"));
browser.wait(EC.elementToBeClickable(add_Button_loc), 5000);
expect(add_Button_loc.isPresent()).toBe(true);
toastmsg = element(by.tagName("p-growl")).$('[value="aaa Batch saved successfully"]');
add_Button_loc.click();
expect(toastmsg.isPresent()).toBe(true);
[10:17:26] W/element - more than one element found for locator By(css selector, p-growl) - the first result will be used
Failures:
1) ManageBatch Test Add Batch
Message:
Expected false to be true.
Stack:
Error: Failed expectation
at UserContext. (C:\Users\sarav\AppData\Roaming\npm\node_modules\protractor\example\manageBatch.js:43:32)
at C:\Users\sarav\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:112:25
at new ManagedPromise (C:\Users\sarav\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1077:7)
at ControlFlow.promise (C:\Users\sarav\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2505:12)
at schedulerExecute (C:\Users\sarav\AppData\Roaming\npm\node_modules\protractor\node_modules\jasminewd2\index.js:95:18)
at TaskQueue.execute_ (C:\Users\sarav\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:3084:14)
at TaskQueue.executeNext_