[MM-62094] E2E: Don't including loading screen or other windows in server map, remove check for loading screen finish (#3252)

This commit is contained in:
Devin Binnie
2025-02-04 00:45:22 -05:00
committed by GitHub
parent 900db3a85b
commit 1d912caa4e
17 changed files with 111 additions and 104 deletions

View File

@@ -23,8 +23,6 @@ describe('Trigger Notification From desktop', function desc() {
this.app = await env.getApp();
this.serverMap = await env.getServerMap(this.app);
const loadingScreen = this.app.windows().find((window) => window.url().includes('loadingScreen'));
await loadingScreen.waitForSelector('.LoadingScreen', {state: 'hidden'});
firstServer = this.serverMap[`${config.teams[0].name}___TAB_MESSAGING`].win;
await env.loginToMattermost(firstServer);
const textbox = await firstServer.waitForSelector('#post_textbox');
@@ -33,11 +31,32 @@ describe('Trigger Notification From desktop', function desc() {
// This support to getBadge is only available for MacOS
env.shouldTest(it, process.platform === 'darwin')('should receive a notification on macOS', async () => {
await triggerTestNotification(firstServer);
const badgeValue = await this.app.evaluate(async ({app}) => {
return app.dock.getBadge();
await asyncSleep(2000);
// Get the initial badge value
const beforeBadgeValue = await this.app.evaluate(async ({app}) => {
const badge = app.dock.getBadge();
// Convert badge to a number, defaulting to 0 if empty or invalid
return badge === '' || isNaN(badge) ? 0 : parseInt(badge, 10);
});
badgeValue.should.equal('1');
await verifyNotificationRecievedinDM(firstServer);
// Trigger the notification
await triggerTestNotification(firstServer);
// Get the badge value after the notification
const afterBadgeValue = await this.app.evaluate(async ({app}) => {
const badge = app.dock.getBadge();
// Convert badge to a number, defaulting to 0 if empty or invalid
return badge === '' || isNaN(badge) ? 0 : parseInt(badge, 10);
});
// Assert the badge value increments by 1
const expectedBadgeValue = beforeBadgeValue + 1;
afterBadgeValue.should.equal(expectedBadgeValue);
// Verify notification received in DM
await verifyNotificationRecievedinDM(firstServer, afterBadgeValue);
});
});