WebDriver 5: Test fails with option manualStart=true: Cannot read property '$$' of undefined
See original GitHub issueIt seems to be a regression in WebDriver 5. It works well with WebDriver 4 unless you upgrade using npm i webdriver@5
.
It doesn’t depend if you change the string “WebDriverIO” => “WebDriver” (ver. 5) in config file and helper or if you keep using “WebDriverIO” (ver. 4) in your config/helper.
What are you trying to achieve?
I want to start browser manually
What do you get instead?
Provide console output if related. Use
--verbose
mode for more details.
$ ../../node_modules/.bin/codeceptjs run --verbose
2019-03-10T11:07:43.152Z DEBUG @wdio/config: @wdio/sync not found, running tests asynchronous
CodeceptJS v2.0.7
Using test root "/home/mira/workspace/mycodeceptjs/tests/manual"
Helpers: WebDriver, My
Plugins: screenshotOnFail
Manual --
[1] Starting recording promises
Emitted | suite.before ([object Object])
test something
Emitted | test.before ([object Object])
[1] Error | TypeError: Cannot read property '$$' of undefined
Emitted | test.failed ([object Object])
✖ "before each" hook: codeceptjs.before for "test something" in 2ms
[1] Error | TypeError: Cannot read property '$$' of undefined
TypeError: Cannot read property '$$' of undefined
Emitted | test.after ([object Object])
Emitted | suite.after ([object Object])
-- FAILURES:
1) Manual
"before each" hook: codeceptjs.before for "test something":
Cannot read property '$$' of undefined
ypeError: Cannot read property '$$' of undefined
at WebDriver._before (/home/mira/workspace/mycodeceptjs/node_modules/codeceptjs/lib/helper/WebDriver.js:419:28)
at recorder.add (/home/mira/workspace/mycodeceptjs/node_modules/codeceptjs/lib/listener/helpers.js:21:69)
at process._tickCallback (internal/process/next_tick.js:68:7)
FAIL | 0 passed, 1 failed // 8ms
Emitted | global.result ([object Object])
Emitted | global.after ([object Object])
Provide test source code if related
Feature("Manual");
Scenario("test something", (I) => {
I.startBrowser();
I.amOnPage("/");
I.stopBrowser();
});
my_helper.js:
class My extends Helper {
startBrowser() {
this.helpers["WebDriver"]._startBrowser();
}
stopBrowser() {
this.helpers["WebDriver"]._stopBrowser();
}
}
module.exports = My;
Details
- CodeceptJS version: 2.0.7
- NodeJS Version: 10.15.1
- Operating System: Ubuntu 18.10
- WebDriverIO: 5.7.1
- Configuration file:
exports.config = {
tests: "./*_test.js",
output: "./output",
helpers: {
WebDriver: {
url: "https://codecept.io",
browser: "chrome",
manualStart: true
},
My: {
require: "./my_helper.js",
},
},
include: {
I: "./steps_file.js"
},
bootstrap: null,
mocha: {},
name: "manual"
};
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This issue is still present on the newest version of CodeceptJS
Same issue!
TypeError: Cannot read property '$$' of undefined