-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(deps): Update to cypress 4.11.0 (#19)
- Loading branch information
1 parent
eee2a44
commit d368b9c
Showing
8 changed files
with
141 additions
and
142 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Lighthouse CI for Netlify sites | ||
name: Google Lighthouse | ||
on: pull_request | ||
jobs: | ||
audit: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,77 @@ | ||
// | ||
// Disable test suite in Firefox due to cross-origin restrictions | ||
// | ||
!Cypress.isBrowser("firefox") && | ||
describe("installability", () => { | ||
beforeEach(() => { | ||
cy.clearSessionStorage(); | ||
cy.visit("/"); | ||
cy.waitForAppReadiness(); | ||
}); | ||
|
||
it("should show toast when browser prompts for install", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast[data-presented]") | ||
.shadow() | ||
.findByText("Install this app for faster access next time"); | ||
}); | ||
describe("installability", () => { | ||
beforeEach(() => { | ||
cy.clearSessionStorage(); | ||
cy.visit("/"); | ||
cy.waitForAppReadiness(); | ||
}); | ||
|
||
it("should be able to dismiss toast", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast[data-presented]") | ||
.as("installToast") | ||
.shadow() | ||
.findByText("Maybe Later") | ||
.click(); | ||
it("should show toast when browser prompts for install", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast[data-presented]") | ||
.shadow() | ||
.findByText("Install this app for faster access next time"); | ||
}); | ||
|
||
cy.get("@installToast").should("not.exist"); | ||
}); | ||
it("should be able to dismiss toast", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast[data-presented]") | ||
.as("installToast") | ||
.shadow() | ||
.findByText("Maybe Later") | ||
.click(); | ||
|
||
it("should not prompt again once dismissed", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("@installToast").should("not.exist"); | ||
}); | ||
|
||
cy.get("ion-toast[data-presented]") | ||
.as("installToast") | ||
.shadow() | ||
.findByText("Maybe Later") | ||
.click(); | ||
it("should not prompt again once dismissed", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
|
||
cy.get("@installToast").should("not.exist"); | ||
cy.reload(); | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("@installToast").should("not.exist"); | ||
}); | ||
cy.get("ion-toast[data-presented]") | ||
.as("installToast") | ||
.shadow() | ||
.findByText("Maybe Later") | ||
.click(); | ||
|
||
it("should not prompt when app is installed while launched", () => { | ||
cy.window().triggerEvent("appinstalled").wait(100); | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast").wait(100).should("not.have.attr", "data-presented"); | ||
}); | ||
cy.get("@installToast").should("not.exist"); | ||
cy.visit("/"); // cy.reload() hangs in FF | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("@installToast").should("not.exist"); | ||
}); | ||
|
||
describe("when launched from a home screen", () => { | ||
beforeEach(() => { | ||
cy.visit("/", { | ||
onBeforeLoad(window) { | ||
// Intercept (stub) window.matchMedia before the page loads | ||
cy.stub(window, "matchMedia") | ||
.withArgs("(display-mode: standalone)") | ||
.callsFake(() => ({ | ||
matches: true, | ||
addListener: () => false, | ||
removeListener: () => false, | ||
})); | ||
it("should not prompt when app is installed while launched", () => { | ||
cy.window().triggerEvent("appinstalled").wait(100); | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast").wait(100).should("not.have.attr", "data-presented"); | ||
}); | ||
|
||
// If the media query doesn't match, | ||
// call through to the original window.matchMedia | ||
// so we don't break other aspects of the page | ||
window.matchMedia.callThrough(); | ||
}, | ||
}); | ||
}); | ||
describe("when launched from a home screen", () => { | ||
beforeEach(() => { | ||
cy.visit("/", { | ||
onBeforeLoad(window) { | ||
// Intercept (stub) window.matchMedia before the page loads | ||
cy.stub(window, "matchMedia") | ||
.withArgs("(display-mode: standalone)") | ||
.callsFake(() => ({ | ||
matches: true, | ||
addListener: () => false, | ||
removeListener: () => false, | ||
})); | ||
|
||
it("should not prompt", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast").wait(100).should("not.have.attr", "data-presented"); | ||
// If the media query doesn't match, | ||
// call through to the original window.matchMedia | ||
// so we don't break other aspects of the page | ||
window.matchMedia.callThrough(); | ||
}, | ||
}); | ||
}); | ||
|
||
it("should not prompt", () => { | ||
cy.window().triggerEvent("beforeinstallprompt"); | ||
cy.get("ion-toast").wait(100).should("not.have.attr", "data-presented"); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters