christian-bromann on v8
rewrite bs package (compare)
christian-bromann on main
include asnyc await to screensh… (compare)
hey guys I am trying to get multi remote working, I am passing my caps as:
class MultiChromeCapabilities {
constructor(cliOptions) {
this.myChromeBrowser1 = {
capabilities: {
browserName: 'chrome'
}
},
this.myChromeBrowser2 = {
capabilities: {
browserName: 'chrome'
}
}
}
}
module.exports = MultiChromeCapabilities;
or
class MultiChromeCapabilities {
constructor(cliOptions) {
this.capabilities = {
myChromeBrowser1 = {
capabilities: {
browserName: 'chrome'
}
},
myChromeBrowser2 = {
capabilities: {
browserName: 'chrome'
}
}
}
}
}
module.exports = MultiChromeCapabilities;
Neither appears to be working:
ERROR @wdio/runner: Error: Couldn't identify browserName "undefined"
however browser is defined when I console log the caps:
myChromeBrowser1: { capabilities: { browserName: 'chrome' } },
myChromeBrowser2: { capabilities: { browserName: 'chrome' } }
Any ideas on what I may be doing wrong? Trying a vanilla install of wdio with just multi remote caps now...
Expect $(Products
) to be visible
Expected: "visible"
Received: "not visible"
Hi, I added takeScreenshot() in config file's afterTest setting. I got a large data value in the onTestEnd() event handler. I tried to convert that value to image. But couldn't. How to generate image file from that value?
wdio.conf.js
afterTest: async function (
test,
context, {
error,
result,
duration,
passed,
retries
}
) {
if (!passed) {
await browser.takeScreenshot();
}
}
customreporter.js
import WDIOReporter from '@wdio/reporter';
export default class CustomReporter extends WDIOReporter {
constructor(options) {
/*
* make reporter to write to the output stream by default
*/
options = Object.assign(options, {
stdout: true
});
super(options);
}
onTestEnd(test) {
if (test.state === 'failed') {
//conversion code
}
}
}
I get this error: Error: The "from" argument must be of type string. Received undefined
. From the stack trace I can see that it is related to cucumber somehow.
This is the stack trace:
2021-04-08T18:29:37.403Z ERROR @wdio/runner: TypeError [ERR_INVALID_ARG_TYPE]: The "from" argument must be of type string. Received undefined
at validateString (internal/validators.js:120:11)
at Object.relative (path.js:437:5)
at getDefinitionLineAndUri (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:184:27)
at buildStepDefinitionConfig (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\build_helpers.js:124:7)
at SupportCodeLibraryBuilder.defineStep (C:\my-project\node_modules\cucumber\lib\support_code_library_builder\index.js:51:79)
at Object.<anonymous> (C:\my-project\src\step_definitions\/accountSummary_steps.js:6:1)
at Module._compile (internal/modules/cjs/loader.js:1137:30)
at Module._compile (C:\my-project\node_modules\pirates\lib\index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
at Object.newLoader [as .js] (C:\my-project\node_modules\pirates\lib\index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:985:32)
at Module._load (internal/modules/cjs/loader.js:878:14)
at Function.hookedLoader [as _load] (C:\my-project\node_modules\mockery\mockery.js:111:12)
at Module.require (internal/modules/cjs/loader.js:1025:19)
at require (internal/modules/cjs/helpers.js:72:18)
at C:\my-project\node_modules\@wdio\cucumber-framework\build\index.js:204:13
In my steps.js file I only have:
When(/^I click on My account details link$/, function () {
loggedInHeaderModule.openAccountSummary();
});
This is my package.json dependencies:
"dependencies": {
"@babel/cli": "^7.2.3",
"@babel/plugin-proposal-export-default-from": "^7.5.2",
"@babel/preset-env": "^7.4.2",
"@babel/register": "^7.4.0",
"@types/cucumber": "^7.0.0",
"@wdio/cli": "^7.3.1",
"@wdio/config": "^7.3.1",
"@wdio/cucumber-framework": "^7.3.1",
"@wdio/local-runner": "^7.3.1",
"@wdio/selenium-standalone-service": "^7.3.1",
"@wdio/spec-reporter": "^7.3.1",
"@wdio/sync": "^7.3.1",
"chai": "^4.3.4",
"cucumber": "^6.0.5",
"eslint-plugin-wdio": "^7.0.0",
"file-system": "^2.2.2",
"mjpeg-consumer": "^2.0.0",
"node-fetch": "^2.6.1",
"webdriverio": "^7.3.1",
"yarn": "^1.22.10"
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@wdio/allure-reporter": "^7.3.1",
"@wdio/browserstack-service": "^7.3.1",
"@wdio/junit-reporter": "^7.3.1",
"babel-eslint": "^10.1.0",
"babel-jest": "^26.6.3",
"eslint": "^7.23.0",
"eslint-plugin-import": "^2.22.1",
"forever": "^3.0.4",
"jest": "^26.6.3",
"npm-run-all": "^4.1.5"
}
I don't have clue what could be wrong. Anybody has any idea? Thanks!
Hi,
We are working on the WDIO-7 upgrade for our mobile framework and we noticed that our perfecto authentication invokes with token in WDIO-5. Now WDIO-7 required user and key for authentication as per the docs [ https://webdriver.io/docs/options/#user ] but its not working as expected when we tried.
Kindly assist
Hi,
Using WDIO V7, Typescript, Cucumber FK.
I've been looking and searching around, gave a call to a friend" for a clue (a developper in the project).
We must have missed something that should be more than obvious...
Question is : how do you access cucumbers World (this.) into the beforeScenario Hook of WDIO ?