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

HTML reporter should not be produced in case of type errors #3562

Open
mostmentor opened this issue Jan 9, 2023 · 5 comments
Open

HTML reporter should not be produced in case of type errors #3562

mostmentor opened this issue Jan 9, 2023 · 5 comments
Labels
bug html-reporter p3 reporters Issues related to Nightwatch Reporters, and custom reporters integrations

Comments

@mostmentor
Copy link

Description of the bug/issue

I was running set of tests (27 tests) and one of the tests was calling a variable from globals that doesn't exist,
This test status never reported and wasn't able to notice that the test was being skipped

Also the test is never reported in HTML reporter and this is how it looks like
image

Steps to reproduce

No response

Sample test

describe('sample test', function() {
  const resource = this.globals.trials.saas_only_trial; //Issue happened here, This variable doesn't exist in my global
     
//Some steps here

    it("End", function(browser) {
      browser.end();
    });

  });

Command to run

No response

Verbose Output

No response

Nightwatch Configuration

const settings = {
     "src_folders": [
          "tests/saas/C93573-accessSaaSProduct.js"
     ],
     "page_objects_path": [
          "./page_object"
     ],
     "globals_path": "globals.js",
     "webdriver": {
          "keep_alive": true
     },
     "custom_commands_path": [
          "./lib/custom_commands",
          "./node_modules/nightwatch-xhr/es5/commands"
     ],
     "custom_assertions_path": [
          "./node_modules/nightwatch-xhr/es5/assertions"
     ],
     "test_workers": {
          "enabled": false,
          "workers": 0
     },
     "test_settings": {
          "default": {
               "localOption": true,
               "videoRecorder": false,
               "skip_testcases_on_fail": false,
               "end_session_on_fail": false,
               "disable_error_log": false,
               "launch_url": "https://nightwatchjs.org",
               "screenshots": {
                    "enabled": false,
                    "path": "screens",
                    "on_failure": true
               },
               "desiredCapabilities": {
                    "browserName": "chrome"
               },
               "webdriver": {
                    "port": 9515,
                    "start_process": true,
                    "server_path": "node_modules/chromedriver/lib/chromedriver/chromedriver.exe"
               }
          }
     },
     "live_output": true,
     "detailed_output": true,
     "test_runner": {
          "type": "default",
          "options": {
               "bail": false,
               "retries": 0
          }
     }
}
                  module.exports = new Promise(resolve => {
                    resolve(settings);
                  });
                  module.exports.settings = settings

Nightwatch.js Version

2.6.7

Node Version

16.19.0

Browser

chrome

Operating System

win10

Additional Information

No response

@vaibhavsingh97
Copy link
Member

@mostmentor Thanks for reporting the issue. Can you please attach the HTML Report here? It would help us a lot in detecting the root cause of the problem.

@mostmentor
Copy link
Author

mostmentor commented Jan 16, 2023

index.zip

@vaibhavsingh97 Here is the HTML report

@vaibhavsingh97
Copy link
Member

Thanks, @mostmentor, for the HTML Report.

From the looks of it, Nightwatch didn't report anything since it's more of a javascript error, and the front end broke because of it. A nice error message should be the right fix.

@vaibhavsingh97 vaibhavsingh97 added the reporters Issues related to Nightwatch Reporters, and custom reporters integrations label Jan 16, 2023
@mostmentor
Copy link
Author

Is it possible for nightwatch to fail the test because of javascript errors ?
I will never know the test is not running if it's not reported in nightwatch as failure

@vaibhavsingh97
Copy link
Member

vaibhavsingh97 commented Jan 17, 2023

Is it possible for nightwatch to fail the test because of javascript errors ?

Nightwatch never ran the tests and failed when it required all the files to run it. Since there was a javascript issue, you must have seen the Actionable Error Message. This is an issue, as HTML Report should never be written in such a case, as the e2e test never ran.

Ref:
image

@gravityvi gravityvi added p3 and removed p1 labels Sep 6, 2023
@gravityvi gravityvi changed the title Test status is never reported if variable is called that doesn't exists HTML reporter should not be produced in case of type errors Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug html-reporter p3 reporters Issues related to Nightwatch Reporters, and custom reporters integrations
Projects
None yet
Development

No branches or pull requests

4 participants