Continue running test run even if one assertion fails in nightwatch - nightwatch.js

How i can continue my test run in Nightwatch even if one assertion fails.
i have added below properties in Nightwatch.json
"end_session_on_fail": false,
"skip_testcases_on_fail" : false
but still other test cases run is skipped. Can anyone let me know the solution
Thanks.

You should write in global.js an option
abortOnAssertionFailure: false,

I used .verify instead of .assert in my script. This worked. Thanks all.

Related

Does Cypress support pre-execution checks?

I run Cypress from the terminal using an npm script. I would like to run a series of checks before any tests in any spec are executed (e.g. to ensure env variables are set as expected).
If any check fails, I'd like to log some debug info and Cypress to mark each spec as failed.
Is something like this possible without having to have a custom script that executes before Cypress is started?
I've played around with the support file, but logging to the terminal and failing all test specs seems problematic.
Yes you can use Before Run API
on('before:run', (details) => {
/* ... */
})

Jenkins: Facing issue Insert choice parameters in Goals and options

I want to run the Jenkins job which is as below, which is absolutly working fine:
clean verify -Denvironment=default -Dtags="type:NL" -Dwebdriver.driver=chrome -Dorganization=$organization -Dit.test=TC09_DBG_Debug_Features
For -Dtags="type:NL", with 'NL', i am having three different tags SE,DE and DEMO. Which is as below:
-Dtags="type:NL"
-Dtags="type:SE"
-Dtags="type:DE"
-Dtags="type:DEMO"
I decided to go with 'Choice parameters' in Jenkins having NL,SE,DE and DEMO as choices and name as 'Tenant'.
The problem i am facing is how to put choice parameters in Goals and options.
I tried
clean verify -Denvironment=default -Dtags= "-DpropertyName="$Tenant"" -Dwebdriver.driver=chrome -Dorganization=$organization -Dit.test=TC09_DBG_Debug_Features
but no help. Where am i going wrong. Thanks for help and try in advance.
Came up with a solution:
clean verify -Denvironment=default -Dtags="$Tenant" -Dwebdriver.driver=chrome -Dorganization=$organization -Dit.test=TC09_DBG_Debug_Features

Different file permission error in "go test" and "bazel test"

If a test wants to assert the file permission error, for example, writing to the root of file system, "go test" returns an syscall.EACCES error, while "bazel test" returns an syscall.EPERM. How to make the test passes in both "bazel test" and "go test"?
An example can be found here.
You can disable the sandbox by using bazel --spawn_strategy=standalone test //.... I suspect this will work around the problem.
However, you may want to consider whether writing to / is the behavior that you want to test. If you need to run code on a different operating system or inside a Docker container, you'll get different behavior in this case, so you could think about testing a more predictable code path, or mocking out the file access layer to isolate your tests from it.

How do I get the whole error backtrace for rspec?

Currently I am using
parallel tests
rspec
allure 0.8.0
After I run the tests I get the following error:
RSpec::Core::MultipleExceptionError
I need the whole backtrace of the error. Is it some parameter that I need to pass to the command that I use to run and is there a permanent way so that it always prints the whole error
You have two options, to define a helper with that attribute or in command line
## spec/spec_helper.rb
config.full_backtrace = true # false to dismiss
or in the command line
$ rspec spec/folder/your_spec.rb --backtrace
If you get this error you need to find the specific test in the rspec log (scroll up). There you will see details about the issue.
In my case error was shown only on CI and I needed some time in order to figure out that everything I need is "hidden" somewhere in the super long output.

Running a command line for groovy from XCode after unit testing

I edited my target scheme to run a script action after testing as below
Target Scheme -> Test (Debug) -> Post Actions
The script hw.sh had a simple command line call:
open /Applications/Safari.app/
It worked fine for the above script. When I changed it to the following
groovy http://frankencover.it/with -s /Users/sasokan/Downloads/MyProject
Nothing happened. How can I call this groovy application using a script.
I am also trying to run frankencover.it and had the same problem you did. I eventually found this answer on SO that lead me to a solution. I added the following before calling frankencover.it and it fixed the issue.
PATH=${PATH}:/usr/local/bin
I will further note that even if you use the full path to groovy in the command frankencover.it will fail internally because it cannot find 'lcov' for the same reason.

Resources