nightwatchjs / nightwatch

Integrated end-to-end testing framework written in Node.js and using W3C Webdriver API. Developed at @browserstack
https://nightwatchjs.org
MIT License
11.83k stars 1.32k forks source link

NightWatch not Creating new XML and HTML reports in Tests_output folder #3583

Closed ZScannell closed 1 year ago

ZScannell commented 1 year ago

Description of the bug/issue

When I was running builds on a Jenkins server I noticed that the XML and HTML test results were not being recreated on a build-by-build basis. They are not being overwritten, meaning that the results being shown are from a test run on last Friday and not this friday.

Steps to reproduce

  1. Run the command "npx nightwatch ./test/reducedtestcase"
  2. Navigate to the tests output folder.
  3. See that the test results are not from the current batch of testing.

Sample test

describe('Testing Academy Only Access', function() {

    before(browser => {    
        browser.navigateTo('https://www.google.com');
        browser.fullscreenWindow();
    });

    it('Attempt to Login to Test User', () => {
        //browser.fullscreenWindow();
        browser.verify.titleEquals('Google');    // Tests that Sign-In was Successful
    });
    after(browser => {
      // This is used to close the browser's session
      browser.end();
    }); 
  });

Command to run

npx nightwatch ./test/reducedtestcase

Verbose Output

No response

Nightwatch Configuration

module.exports = {
  // An array of folders (excluding subfolders) where your tests are located;
  // if this is not specified, the test source must be passed as the second argument to the test runner.
  src_folders: ['test','nightwatch/examples'],

  // See https://nightwatchjs.org/guide/concepts/page-object-model.html
  page_objects_path: ['nightwatch/page-objects'],

  // See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-commands.html
  custom_commands_path: ['nightwatch/custom-commands'],

  // See https://nightwatchjs.org/guide/extending-nightwatch/adding-custom-assertions.html
  custom_assertions_path: ['nightwatch/custom-assertions'],

  // See https://nightwatchjs.org/guide/extending-nightwatch/adding-plugins.html
  plugins: [],

  // See https://nightwatchjs.org/guide/concepts/test-globals.html
  globals_path: '',

  webdriver: {},

  test_workers: {
    enabled: true
  },

  output_folder: 'tests_output/test',

  test_settings: {
    default: {
      skip_testcases_on_fail: false,
      disable_error_log: false,
      launch_url: 'http://localhost',

      screenshots: {
        enabled: false,
        path: 'screens',
        on_failure: true
      },

      desiredCapabilities: {
        browserName: 'chrome'
      },

      webdriver: {
        start_process: true,
        server_path: ''
      },

    },

    firefox: {
      desiredCapabilities: {
        browserName: 'firefox',
        alwaysMatch: {
          acceptInsecureCerts: true,
          'moz:firefoxOptions': {
            args: [
              "start-maximized"
              // '-headless',
              // '-verbose'
            ]
          }
        }
      },
      webdriver: {
        start_process: true,
        server_path: '',
        cli_args: [
          // very verbose geckodriver logs
          // '-vv'
        ]
      }
    },

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        'goog:chromeOptions': {
          // More info on Chromedriver: https://sites.google.com/a/chromium.org/chromedriver/
          //
          // w3c:false tells Chromedriver to run using the legacy JSONWire protocol (not required in Chrome 78)
          w3c: true,
          args: [
            "start-maximized"
            //'--no-sandbox',
            //'--ignore-certificate-errors',
            //'--allow-insecure-localhost',
            //'--headless'
          ]
        }
      },

      webdriver: {
        start_process: true,
        server_path: '',
        cli_args: [
          // --verbose
        ]
      }
    },

  },

  usage_analytics: {
    enabled: true,
    log_path: './logs/analytics',
    client_id: '5aee7a6c-ec08-491b-a9c3-f2a5ef371d2a'
  }

};

Nightwatch.js Version

2.6.10

Node Version

18.13.0

Browser

Firefox 108.0.2; Chrome 109.0.5414.75

Operating System

Windows 10 Pro 19044.2364

Additional Information

No response

vaibhavsingh97 commented 1 year ago

@ZScannell, Thanks for raising the issue. I am not able to reproduce the problem. Please confirm if you are using Docker with Jenkins and if Jenkins has access to the file system where the folder is located.

AutomatedTester commented 1 year ago

Closing as info not provided