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

On uncaught exception test results so far are dumped conclusively but test runner proceeds #2582

Closed
benjaminr-ps opened this issue Feb 3, 2021 · 3 comments

Comments

@benjaminr-ps
Copy link

Describe the bug

If nightwatch execution runs into an uncaught exception the test results, which were collected so far, are dumped but test runner proceeds without dumping the test results at the end once again.

E.g. an uncaught exception can be reproduced by having a promise with syntax error executed.

Configuration

nightwatch.json

const chromedriver = require("chromedriver");
const SCREENSHOT_PATH = "./reports/screenshots/";


module.exports = {
  "src_folders": [
    "src/tests/"
  ],
  "custom_assertions_path": "./src/lib/custom-assertions",
  "output_folder": "./reports",
  "globals_path": "./globalsModule.js",

  "webdriver": {
    "start_process": true,
    "server_path": chromedriver.path,
    "port": 9515
  },
  "test_settings": {
    "default": {
      "launch_url": "https://localhost",
      "skip_testcases_on_fail": false,
      "end_session_on_fail": false,
      "screenshots": {
        "enabled": true,                  // if you want to keep screenshots
        "path": SCREENSHOT_PATH,           // save screenshots here
        "on_failure": true,
        "on_error": true
      },
      "desiredCapabilities": {            // use Chrome as the default browser for tests
        "marionette": true,
        "javascriptEnabled": true,
        "acceptSslCerts": true,
        "acceptInsecureCerts": true
      },
    },

    "chrome": {
      extends: "default",
      "disable_colors": true,
      "desiredCapabilities": {
        "browserName": "chrome",
        "chromeOptions": {
          "w3c": false
        }
      }
    },

    "chrome.6": {
      extends: "chrome",
      "page_objects_path": ["./src/pages/common", "./src/pages/jazz/6061"]
    },

    "chrome.7": {
      extends: "chrome",
      "page_objects_path": ["./src/pages/common", "./src/pages/jazz/700"]
    },
  }
}
module.exports.SCREENSHOT_PATH = SCREENSHOT_PATH;

Your Environment

| Executable | Version |
| node_modules\.bin\nightwatch --version | 1.5.1 |
| npm --version | 6.13.4 |
| yarn --version | 1.22.5 |
| node --version | 12.14.0 |

| Browser driver | Version |
| chromedriver | 87.0.5 |
| selenium-server | 3.141 |

| OS | Version |
| Windows 10 | 1607 |

@beatfactor
Copy link
Member

Where is the uncaught exception occurring? Can you provide a full sample test?

@beatfactor
Copy link
Member

beatfactor commented Mar 23, 2021

I can't reproduce this or it might also be that I don't understand the issue completely so please add a sample test and explain what "dumping" the test results means in this context.

@beatfactor
Copy link
Member

Nevermind, I think I found something. I'll try and post a fix soon.

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.

2 participants