I am trying to get end to end testing working in our bitbucket pipeline environment using nightwatch.js, we have hit a problem. How can we keep the dev server running and run the tests referencing the dev server.
This isn't a problem on our local machine since I can run two windows. Though I haven't found a way to emulate this in bitbucket pipelines. Any ideas, articles or pointers for how to achieve this?
bitbucket-pipelines.yml
image: atlassian/default-image:2
pipelines:
default:
- step:
name: NewHomePageNav
script:
- npm install
- npm test
nightwatch.config.js
module.exports = {
"src_folders": [
"test/Testinprogress",
],
"page_objects_path": "./dist/",
"webdriver": {
"start_process": true,
"server_path": "node_modules/.bin/chromedriver",
"cli_args": [
"--verbose"
],
"port": 9515
},
"test_workers": {
"enabled": true,
"workers": "auto"
},
"output_folder": "reports", // reports (test outcome) output by nightwatch
"test_settings": {
"launch_url" : "http://localhost:8080"
"default": {
"skip_testcases_on_fail": false,
"globals": {
"waitForConditionTimeout": 5000 // sometimes internet is slow so wait.
},
"desiredCapabilities": {
"browserName": "chrome",
"acceptSslCerts": true,
"acceptInsecureCerts": true,
"javascriptEnabled": true,
"chromeOptions": {
"args": [
"--no-sandbox",
"--headless",
]
},
"loggingPrefs": {
"driver": "INFO",
"server": "OFF",
"browser": "INFO"
}
}
}
}
}