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

Publicly export withinSubject option on get command #2791

Merged
merged 7 commits into from Jul 9, 2019

Conversation

paul-sachs
Copy link

The get command has a hidden option called withinSubject which is mapped to the internal state of cypress. It can also be used to override the scope, primarily to disable it entirely so you can reach out of the within scope:

cy.get('form').within(form => {
  ...do form stuff
  // Access an element outside of the form
  cy.get('popoverElement', { withinSubject: null }).click();
  ...continue form stuff
});

@CLAassistant
Copy link

CLAassistant commented Nov 15, 2018

CLA assistant check
All committers have signed the CLA.

@paul-sachs paul-sachs changed the title Publicly export withinSubject field on get command Publicly export withinSubject option on get command Nov 15, 2018
Copy link
Contributor

@flotwig flotwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would also need a PR in cypress-io/cypress-documentation to add this option to https://docs.cypress.io/api/commands/get.html#Arguments

cli/types/index.d.ts Outdated Show resolved Hide resolved
cli/types/index.d.ts Outdated Show resolved Hide resolved
cli/types/index.d.ts Outdated Show resolved Hide resolved
paul-sachs pushed a commit to paul-sachs/cypress-documentation that referenced this pull request May 25, 2019
@paul-sachs
Copy link
Author

Also created PR for documentation: cypress-io/cypress-documentation#1722

paul-sachs added a commit to paul-sachs/cypress-documentation that referenced this pull request May 25, 2019
@flotwig flotwig merged commit 27ccf75 into cypress-io:develop Jul 9, 2019
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jul 9, 2019

Released in 3.4.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants