-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Rerouting with target="_parent" causes "Whoops, there is no test to run" #3121
Comments
@jadiaz, this is because you have We should probably rewrite In the meantime, you should change your code to use |
Confirmed. Setting to |
@bkucera Brian mentioned that you are working on related work to this and this could be added to 3.1.6. |
I looked at the "anchor target Property" documentation (https://www.w3schools.com/jsref/prop_anchor_target.asp) It seems like there is a possible "framename" value that you can assign to the "target" property of anchors. Example: Some Link URL Looking at this, would it be possible to set the name of the iframe which Cypress injects to run tests to something like "cypress-runner-iframe". This way, you may update your anchor "target" attribute to point to that during your test runs. Maybe this is not ideal, but it would probably a way better solution to set the "target" to "_parent" since you may have multiple iframe layers in your application. |
Another clear reproducible example from #5938:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form method="post" target="_parent">
<input id="text_value" />
<button type="submit" id="submit_form">Save</button>
</form>
</body>
</html>
it('test', () => {
cy.visit('index.html')
cy.get('#text_value')
.type('My Text')
cy.get('#submit_form')
.click()
}) |
#5964 This issue resolved for me after modifying Configuration to "modifyObstructiveCode: true" from initial "modifyObstructiveCode: false". in Cypress.json |
so how do we want to fix this? modifyObstructiveCode does not seem to work for me. |
For me changing the attribute in the DOM worked:
|
@bkucera @jennifer-shehane In my application, the user accepts terms and conditions( a typical terms and conditions document where the the user scrolls down to the bottom and it asks the user to accept) and when the user clicks on the submit button, it throws "whoops no test found". There are no iframes, the submit section is as follows. < form method="post" action id="terms-form" > Any idea what is the cause of this error and how to address this. |
This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided. |
This issue has been closed due to inactivity. |
Current behavior:
test runner returns Whoops, there is no test to run. when clicking a link with selector:
'#sub-menu > ul > :nth-child(5) > a'
Desired behavior:
test passes after link is clicked.
Steps to reproduce: (app code and test code)
app code
test code
Versions
Mac OS - Mojave
Cypress v.3.1.4
Google Chrome Version 71.0.3578.98 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: