nightwatch icon indicating copy to clipboard operation
nightwatch copied to clipboard

How to run test cases one after another in Nightwatch 2 (kindly provide CLI command)

Open irealsourav opened this issue 2 years ago • 3 comments

Describe the bug

I am trying to run 16 test cases one after another ,how to do it with version nightwatch 2? When one test case completes or fails then only the second test case will start running (Kindly provide CLI command).

Also, when I am trying to running it sequentially by putting Test_workers value as false, it fails in gitlab pipeline with the error

""FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory""

Sample test

sampleTest.js

// Please add the sample test here

module.exports = {
  sampleTest: function(browser) {

  }
}

Run with command

$ nightwatch test/sampleTest.js --your-other-arguments-here

Verbose output

debug.log

<!-- Include the verbose output, if possible (run nightwatch with `--verbose` argument) -->

Configuration

nightwatch.json

{
  "your": { "config": "here" }
}

Your Environment

Executable Version
nightwatch --version VERSION
npm --version VERSION
yarn --version VERSION
node --version VERSION
Browser driver Version
NAME VERSION
OS Version
NAME VERSION

irealsourav avatar Apr 27 '22 21:04 irealsourav

I'm not sure I understand this request properly. It's good automation practice to make sure that every test can run atomically.

Does a before or a beforeAll not give you the necessary setup that you need?

AutomatedTester avatar May 10 '22 08:05 AutomatedTester

No, actually I was trying to migrate from nightwatch version 1 to 2 and Then I saw in version 2 nightwatch by default starts in parallel mode(correct me if I am wrong).I was trying to launch 16 test cases in dockerised selenium server in gitlab pipeline and everytime it is failing saying "unable to connect to selenium server " after few execution.So I decided to try run in sequential way and that is why I created this ticket.

sourav-ghosh-ip avatar May 10 '22 09:05 sourav-ghosh-ip

We don't by default move people to run tests in parallel. We have never done that. Have you managed to get this working?

AutomatedTester avatar Sep 18 '22 20:09 AutomatedTester

closing as no response given. if You have further issues please come join us on discord

AutomatedTester avatar Nov 08 '22 11:11 AutomatedTester