-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested
Description
Have you read the Contributing Guidelines on issues?
- I have read the Contributing Guidelines on issues.
WebdriverIO Version
9.0.8
Node.js Version
22.9.0
Mode
WDIO Testrunner
Which capabilities are you using?
export const mobileWebCapabilities = [
{
chromeBrowser: {
hostname: '127.0.0.1',
"port": 9515,
"path": "/",
capabilities: {
browserName: 'chrome',
'goog:chromeOptions': {
args: ['--start-maximized']
},
'webdriver:options': {
hostname: '127.0.0.1',
port: 41325,
path: '/'
}
}
},
androidDevice: {
hostname: '127.0.0.1',
port: 4723,
path: '/wd/hub',
capabilities: {
//Device 1
...commonMobileCapabilities,
"appium:systemPort": 8200,
}
}
}
]What happened?
If I use addCommand with multiple browser capabilities or at least one named browser, the addCommand is not applied to all browser.
With :
before(() => {
browser.addCommand('test', async function () {
console.log('test')
})
})
Current behavior :
- browser.test() -> Working
- chromeBrowser.test() -> is not a function
- androidDevice.test() -> is not a function
What is your expected behavior?
The command should be available for all browser so :
- browser.test() -> Working
- chromeBrowser.test() -> Working
- androidDevice.test() -> Working
How to reproduce the bug.
- Use a capabilities with at least one named browser
- AddCommand on "browser" (not on the name of the browser from step 1)
- Use the new command chain to browser name from step 1
Issue similar to this old fixed issue ?
Relevant log output
androidDevice.test() is not a functionCode of Conduct
- I agree to follow this project's Code of Conduct
Is there an existing issue for this?
- I have searched the existing issues
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Bug 🐛help wantedIssues that are free to take by anyone interestedIssues that are free to take by anyone interested