Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ for (const { descriptor, inlineScriptType } of typesOfInlineScripts) {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=anchor-link]`).click()
cy.get(`table[id=script-mark-records] tbody`) // Make sure history has time to change
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-mark-records] tbody`)
.children()
Expand Down Expand Up @@ -174,8 +174,8 @@ for (const { descriptor, inlineScriptType } of typesOfInlineScripts) {
it(`should load only once if the page is revisited via browser back/forward buttons after Gatsby link navigation`, () => {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=gatsby-link]`).click()
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-mark-records] tbody`)
.children()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ describe(`scripts with sources`, () => {
it(`should load only once if the page is revisited via browser back/forward buttons after anchor link navigation`, () => {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=anchor-link]`).click()
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-resource-records] tbody`)
.children()
Expand Down Expand Up @@ -150,8 +150,8 @@ describe(`scripts with sources`, () => {
it(`should load only once if the page is revisited via browser back/forward buttons after Gatsby link navigation`, () => {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=gatsby-link]`).click()
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-resource-records] tbody`)
.children()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,13 @@ const typesOfInlineScripts = [
},
]

Cypress.on('uncaught:exception', (err) => {
if ((err.message.includes('Minified React error #418') || err.message.includes('Minified React error #423') || err.message.includes('Minified React error #425')) && Cypress.env(`TEST_PLUGIN_OFFLINE`)) {
Cypress.on(`uncaught:exception`, err => {
if (
(err.message.includes(`Minified React error #418`) ||
err.message.includes(`Minified React error #423`) ||
err.message.includes(`Minified React error #425`)) &&
Cypress.env(`TEST_PLUGIN_OFFLINE`)
) {
return false
}
})
Expand Down Expand Up @@ -141,8 +146,8 @@ for (const { descriptor, inlineScriptType } of typesOfInlineScripts) {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=anchor-link]`).click()
cy.get(`table[id=script-mark-records] tbody`) // Make sure history has time to change
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-mark-records] tbody`)
.children()
Expand Down Expand Up @@ -180,8 +185,8 @@ for (const { descriptor, inlineScriptType } of typesOfInlineScripts) {
it(`should load only once if the page is revisited via browser back/forward buttons after Gatsby link navigation`, () => {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=gatsby-link]`).click()
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-mark-records] tbody`)
.children()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ const page = {
navigation: `/gatsby-script-navigation/`,
}

Cypress.on('uncaught:exception', (err) => {
if ((err.message.includes('Minified React error #418') || err.message.includes('Minified React error #423') || err.message.includes('Minified React error #425')) && Cypress.env(`TEST_PLUGIN_OFFLINE`)) {
Cypress.on(`uncaught:exception`, err => {
if (
(err.message.includes(`Minified React error #418`) ||
err.message.includes(`Minified React error #423`) ||
err.message.includes(`Minified React error #425`)) &&
Cypress.env(`TEST_PLUGIN_OFFLINE`)
) {
return false
}
})
Expand Down Expand Up @@ -131,8 +136,8 @@ describe(`scripts with sources`, () => {
it(`should load only once if the page is revisited via browser back/forward buttons after anchor link navigation`, () => {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=anchor-link]`).click()
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-resource-records] tbody`)
.children()
Expand Down Expand Up @@ -162,8 +167,8 @@ describe(`scripts with sources`, () => {
it(`should load only once if the page is revisited via browser back/forward buttons after Gatsby link navigation`, () => {
cy.visit(page.navigation).waitForRouteChange()
cy.get(`a[href="${page.target}"][id=gatsby-link]`).click()
cy.go(`back`)
cy.go(`forward`)
cy.go(`back`).waitForRouteChange()
cy.go(`forward`).waitForRouteChange()

cy.get(`table[id=script-resource-records] tbody`)
.children()
Expand Down