Skip to content
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

Expand before:browser:launch to pass options argument instead of args #6306

Closed
jennifer-shehane opened this issue Feb 3, 2020 · 3 comments
Closed
Assignees
Labels
type: breaking change Requires a new major release version

Comments

@jennifer-shehane
Copy link
Member

Current behavior:

The current implementation of working off of the args Array during before:browser:launch is restrictive and doesn't allow for future adaptations needed.

Desired behavior:

Deprecate before:browser:launch argument args: string[] in favor of more configurable launchOptions: object, which allows user to control extensions, user preferences, and launch arguments passed to the browser.

Versions

3.8.2

@jennifer-shehane jennifer-shehane added the type: breaking change Requires a new major release version label Feb 3, 2020
@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review stage: pending release and removed stage: work in progress labels Feb 5, 2020
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Feb 5, 2020

The code for this is done in cypress-io/cypress#6293, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Feb 5, 2020
@kuceb
Copy link
Contributor

kuceb commented Feb 12, 2020

closed in #6293

@kuceb kuceb closed this as completed Feb 12, 2020
derevnjuk added a commit to NeuraLegion/cypress-har-generator that referenced this issue Feb 18, 2020
BREAKING CHANGE: The `ensureRequiredBrowserFlags` method is no longer supported. It was renamed the `ensureBrowserFlags` and now it accepts the second argument as an [options](cypress-io/cypress#6306) object with an args property instead of an array of browser arguments.

Before:

```js
// cypress/plugins/index.js

const { install, ensureRequiredBrowserFlags } = require('@neuralegion/cypress-har-generator');

module.exports = (on, config) => {
  install(on, config);

  on('before:browser:launch', (browser = {}, args) =>
    ensureRequiredBrowserFlags(browser, args)
  );
};
```

After:

```js
// cypress/plugins/index.js

const { install, ensureBrowserFlags } = require('@neuralegion/cypress-har-generator');

module.exports = (on, config) => {
  install(on, config);

  on('before:browser:launch', (browser = {}, launchOptions) => {
    ensureBrowserFlags(browser, launchOptions);
    return launchOptions;
  });
};
```

closes #31
derevnjuk added a commit to NeuraLegion/cypress-har-generator that referenced this issue Feb 18, 2020
BREAKING CHANGE: The `ensureRequiredBrowserFlags` method is no longer supported. It was renamed the `ensureBrowserFlags` and now it accepts the second argument as an [options](cypress-io/cypress#6306) object with an args property instead of an array of browser arguments.

Before:

```js
// cypress/plugins/index.js

const { install, ensureRequiredBrowserFlags } = require('@neuralegion/cypress-har-generator');

module.exports = (on, config) => {
  install(on, config);

  on('before:browser:launch', (browser = {}, args) =>
    ensureRequiredBrowserFlags(browser, args)
  );
};
```

After:

```js
// cypress/plugins/index.js

const { install, ensureBrowserFlags } = require('@neuralegion/cypress-har-generator');

module.exports = (on, config) => {
  install(on, config);

  on('before:browser:launch', (browser = {}, launchOptions) => {
    ensureBrowserFlags(browser, launchOptions);
    return launchOptions;
  });
};
```

closes #31
@jennifer-shehane
Copy link
Member Author

Released in 4.0.0

@cypress-io cypress-io locked as resolved and limited conversation to collaborators Mar 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: breaking change Requires a new major release version
Projects
None yet
Development

No branches or pull requests

2 participants