-
-
Notifications
You must be signed in to change notification settings - Fork 16
docs: add more examples #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@erwinheitzman thanks for raising the PR. The idea of this recipe project is to have example recipes that are being tested. You see that all examples in here are somewhat connected to a test that runs in CI to ensure that the WebdriverIO examples actually work. Hence I would suggest to only add code samples that we actually have a way to verify that they are working. Wdyt? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some small 🐜 ... points 🤣
//... | ||
user: '<browserstack_username>' || process.env.BROWSERSTACK_USERNAME, | ||
key: '<browserstack_access_key>' || process.env.BROWSERSTACK_ACCESS_KEY, | ||
commonCapabilities: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never seen commonCapabilities
, is this new?
browserName: 'chrome', | ||
'custom:caps': { | ||
// custom configurations | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
// ... |
For consistency
'custom:caps': { | ||
// custom configurations | ||
} | ||
}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}] | |
}] | |
// ... |
For consistency
securityToken: "your security token" | ||
}], | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
securityToken: "your security token" | |
}], | |
}) | |
securityToken: "your security token" | |
// ... | |
}], | |
// ... | |
}) |
For consistency
runner: ['browser', { | ||
// network IP of the machine that runs the WebdriverIO process | ||
host: 'http://172.168.0.2' | ||
}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runner: ['browser', { | |
// network IP of the machine that runs the WebdriverIO process | |
host: 'http://172.168.0.2' | |
}] | |
// ... | |
runner: ['browser', { | |
// network IP of the machine that runs the WebdriverIO process | |
host: 'http://172.168.0.2' | |
}], | |
// ... |
For consistency
outputDir: 'trace', | ||
// ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
outputDir: 'trace', | |
// ... | |
// ... | |
outputDir: 'trace', |
For consistency
browserName, | ||
'goog:chromeOptions': { | ||
// given your wdio.conf.js is in the root directory and your compiled | ||
// web extension files are located in the `./dist` folder | ||
args: [`--load-extension=${path.join(__dirname, '..', '..', 'dist')}`] | ||
} | ||
}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
browserName, | |
'goog:chromeOptions': { | |
// given your wdio.conf.js is in the root directory and your compiled | |
// web extension files are located in the `./dist` folder | |
args: [`--load-extension=${path.join(__dirname, '..', '..', 'dist')}`] | |
} | |
}] | |
browserName, | |
'goog:chromeOptions': { | |
// given your wdio.conf.js is in the root directory and your compiled | |
// web extension files are located in the `./dist` folder | |
args: [`--load-extension=${path.join(__dirname, '..', '..', 'dist')}`], | |
// ... | |
} | |
}] | |
// ... |
For consistency
// ... | ||
capabilities: [{ | ||
browserName, | ||
'goog:chromeOptions': { | ||
extensions: [chromeExtension] | ||
} | ||
}] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ... | |
capabilities: [{ | |
browserName, | |
'goog:chromeOptions': { | |
extensions: [chromeExtension] | |
} | |
}] | |
// ... | |
capabilities: [{ | |
browserName, | |
'goog:chromeOptions': { | |
extensions: [chromeExtension] | |
} | |
}], | |
// ... |
For consistency
before: async (capabilities) => { | ||
const browserName = (capabilities as WebdriverIO.Capabilities).browserName | ||
if (browserName === 'firefox') { | ||
const extension = await fs.readFile(extensionPath) | ||
await browser.installAddOn(extension.toString('base64'), true) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before: async (capabilities) => { | |
const browserName = (capabilities as WebdriverIO.Capabilities).browserName | |
if (browserName === 'firefox') { | |
const extension = await fs.readFile(extensionPath) | |
await browser.installAddOn(extension.toString('base64'), true) | |
} | |
} | |
before: async (capabilities) => { | |
const browserName = (capabilities as WebdriverIO.Capabilities).browserName | |
if (browserName === 'firefox') { | |
const extension = await fs.readFile(extensionPath) | |
await browser.installAddOn(extension.toString('base64'), true) | |
} | |
}, | |
// ... |
For consistency
// ... | ||
before: () => { | ||
browser.addCommand('openExtensionPopup', openExtensionPopup) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
} | |
// ... |
For consistency
@christian-bromann i just realised that if I put these scripts in the main WebdriverIO repo and link to them from the same repo it should probably also work. Let me move them there as it's much better. I didn't take into account the intent/scope of the repo too well, thanks |
I think some of these examples could be maybe transformed into executable tests. The test doesn't need to do much other other then run the code involved in a somwhat meaningful way. So maybe we can keep some here that would be valuable but yes, you can also keep them within the core repo when they only have documentation purpose. |
No description provided.