*No browser instance registered. Donāt import @wdio/globals outside of the WDIO testrunner context. Or you have two two different ā@wdio/globalsā packages installed.
Hi,
I believe this relates to a public MoT project. Which one? Can you share the repository URL?
Just looking at what you shared:
In the login.e2e.js you seem to import from ā@widio/globalsā
But the name of the library is ā@wdio/globalsā: Globals | WebdriverIO
However, this might not be the end of your issue. So Iād recommend fixing the require first and then feeding back what issues you might face afterwards (if you donāt then woohoo!)
Yes, itās the mot-cert-support-app-js repo.
Thanks for the heads up with the typo and correct import. It looks like the second error is still occurring.
No browser instance registered. Donāt import @wdio/globals outside of the WDIO testrunner context. Or you have two two different ā@wdio/globalsā packages installed.
No browser instance registered. Donāt import @wdio/globals outside of the WDIO testrunner context. Or you have two two different ā@wdio/globalsā packages installed.
Itās hard to advise based on the small fragment of code youāve shared. Would you be able to package your project up on GitHub and share the link for me to look at in more detail?
I did notice that I got a slightly different error if I didnāt run npm start first, but the error Iām seeing isā¦
[0-0] Error in "My Login application.should login with valid credentials"
Error: Can't call getText on element with selector ".card-title" because element wasn't found
at condition (file:///Users/kellykenyon/mot-cert-support-app-js-trunk/node_modules/expect-webdriverio/lib/matchers/element/toHaveText.js:4:24)
at Object.executeCommand (file:///Users/kellykenyon/mot-cert-support-app-js-trunk/node_modules/expect-webdriverio/lib/util/executeCommand.js:19:22)
at file:///Users/kellykenyon/mot-cert-support-app-js-trunk/node_modules/expect-webdriverio/lib/matchers/element/toHaveText.js:21:24
at waitUntil (file:///Users/kellykenyon/mot-cert-support-app-js-trunk/node_modules/expect-webdriverio/lib/utils.js:23:43)
at Object.toHaveText (file:///Users/kellykenyon/mot-cert-support-app-js-trunk/node_modules/expect-webdriverio/lib/matchers/element/toHaveText.js:20:18)
at Context.<anonymous> (/Users/kellykenyon/mot-cert-support-app-js-trunk/src/__tests__/Login.e2e.js:13:8)
I got a dev at work to help me- it was to do with the way I was set up for work code- this is his explanationā¦
So your Java issue (running npm start) was caused by ASDF injecting itās own Java version, other people wonāt have that issue. We solved that one by removing ASDF from the $PATH variable which means your terminal wonāt see itās custom Java version anymore.
The other issue around WebDriver was down to using the wrong command. The README.md file said to run npm test but actually for the E2E tests you need to run npm run wdio instead