-
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
Default blank page, this page was cleared by navigating to about:blank #28527
Comments
According to your issue description, you are using Node.js Please check the Changelog for Cypress 13.0.0 and follow the recommendations there:
|
Ah that's really sad news, it looks like I missed that, will try to update node then |
@rdwentmp We'll need some set of tests to run to see the issue and investigate, if the upgrade doesn't help. |
changeCtrOwner(ctrOwner: string) {
cy.message(`changeCtrOwner`)
this.interceptChangeCtrOwner()
this.interceptDelegateUsers()
return this.getPxdRigidPipeAndFlowDesignCell()
.should('contain.text', ctrOwner)
.trigger('mouseenter')
.then(() => this.getPxdEditOwnerBtn().should('be.visible').click())
.then(() => this.waitDelegateUsers())
.then((engineerNames) => {
let newOwner = selectRandom(engineerNames)
let newOwnerFullName: string = newOwner.fullName
cy.message(`Change CTR owner to ${newOwnerFullName}`)
this.selectCtrOwner(newOwner.fullName)
.then(() => this.getDoneBtn().should('be.visible').click())
.then(() => this.getYesConfirmBtn().should('be.visible').click())
return this.waitChangeCtrOwner().then(() => {
return cy.wrap(newOwnerFullName)
})
})
}```
|
I have same problem , after every test case , the blank page appears |
I am also facing same issue 😞 |
https://docs.cypress.io/guides/core-concepts/test-isolation#Test-Isolation-Disabled |
I am facing the same issue, if it can help, I am running tests on Windows. |
Having same issue when running tests using headless browser only |
I am also facing the same issue with chrome , cypress 13.7.3 and testIsolation: false |
I am having the same issue today on v13.8.1. Like someone else here, I see it MOST of the time, but not all the time (like 98% of the time I get the bug. Didn't get it the first time). I also added testIsolation: false to my config, and it didn't help me any. But I think I've found a workaround! It's a really laaaaame workaround, but in a pinch, maybe it'll help: just tuck everything into just ONE big test body section! EXAMPLE: ... but once I changed it to THIS, it succeeded! The only difference is that I moved all the "cy." commands under just one heading: Please take all of this with a big pinch of salt... and PLEASE forgive any use on my part of poor terminology! As you can probably guess from the screenshots, it's only my first week learning Cypress. |
This helped me solve the issue. |
Do we have any news on that issue ? I got the same issue on my side and 'testIsolation' is not the good solution for it. |
@proko podrías compartir como lo solucionaste? te lo agradeceria. |
Do we have any updates on the above issue? I'm also getting the same problem after upgrading the cypress v 13. 'testIsolation' doesn't work for me. |
I got a temprorary fix for now. I add an additional function in a generic beforeEach() in order to detect if the application is loaded or not and if it's not I am cy.visiting again. I hope Cypress Team will provide a better solution for this :) |
Any new update on this ? |
Currently we do not regard this as an issue with Cypress. This change was intended to clear the page between tests. If someone can provide an example to run where the tests are behaving in a way that is not intended by Cypress, we can investigate. If you don't want your page to be cleared between tests, pass |
I believe there’s a misunderstanding in my original post. The behavior I’m reporting is inconsistent, and it’s not related to the testIsolation configuration. Consider a Cypress end-to-end testing file with multiple tests within a describe block (e.g., describe(it(...); it(...); it(...); ...)). Additionally, I've configured Cypress with the following settings: retries: {
openMode: true,
runMode: true,
experimentalStrategy: "detect-flake-and-pass-on-threshold",
experimentalOptions: {
maxRetries: 2,
passesRequired: 1,
},
}, Here’s the observed behavior: When Cypress encounters a failure during the initial test run, it doesn’t clear the page and retries the test according to the specified configuration (in this case, up to 2 retries). However, if another test within the same run fails and Cypress attempts a retry, it does clear the page. This behavior differs from the initial test runs. Please let me know if this explanation makes sense, or if you’d like me to provide clear examples. |
@naseradd The original issue didn't mention using experimental retries. Is this issue isolated to experimental retries then? Or does this behavior happen with just standard 'retries: #' set also. This makes more sense to possibly have a situation where the state is not correctly reset on some retries but it is reset on others. |
Is there any fix to the above issue? |
Hi team, testIsolation: false in cypress.config.js worked for me! |
I tried to reproduce the defect with a simplier sample but I am not able to reproduce it anymore unfortunately |
|
+1 added |
Got the same issue, using next |
experiencing the same issue on:
This is my config: module.exports = defineConfig({
chromeWebSecurity: false,
defaultCommandTimeout: 15000,
reporter: "cypress-multi-reporters",
reporterOptions: {
configFile: "cypress-reporter-config.json"
},
retries: 3,
viewportWidth: 1280,
viewportHeight: 1024,
pageLoadTimeout: 120000,
env: { CI, CYPRESS_OVERRIDE_MF_TEST_VERSION: process.env.CYPRESS_OVERRIDE_MF_TEST_VERSION },
urlPort: port,
urlDomain,
e2e: {
testIsolation: false,
baseUrl: `http://${slug}.${urlDomain}${port}`,
supportFile: "cypress/support/e2e.js",
specPattern: "cypress/integration/**/*.{js,jsx,ts,tsx}",
excludeSpecPattern: [
"cypress/integration/*/helpers/**/*.{js,jsx,ts,tsx}",
"cypress/integration/*/constants/**/*.{js,jsx,ts,tsx}"
],
setupNodeEvents(on, config) {
if (process.env.CI === "true") {
require("dd-trace/ci/cypress/plugin")(on, config);
}
registerPlugins({ on, webpackPath: path.resolve(__dirname, "./webpack.config.js") });
compareImagesPlugin(on);
cypressLogToOutput.install(on, (type, event) => {
if (event.level === "error" || event.type === "error") {
return true;
}
return false;
});
}
}
}); Any help would be appreciated. Issue is inconsistent and happens randomly on different specs. |
I also see this issue with
|
Yes, In our project we have many visual cypress tests, like hundreds. Now we are stuck on Cypress v13.4.0, any later version gets our coverage unstable and we see the above error with the rate like 1 on 50 tests, so our suite pretty much never pass. IDK what's going on here, but at this point Cypress after v13.4 is useless on large coverages. |
@mschile did you see this bug report by chance? It seems after your change https://github.com/cypress-io/cypress/pull/28213/files this issue started to be observed by many people including myself. It appears to be random, but maybe we didn't notice the pattern. Even if if (shouldAlwaysResetPage || !isLastTestThatWillRunInSuite) {
let nextTestHasTestIsolationOn
if (!isLastTestThatWillRunInSuite) {
const nextTest = nextTestThatWillRunInSuite(test, getAllSiblingTests(topSuite, getTestById))
const nextTestIsolationOverride = nextTest?._testConfig.unverifiedTestConfig.testIsolation
const topLevelTestIsolation = Cypress.originalConfig['testIsolation']
nextTestHasTestIsolationOn = nextTestIsolationOverride || (nextTestIsolationOverride === undefined && topLevelTestIsolation)
}
...
// This will navigate to about:blank if test isolation is on
await testBeforeAfterRunAsync(test, Cypress, { nextTestHasTestIsolationOn })
} Before your change Given the confirmed flakiness up the thread, my bet the issue is in this code... I guess important note would be about nature of my tests. We do visual screenshot testing with retry set to 3. Based on the speed of page render sometimes it takes 1 try to pass but sometimes it takes 3 tries until the page is in desired state (as the reference screenshot). Could it be that Honestly it seems like what's going on, I will try to debug runner and check this out. |
your observation is matching what I see in the code update (above) that likely cause this issue. I guess with that, the simple workaround would be to pass Example: describe(__filename, () => {
before(() => {
cy.visit('/maintenance')
})
it(
'should match visual snapshot',
() => {
cy.compareSnapshot('maintenance')
},
{testIsolation: false}
)
}) |
The above hack didn't work. The override parameter should be passed as describe(__filename, () => {
before(() => {
cy.visit('/maintenance')
})
it(
'should match visual snapshot',
{testIsolation: false}
() => {
cy.compareSnapshot('maintenance')
}
)
}) but for that we get CypressError: The config passed to your test-level overrides has the following validation error:
CypressError: The `testIsolation` configuration can only be overridden from a suite-level override. when setting on suite describe(__filename, {testIsolation: false}, () => {
before(() => {
cy.visit('/maintenance')
})
it(
'should match visual snapshot',
() => {
cy.compareSnapshot('maintenance')
}
)
}) no errors, but no effect of the hack. And with that another even simpler hack was found, just to add a fake last test that isn't subject for retry instability: describe(__filename, () => {
before(() => {
cy.visit('/maintenance')
})
it('should match visual snapshot', () => {
cy.compareSnapshot('maintenance')
})
// HACK: A fake last test in suite after which Cypress forcefully redirects to blank page for env reset
// TODO: To remove once https://github.com/cypress-io/cypress/issues/28527 is fixed,
// where Cypress doesn't account for retries of the last test in suite
it('should', () => {})
}) this helped me to fix this issue! I am certain it should help everyone in this thread @rdwentmp, @Hakonovrebo, @suman8025, @Daniel-Collins-QA, @naseradd, @gouyang I hope the CypressJS maintainers find an elegant monkey patch for mocha runner, to account for the test retry attempt and the number of retries in Cyress config in order to properly decide the value for |
Hi @eugenet8k 👋🏼, thanks for your investigation and sorry for the delay with this response. Reading through the original issue description and the comments, it appears there are two issues being described. The original issue is describing the intended behavior with test isolation which was enabled by default with Cypress v13. The second issue as you've discovered relates to incorrectly navigating to I've opened #30864 to fix the issue. |
Fantastic news @mschile, thank you for the fix! With the hack above we were able to move our giant coverage to the latest Cypress v13.17 and it increased the speed of execution for about 10-15%. So with the hacks removed, we are all set, until next time... |
I have the same issue #30918 |
Current behavior
During Cypress run the application page disappear and appear default blank page, after that test scenario fail with visibility of inputs. The issue occur randomly on different test scenarios, possibly some memory leak.
The Default blank page errors start to occur after upgrade Cypress version from 11.2.0 to 13.0.0.
I already set up migration guide and had to set up testIsolation: false, without that every test occur with default blank page, but still after done everything right the default blank page still occur random.
I think it looks like memory leak
Desired behavior
Cypress behave stable without clearing cache with appearing Default blank page
Test code to reproduce
Cypress Version
13.0.0
Node version
v14.21.3
Operating System
linux, macos
Debug Logs
Other
No response
The text was updated successfully, but these errors were encountered: