-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Custom commands written in Typescript break e2e tests #2627
Comments
@lloiser can you suggest a fix? |
The problem is that nightwatch attempts to load both Probably the best option here is to ignore the |
@lloiser sounds good. thanks for looking into it. |
To be clear, this problem still happens if there is no JS file. It sounds like the proposed solution (ignore |
By default, NodeJS does not know how to compile and execute .ts files. Therefore it is up to the user of nightwatch to make sure that all the code is executable. There are multiple solutions to use typescript:
|
Ah, I was wondering how this was supposed to work. So you're saying it is not expected for Nightwatch to work with just |
Describe the bug
After upgrading from Nightwatch 1.5.1 to Nightwatch 1.6.0 or 1.6.1, my end-to-end tests will not run. Unit tests are fine. See repro below.
Note, in the repro below I am compiling the TypeScript and electing to run the JS versions. But the same thing happens if I do not compile the TS and instead run it directly. This error does not happen if I compile to TS and then remove the command TS file, regardless of whether I'm executing a JS or TS test.
Sample test
tests/e2e/test.ts
tests/commands/wait.ts
Set up with
$ npm install $ npx selenium-standalone install --version=3.141.59 --drivers.chrome.version="$(curl -fs "https://chromedriver.storage.googleapis.com/LATEST_RELEASE")"
Run with command
$ tsc && npx nightwatch -c ./nightwatch.conf.js --test=tests/e2e/test.js --verbose
Verbose output
debug.log
Configuration
nightwatch.conf.js
package.json
tsconfig.json
Your Environment
nightwatch --version
npm --version
node --version
The text was updated successfully, but these errors were encountered: