pako88 / wdio-mocha-typescript Goto Github PK
View Code? Open in Web Editor NEWBoilerplate for wdio6 with mocha, typescript, eslint and many more features
License: MIT License
Boilerplate for wdio6 with mocha, typescript, eslint and many more features
License: MIT License
After i clone this project, run eslint and tried run command 'npm run test:devtools', below error happened:
(node:67142) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'promise' of undefined
at TraceGatherer.onLoadEventFired (/Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/@wdio/devtools-service/build/gatherer/trace.js:117:67)
at /Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:62
at Array.map ()
at Object.emit (/Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/puppeteer-core/lib/cjs/vendor/mitt/src/index.js:51:43)
at CDPSession.emit (/Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/puppeteer-core/lib/cjs/puppeteer/common/EventEmitter.js:72:22)
at CDPSession._onMessage (/Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:225:18)
at Connection._onMessage (/Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/puppeteer-core/lib/cjs/puppeteer/common/Connection.js:101:25)
at WebSocket. (/Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/puppeteer-core/lib/cjs/puppeteer/common/WebSocketTransport.js:13:32)
at WebSocket.onMessage (/Users/i065037/Documents/Innovation/wdio-mocha-typescript/node_modules/ws/lib/event-target.js:125:16)
at WebSocket.emit (events.js:215:7)
[0-1] (node:67142) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
Hey ๐
Thanks for providing this boilerplate project. It seems like it uses WebdriverIO v6 or older which are versions that the WebdriverIO team has deprecated. Please update the dependencies as we otherwise have to remove it from our docs.
Let me know if you have any questions! Thank you!
This all looks great, thank you for putting it together. But instructions are lacking. How do I run tests? I expected to see a wdio.conf.js file.
$ npm install
[...]
$ npm run test:chromedriver <<<
> [email protected] test:chromedriver /Users/thomer/tmp/nobackup/wdio-mocha-typescript
> npx wdio config/chromedriver.conf.js
Execution of 7 spec files started at 2020-07-09T13:31:53.960Z
Could not find chromedriver in default path: /Users/thomer/tmp/nobackup/wdio-mocha-typescript/node_modules/chromedriver/lib/chromedriver/chromedriver
Falling back to use global chromedriver bin
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn /Users/thomer/tmp/nobackup/wdio-mocha-typescript/node_modules/chromedriver/lib/chromedriver/chromedriver ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /Users/thomer/tmp/nobackup/wdio-mocha-typescript/node_modules/chromedriver/lib/chromedriver/chromedriver',
path: '/Users/thomer/tmp/nobackup/wdio-mocha-typescript/node_modules/chromedriver/lib/chromedriver/chromedriver',
spawnargs: [ '--port=9515', '--url-base=/' ]
}
[0-1] RUNNING in chrome - /test/specs/webdriver/the-internet/actions.ts
[0-1] Error: Failed to create session.
Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-0] RUNNING in chrome - /test/specs/webdriver/basic.ts
[0-0] Error: Failed to create session.
Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-1] FAILED in chrome - /test/specs/webdriver/the-internet/actions.ts
[0-0] FAILED in chrome - /test/specs/webdriver/basic.ts
[0-2] RUNNING in chrome - /test/specs/webdriver/the-internet/chained-locator-with-multiple-elements.ts
[0-2] Error: Failed to create session.
Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-3] RUNNING in chrome - /test/specs/webdriver/the-internet/draganddrop.ts
[0-3] Error: Failed to create session.
Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-2] FAILED in chrome - /test/specs/webdriver/the-internet/chained-locator-with-multiple-elements.ts
[0-3] FAILED in chrome - /test/specs/webdriver/the-internet/draganddrop.ts
[0-4] RUNNING in chrome - /test/specs/webdriver/the-internet/dropdown.ts
[0-4] Error: Failed to create session.
Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-5] RUNNING in chrome - /test/specs/webdriver/the-internet/fileupload.ts
[0-5] Error: Failed to create session.
Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-4] FAILED in chrome - /test/specs/webdriver/the-internet/dropdown.ts
[0-5] FAILED in chrome - /test/specs/webdriver/the-internet/fileupload.ts
[0-6] RUNNING in chrome - /test/specs/webdriver/the-internet/iframe.ts
[0-6] Error: Failed to create session.
Unable to connect to "http://localhost:9515/", make sure browser driver is running on that address.
If you use services like chromedriver see initialiseServices logs above or in wdio.log file as the service might had problems to start the driver.
[0-6] FAILED in chrome - /test/specs/webdriver/the-internet/iframe.ts
Spec Files: 0 passed, 7 failed, 7 total (100% completed) in 00:00:16
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test:chromedriver: `npx wdio config/chromedriver.conf.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test:chromedriver script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/thomer/.npm/_logs/2020-07-09T13_32_11_056Z-debug.log```
I did have typescript error on my source code.
[0-0] PASSED in chrome - /test/specs/basic/01_new_apartments.spec.ts
Spec Files: 1 passed, 1 total (100% completed) in 00:00:06
it('should take screenshot',() => {
browser.thisIsACrapButButStillShowingSuccess()?????
});
Any idea?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.