Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3de2bcd

Browse files
author
Kerry
authored
Fix: cypress toasts/analytics-toast.spec.ts failures (#11153)
* Revert "skip broken analytics tests (#11144)" This reverts commit 83ee194. * reset window notification permission between tets
1 parent ac9dd83 commit 3de2bcd

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

cypress/e2e/settings/security-user-settings-tab.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("Security user settings tab", () => {
2525
cy.stopHomeserver(homeserver);
2626
});
2727

28-
describe.skip("with posthog enabled", () => {
28+
describe("with posthog enabled", () => {
2929
beforeEach(() => {
3030
// Enable posthog
3131
cy.intercept("/config.json?cachebuster=*", (req) => {

cypress/e2e/toasts/analytics-toast.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function rejectToast(expectedTitle: string): void {
3939
});
4040
}
4141

42-
describe.skip("Analytics Toast", () => {
42+
describe("Analytics Toast", () => {
4343
let homeserver: HomeserverInstance;
4444

4545
afterEach(() => {

cypress/support/login.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,14 @@ Cypress.Commands.add(
137137
prelaunchFn?.();
138138

139139
return cy
140-
.visit("/")
140+
.visit("/", {
141+
onBeforeLoad(win) {
142+
// reset notification permissions so we have predictable behaviour
143+
// of notifications toast
144+
// @ts-ignore allow setting default
145+
cy.stub(win.Notification, "permission", "default");
146+
},
147+
})
141148
.then(() => {
142149
// wait for the app to load
143150
return cy.get(".mx_MatrixChat", { timeout: 30000 });

0 commit comments

Comments
 (0)