Nightwatch Parallel test run issue

74 views
Skip to first unread message

Vishu Rock

unread,
Sep 15, 2018, 2:59:15 AM9/15/18
to NightwatchJs
I am running my test in parallel mode using the Nightwatch test workers. I have two tests inside my test folder. When i run my test two browser windows, these two windows interact with one another, for e.g. if a case says click a button in first test, the same button is clicked in the second window, even tough there is no case saying to do so in second test. This kind of interaction between the browsers causes my tests to fail. How do i a disable this interaction.

Following is configuration in my nightwatch.json file:

{
  "src_folders": ["tests"],
  "custom_commands_path": "",
  "custom_assertions_path": "",
  "page_objects_path": "pages",
  "selenium": {
    "start_process": true,
    "server_path": "lib/drivers/selenium-server-standalone-3.8.1.jar",
    "start_session": true,
    "log_path": "log/",
    "host": "127.0.0.1",
    "port": 4443,
    "cli_args": {
      "webdriver.chrome.driver": "lib/drivers/chromedriver"
    }
  },

  "test_workers": {
    "enabled": true,
    "workers": "auto"
  },

  "test_runner": {
    "type": "mocha",
    "options": {
      "ui": "bdd",
      "reporter": "mochawesome",
      "reporterOptions": {
        "json": true,
        "showSkipped": true,
        "showFailed": true,
        "showPassed": true,
        "reportPageTitle": "MC-AutomationTest",
        "saveJson": true,
        "overwrite": false,
        "timestamp": "default",
        "reportDir": "reports/",
        "reportTitle": "MC-AutomationTest",
        "reportFilename": "Test_Report"
      }
    }
  },

  "test_settings": {
    "skip_testcases_on_fail": false,
    "end_session_on_fail": false,
    "chrome": {
      "live_output": true,
      "launch_url": "http://localhost",
      "selenium_port": 4443,
      "selenium_host": "localhost",
      "silent": true,
      "screenshots": {
        "enabled": true,
        "path": "screenshots/chrome/"
      },
      "desiredCapabilities": {
        "browserName": "chrome",
        "chromeOptions": {
          "args": [
            "headless",
            "disable-web-security",
            "ignore-certificate-errors",
            "--test-type",
            "--disable-gpu=true"
          ]
        }
      }
    },
    "edge": {
      "desiredCapabilities": {
        "browserName": "MicrosoftEdge"
      }
    }
  }
}



Reply all
Reply to author
Forward
0 new messages