Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot set custom session status for retried test. #3998

Closed
grandEL-dsouza opened this issue Jan 23, 2024 · 0 comments · Fixed by #3999
Closed

Cannot set custom session status for retried test. #3998

grandEL-dsouza opened this issue Jan 23, 2024 · 0 comments · Fixed by #3999

Comments

@grandEL-dsouza
Copy link

Description of the bug/issue

When I try to run a session (Particularly on BrowserStack) with Nightwatch the framework is overriding the status set by me via Javascript causing reporting issues.

Steps to reproduce

  1. Run any test that has the retrying mechanism with Nightwatch.
  2. The retried test will always be marked as failed.
  3. Try to then update the status of the session with a Javascript
  4. Nightwatch will still override and set the status of the test to failed.
  5. Please consider this screenshot for better understanding:
image Here as we see I marked the session status as passed but at the end Nightwatch still overwrote the status and set it to failed. The use case here is that retried tests should not be considered as failed.

Sample test

let retries = 0;
// this test will only pass if it's run with suiteRetries > 1
module.exports = {
  async demoTest(client) {
    client.url(client.globals.launch_url);
    client.globals.retryAssertionTimeout = 3000;
    if (retries < 1) {
      retries += 1;
      client.assert.equal(0, 1);
    } else {
      client.assert.equal(1, 1);
    }
  },
};

Command to run

No response

Verbose Output

No response

Nightwatch Configuration

No response

Nightwatch.js Version

3.3.2

Node Version

No response

Browser

No response

Operating System

No response

Additional Information

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant