Fix: cypress `toasts/analytics-toast.spec.ts` failures (#11153)

* Revert "skip broken analytics tests (#11144)"

This reverts commit 83ee1946ea.

* reset window notification permission between tets
pull/28217/head
Kerry 2023-06-29 09:02:58 +12:00 committed by GitHub
parent ac9dd8307f
commit 3de2bcdc1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View File

@ -25,7 +25,7 @@ describe("Security user settings tab", () => {
cy.stopHomeserver(homeserver);
});
describe.skip("with posthog enabled", () => {
describe("with posthog enabled", () => {
beforeEach(() => {
// Enable posthog
cy.intercept("/config.json?cachebuster=*", (req) => {

View File

@ -39,7 +39,7 @@ function rejectToast(expectedTitle: string): void {
});
}
describe.skip("Analytics Toast", () => {
describe("Analytics Toast", () => {
let homeserver: HomeserverInstance;
afterEach(() => {

View File

@ -137,7 +137,14 @@ Cypress.Commands.add(
prelaunchFn?.();
return cy
.visit("/")
.visit("/", {
onBeforeLoad(win) {
// reset notification permissions so we have predictable behaviour
// of notifications toast
// @ts-ignore allow setting default
cy.stub(win.Notification, "permission", "default");
},
})
.then(() => {
// wait for the app to load
return cy.get(".mx_MatrixChat", { timeout: 30000 });