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
This commit is contained in:
parent
ac9dd8307f
commit
3de2bcdc1a
3 changed files with 10 additions and 3 deletions
|
@ -25,7 +25,7 @@ describe("Security user settings tab", () => {
|
||||||
cy.stopHomeserver(homeserver);
|
cy.stopHomeserver(homeserver);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe.skip("with posthog enabled", () => {
|
describe("with posthog enabled", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
// Enable posthog
|
// Enable posthog
|
||||||
cy.intercept("/config.json?cachebuster=*", (req) => {
|
cy.intercept("/config.json?cachebuster=*", (req) => {
|
||||||
|
|
|
@ -39,7 +39,7 @@ function rejectToast(expectedTitle: string): void {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
describe.skip("Analytics Toast", () => {
|
describe("Analytics Toast", () => {
|
||||||
let homeserver: HomeserverInstance;
|
let homeserver: HomeserverInstance;
|
||||||
|
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
|
|
|
@ -137,7 +137,14 @@ Cypress.Commands.add(
|
||||||
prelaunchFn?.();
|
prelaunchFn?.();
|
||||||
|
|
||||||
return cy
|
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(() => {
|
.then(() => {
|
||||||
// wait for the app to load
|
// wait for the app to load
|
||||||
return cy.get(".mx_MatrixChat", { timeout: 30000 });
|
return cy.get(".mx_MatrixChat", { timeout: 30000 });
|
||||||
|
|
Loading…
Reference in a new issue