How to skip dependent feature file when parent feature file fails in protractor cucumber - protractor

I have 5 test scenarios in my 5 different feature files.
TC-1
TC-2
TC-3
TC-4
TC-5
TC-3&TC-4 are dependent test cases when test scenario TC-3 failed automatically TC-4 should skip and TC-5 should execute how we can achieve this in cucumber any suggestions
Thanks in advance.

I never worked with cucumber closely, but I found out it's not possible in jasmine and pytest. So I assume this is how all test frameworks work.
The problem is that both of these^ build a queue of tests to execute before the browser started. And you can't modify it based on a runtime results.
see this answer for jasmine, and see if you can apply this approach to cucumber Nested it in Protractor/Jasmine

Related

Can I use Cucumber with Selenium Grid to run the scripts on different node at the same time?

I have searched for same but faced with failure.
Is there any other tool which can be utilised effectively to run the scripts on multiple node?
Posible duplicate of : How to execute cucumber test cases in parallel using Grid?
For me, TestNG is good to parallelize your tests and here is a question and answer about it :
How to run the cucumber test parallelly_Junit/TestNg
Cucumber 4 provides native support to run scenarios in paralllel. You dont need cucumber -Jvm.
you have to put number of threads in the runner file (--thread = 2) and just pass the selenium hub to your selenium driver during initialization.

How to trigger tests related to a particular file on Scala SBT

I'm a JS developer and I'm learning Scala, I'm used to the Jest test framework, in JS, which allows you to watch changed files and run tests for the changed modules.
Is there something similar in Scala?
I know that I can do:
~test to watch all the files and trigger all the tests
~test package/test_class to watch all the files and trigger only the specified test class.
Thanks a lot
I think you're looking for testQuick:
The testQuick task, like testOnly, allows to filter the tests to run to specific tests or wildcards using the same syntax to indicate the filters. In addition to the explicit filter, only the tests that satisfy one of the following conditions are run:
The tests that failed in the previous run
The tests that were not run before
The tests that have one or more transitive dependencies, maybe in a different project, recompiled.
You can use it with ~ and filtering that you already know.

Protractor/cucumberjs rerunning failed tests/cucumber features/specs

Given that automated UI tests sometimes fail due to flakiness, an ability to rerun only the failed tests becomes incredibly useful in a framework like protractor.
Unfortunately, as of 09/13/2016, there's no way to rerun failed tests with protractor.
How do you guys rerun your failed tests? Ideally, I'd like suggestions/ideas from people using the javascript implementation of cucumber, cucumberJs.
There's protractor-flake that was developped by Nick Tomlin to address this problem but that module doesn't always work when dealing with multicapabilities where you're trying to run your tests in parallel.
A. How do you guys rerun your failed tests? Ideally, I'd like suggestions/ideas from people using the javascript implementation of cucumber, cucumberJs.
There's protractor-flake that was developped by Nick Tomlin to address this problem but that module doesn't always work when dealing with multicapabilities where you're trying to run your tests in parallel.
There's protractor-flake that was developped by Nick Tomlin to address this problem but that module doesn't always work when dealing with multicapabilities where you're trying to run your tests in parallel.
This question: How to rerun the failed scenarios using Cucumber? almost answered the question; problem is: how do I use that command (cucumber -f rerun --out rerun.txt) to rerun my tests AND run protractor in parallel? That command might only work when you're not parallelizing your protractor tests;
B. How would you use that cucumber command to run your tests in parallel?
Please answer question A and B above, thanks again!
So far I have found the following tool, protractor-flake, that will rerun failed protractor tests:
***Github***: https://github.com/NickTomlin/protractor-flake
***NPM***: https://www.npmjs.com/package/protractor-flake

Does the XML Report Processing work for NUnit3?

I'm currently moving one of our projects to DNX (.NET Core now) and I was forced to update to nunit3. Because of other considerations, we run compile the test project as a console app with its own entry point, basically self-hosting the NUnit runner.
I now need to report the results to TeamCity via the XML Reporter, which doesn't seem to parse Nunit3 TestResults.xml files.
Any advice on how to work around this?
The NUnit 3 console has the option to produce results formatted in the NUnit 2 style.
Use the option:
--result=[filename];format=nunit2
Docs: https://github.com/nunit/nunit/wiki/Console-Command-Line
To add to the answer above:
NUnitLite inherits the --result CLI parameter which seems to do the trick.
Another option, which I went for in the end is using the --teamcity CLI parameter:
dotnetbuild --project:<path to project directory> -- --teamcity
which will integrate with TC's service messages. This will also do real-time updates.

Karma spec classification

Right now when I run karma it takes all "*.spec.js" and run time. We have both unit and integration tests. And when I am running unit tests I don't want integration specs to run. What is the best way to tell karma what spec to load. Like any name pattern, etc. I need to know how to configure karma so that it runs specific type of specs.
Any suggestion with example/link is highly appreciated.
Assuming that you can identify your integration tests by filename (e.g. *.integration.spec.js) then I would have two separate karma.conf.js files. One for integration (with ./*/*.integration.spec.js in the files list), and one for regular work (with the same pattern in exclude). Then just run the one you need - or have them both running in separate consoles.