-
Notifications
You must be signed in to change notification settings - Fork 16
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
args.findIndex is not a function #5
Comments
I should also specify my deps:
This is my current workaround (doesn't use this lib): const path = require('path');
module.exports = (on, config) => {
on('before:browser:launch', async (browser, launchOptions) => {
if (browser.family === 'chromium' && browser.name !== 'electron') {
const extensionPath = path.resolve(__dirname, '../', '../', 'build'); // The folder where I build the unpacked extension
launchOptions.extensions.push(extensionPath);
}
return launchOptions;
});
}; |
I think it's because this package assumes that you have your scripts injected declaratively via |
@sir-dunxalot @evandavis fixed here #7 If you need it working now, you can use fixed version in package.json like this:
|
I'd like to get #7 merged if possible. |
This fixes it: on('before:browser:launch', async (browser = {}, launchOptions) => {
const loader = extension.load({
source: '/path/to/xt'
alias: 'coolExtension'
});
const args = await loader(browser, []);
launchOptions.args.push(...args);
return launchOptions;
}); |
@hitmands just a small typo; it's |
@Pithikos that was just because I had the import named differently on my codebase, |
Hi @ViRuSTriNiTy , There was (and still is) an open issue around the Was my snippet elaborated from yours? It wasn't an attack against your own copyrights. I also hope @ejoubaud will moderate your comment. |
This library is not needed anymore. You can launch a browser extension in the before launch hook like this: on('before:browser:launch', (browser = {}, launchOptions) => {
if (browser.name === 'chrome') {
launchOptions.extensions.push('/path/to/extension')
return launchOptions
}
}) |
@pietrofxq Yes, that is right, there is also an NPM module that implements this approach with additional bells and whistles: https://github.com/ejoubaud/cypress-browser-extension-plugin |
After installing this addon in a new Cypress test suite, I see the following error when opening a test in the browser:
Stack trace:
This error is caused by the following code:
Simplifying the implementation to the example shown in the Regular Usage section of the Readme does not change anything.
The text was updated successfully, but these errors were encountered: