nightwatch icon indicating copy to clipboard operation
nightwatch copied to clipboard

Any type error in perform() function, silently fails & isn't logged, in Page Object's command

Open benjaminr-ps opened this issue 2 years ago • 1 comments

Description of the bug/issue

When I do perform() call having a type error, I expected an error report/log entry but execution proceeded & nothing logged.

Steps to reproduce

  1. Define a page object
  2. Add command to page object
  3. Add call for perform() in command
  4. Pass callback, having a type error inside (without try-catch block)

Expected:

  • Nightwatch logs a failure (with stacktrace) at execution time, resp. at very end of test execution Actual:
  • Nightwatch keeps quite, no logging, and proceeds, as nothing happened

Sample test

No response

Command to run

No response

Verbose Output

No response

Nightwatch Configuration

// const seleniumServer = require("selenium-server"); const chromedriver = require("chromedriver"); // const geckodriver = require("geckodriver"); const SCREENSHOT_PATH = "./reports/screenshots/";

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

// "selenium": { // "start_process": true, // tells nightwatch to start/stop the selenium process // "server_path": seleniumServer.path, // "host": "127.0.0.1", // "port": 9449, // standard selenium port // "cli_args": { // "webdriver.chrome.driver": chromedriver.path, // "webdriver.gecko.driver": geckodriver.path, // "webdriver.ie.driver": "./src/lib/IEDriverServer.exe" // } // }, "webdriver": { "start_process": true, "server_path": chromedriver.path, "cli_args": [ "--verbose" ], "port": 9515 }, "test_settings": { "default": { "launch_url": "https://localhost", "skip_testcases_on_fail": true, "end_session_on_fail": true, "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,
      "args": [
        "--allow-insecure-localhost"
      ]
    }
  }
},

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

"chrome.7": {
  extends: "chrome",
  "page_objects_path": ["./build/src/pages/common", "./build/src/pages/jazz/700"]
},

"chrome-staging": {
  extends: "chrome",
  "globals": {
    "integrationUrl": "https://apostis.ps-office.local:7443/com.ps.consul.web.ui.doorsng/pvscl.xml",
    "webHubUrl": "https://apostis.ps-office.local:7443/pv"
  }
},
"firefox": {
  extends: "default",
  "disable_colors": true,
  "desiredCapabilities": {
    "browserName": "firefox"
  }
},
'ie': {
  extends: "default",
  "disable_colors": true,
  "desiredCapabilities": {
    "browserName": "internet explorer",
    "allowBlockedContent": true,
    "ignoreProtectedModeSettings": true,
    "IE_ENSURE_CLEAN_SESSION": true,
  }
}

} } module.exports.SCREENSHOT_PATH = SCREENSHOT_PATH;

Nightwatch.js Version

2.3.3

NPM Version

6.14.15

Node Version

14.18.1

Yarn Version

1.22.19

Browser

Chrome 104.0.5112.81

Operating System

Windows 10

Additional Information

No response

benjaminr-ps avatar Aug 22 '22 16:08 benjaminr-ps

Hey @benjaminr-ps Thank you for reporting an issue. But could you kindly provide a sample test case with verbose logs? It would be really helpful to debug the issue as quickly as possible.

harshit-bs avatar Sep 03 '22 19:09 harshit-bs

closing as info requested hasn't been given. Please raise a new issue if this still persists

AutomatedTester avatar Dec 20 '22 11:12 AutomatedTester