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

Getting error cy.currentSubject is not a function #21

Closed
shash-hegde opened this issue Sep 2, 2022 · 4 comments · Fixed by #22
Closed

Getting error cy.currentSubject is not a function #21

shash-hegde opened this issue Sep 2, 2022 · 4 comments · Fixed by #22
Labels
enhancement New feature or request released

Comments

@shash-hegde
Copy link

Getting error cy.currentSubject is not a function on using the cypress if plugin
Cypress Version: 9.6.0

Below is the sample code:

	cy.get('div[role="dialog"]')
			.if('visible')
			.then(() => {
				cy.log('closing the dialog');
				cy.contains('button', 'Close').click();
			})
			.else()
			.then(() => {
				cy.log('Already closed');
			});

cypress if

@bahmutov
Copy link
Owner

bahmutov commented Sep 2, 2022

Yeah, this is Cypress v10 function. I am not sure if I want to maintain this plugin to be backwards compatible and work in Cypress v9. I will think about it, but if anyone wants to open a PR (has to be testing it too), that would be nice

@bahmutov bahmutov added the enhancement New feature or request label Sep 2, 2022
@elainedcb
Copy link

I'm also getting this error in Cypress v10.2.0, is it only for higher v10 versions?

@bahmutov
Copy link
Owner

bahmutov commented Sep 6, 2022

Could use v9 testing approach similar to bahmutov/cypress-wait-if-happens#1

@github-actions
Copy link

github-actions bot commented Sep 6, 2022

🎉 This issue has been resolved in version 1.6.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants