abauzac / nightwatch-typescript

Boilerplate for nightwatch end to end tests with typescript
18 stars 3 forks source link

incorrect globals path + failure to run #3

Open JohnnyZ opened 5 years ago

JohnnyZ commented 5 years ago

nightwatch.json

"globals_path": "tests/globalsModule.js"

set to

"globals_path": "tests/globalsModule.ts"

nightwatch-typescript@1.0.0 test /private/tmp/nightwatch/nightwatch-typescript nightwatch

There was an error while starting the test runner:

/private/tmp/nightwatch/nightwatch-typescript/tests/globalsModule.ts:2 import * as chromedriver from 'chromedriver'; ^

SyntaxError: Unexpected token * at new Script (vm.js:79:7) at createScript (vm.js:251:10) at Object.runInThisContext (vm.js:303:10) at Module._compile (internal/modules/cjs/loader.js:657:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:20:18)

abauzac commented 5 years ago

Hello @johnnyz Thanks for the feedback but i cannot reproduce your error When you run the test runner ( npm run test ) , the tests should execute javascript files. So you have to transpile this typescript project to javascript first. I run the three commands in the readme file (npm run selenium, npm run watch and npm run test) in 3 different shells

I'll fix the failing tests (wordpress url is not working anymore)