-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Notification preferences not updated on save (#26461)
- Loading branch information
1 parent
b272149
commit 854070a
Showing
6 changed files
with
78 additions
and
1 deletion.
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
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
41 changes: 41 additions & 0 deletions
41
apps/meteor/tests/e2e/page-objects/fragments/home-flextab-notificationPreferences.ts
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import type { Locator, Page } from '@playwright/test'; | ||
|
||
export class HomeFlextabNotificationPreferences { | ||
private readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
get btnSave(): Locator { | ||
return this.page.locator('//aside//button[contains(text(), "Save")]'); | ||
} | ||
|
||
getPreferenceByDevice(device: string): Locator { | ||
return this.page.locator(`//div[@id="${device}Alert"]`); | ||
} | ||
|
||
async selectDropdownById(text: string): Promise<void> { | ||
await this.page.locator(`//div[@id="${text}"]`).click(); | ||
} | ||
|
||
async selectOptionByLabel(text: string): Promise<void> { | ||
await this.page.locator(`li.rcx-option >> text="${text}"`).click(); | ||
} | ||
|
||
async selectDevice(text: string): Promise<void> { | ||
await this.page.locator(`[data-qa-id="${text}-notifications"]`).click(); | ||
} | ||
|
||
async updateDevicePreference(device: string): Promise<void> { | ||
await this.selectDevice(device); | ||
await this.selectDropdownById(`${device}Alert`); | ||
await this.selectOptionByLabel('Mentions'); | ||
} | ||
|
||
async updateAllNotificaitonPreferences(): Promise<void> { | ||
await this.updateDevicePreference('Desktop'); | ||
await this.updateDevicePreference('Mobile'); | ||
await this.updateDevicePreference('Email'); | ||
} | ||
} |
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