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

--test/-t switch non functional in build 1.3.6 on ubuntu 18.04 with nodejs 12 #2444

Closed alexanderdevm closed 4 years ago

alexanderdevm commented 4 years ago

Describe the bug

Previous builds on nighwatch js support --test to specify the test file that needs to be executed.

In the current build, -t/--test doesn't do anything, nightwatch just executes the entire suite. To specify which test need to be executed all what need to be done is to specify the path without the --test switch. Also --testcase does not need --test to work anymore.

Is this intentional change and the wiki page has not been updated or its a bug?

Run with command

LAUNCHURL=xx... nightwatch --test test/test1.js -e chromeDevelopment --output dev_report

Configuration

nightwatch.json

```js { "src_folders": ["tests"], "disable_colors": true, "output_folder": "reports", "custom_commands_path": ["node_modules/nightwatch-vrt/commands", "./customCommands"], "custom_assertions_path": "node_modules/nightwatch-vrt/assertions", "page_objects_path": "pageObjects", "skip_testcases_on_fail": false, "end_session_on_fail": true, "globals_path": "globals.js", "webdriver": { "start_process": false, "server_path": "", "log_path": "", "host": "127.0.0.1", "port": 4444 }, "test_settings": { "default": { "globals": { "visual_regression_settings": { "generate_screenshot_path": "", "latest_screenshots_path": "vrt/latest", "latest_suffix": "", "baseline_screenshots_path": "", "baseline_suffix": "", "diff_screenshots_path": "vrt/diff", "diff_suffix": "", "threshold": 0.3, "prompt": false, "always_save_diff_screenshot": false } }, "selenium_port": 4444, "selenium_host": "localhost", "silent": false, "screenshots": { "enabled": true, "on_failure": true, "path": "./screenshots" }, "desiredCapabilities": { "acceptInsecureCerts": true, "acceptSslCerts": true }, "webdriver": { "use_legacy_jsonwire": true } }, "chromeDevelopment": { "silent": true, "screenshots": { "enabled": true, "on_failure": true }, "webdriver": { "port": 9515, "server_path": "node_modules/chromedriver/bin/chromedriver", "start_process": true }, "desiredCapabilities": { "browserName": "chrome", "chromeOptions": { "args": [ "screenshot", "disable-web-security", "ignore-certificate-errors", "disable-dev-shm-usage", "no-sandbox", "window-size=1920,1080", "use-gl=swiftshader", "diable-gpu" ] } } }, "chrome": { "silent": true, "screenshots": { "enabled": true, "on_failure": true }, "webdriver": { "port": 9515, "server_path": "node_modules/chromedriver/bin/chromedriver", "start_process": true }, "desiredCapabilities": { "browserName": "chrome", "chromeOptions": { "args": [ "screenshot", "disable-web-security", "ignore-certificate-errors", "disable-dev-shm-usage", "no-sandbox", "window-size=1920,1080", "use-gl=swiftshader" ] }, "goog:chromeOptions": { "args": [ "--disable-web-security", "--ignore-certificate-errors", "--headless", "--no-sandbox", "--disable-popup-blocking", "--disable-infobars", "--enable-automation" ], "useAutomationExtension": true } } }, "firefoxDevelopment": { "silent": true, "screenshots": { "enabled": true, "on_failure": true }, "webdriver": { "port": 4444, "server_path": "node_modules/geckodriver/bin/geckodriver" }, "desiredCapabilities": { "browserName": "firefox", "moz:firefoxOptions": { "args": ["--width=1920", "--height=1080"] } } }, "firefox": { "silent": true, "screenshots": { "enabled": true, "on_failure": true }, "webdriver": { "port": 4444, "server_path": "node_modules/geckodriver/bin/geckodriver" }, "desiredCapabilities": { "browserName": "firefox", "moz:firefoxOptions": { "args": ["-headless", "--width=1920", "--height=1080"] } } }, "edge": { "desiredCapabilities": { "browserName": "MicrosoftEdge" } } } } ```

Your Environment

Executable Version
nightwatch --version 1.3.6
npm --version 6.14.5
node --version 12.18.1
Browser driver Version
chromedriver 83.0.0
OS Version
Ubuntu 18.04
beatfactor commented 4 years ago

Remove the --test and do simply: nightwatch test/test1.js.

alexanderdevm commented 4 years ago

Remove the --test and do simply: nightwatch test/test1.js.

Yes this is what I am doing now. I just wanted to know if the switch --test is permanently removed for build 1.3.6 on Ubuntu/Cent7 moving forward.

beatfactor commented 4 years ago

No, but this is a sort of legacy option which was supposed to identify individual test files relative to the folder specified in the src_folders option. Is test a subfolder inside the tests folder? If not, it's probably why it's not working for you, given the config which you have specified. In any case, it's a bit of an unnecessary option at this moment and it will be probably be deprecated soon.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any recent activity. If possible, please retry using the latest Nightwatch version and update the issue with any relevant details. If no further activity occurs, it will be closed. Thank you for your contribution.