Skip to content

Commit f9928ba

Browse files
committed
[MS] Fixed flaky tests related to fab button
1 parent c672a5a commit f9928ba

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

client/tests/e2e/specs/small_display_fab_menu.spec.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,66 @@ msTest('Fab button and menu as administrator and read/write', async ({ workspace
66
await workspaces.setDisplaySize(DisplaySize.Small);
77
const fabButton = workspaces.locator('#add-menu-fab-button');
88
const tabBarButtons = workspaces.locator('#tab-bar').locator('.tab-bar-menu-button');
9-
const fabModalOptions = workspaces.locator('#fab-modal').locator('.list-group-item');
9+
const fabModal = workspaces.locator('.tab-menu-modal');
10+
const fabModalOptions = fabModal.locator('.list-group-item');
1011

1112
// WorkspacesPage
1213
await expect(fabButton).toBeVisible();
14+
await expect(fabModal).toBeHidden();
1315
await fabButton.click();
16+
await expect(fabModal).toBeVisible();
1417
await expect(fabModalOptions).toHaveCount(2);
1518
await expect(fabModalOptions).toHaveText(['New workspace', 'Invite a user']);
1619
await fabButton.click();
20+
await expect(fabModal).toBeHidden();
1721

1822
// Read/write workspace + admin
1923
await workspaces.locator('.workspaces-container-grid').locator('.workspace-card-item').nth(0).click();
2024
await expect(fabButton).toBeVisible();
2125
await fabButton.click();
26+
await expect(fabModal).toBeVisible();
2227
await expect(fabModalOptions).toHaveCount(4);
2328
await expect(fabModalOptions).toHaveText(['New folder', 'Import a folder', 'Import files', 'Invite a user']);
2429
await fabButton.click();
30+
await expect(fabModal).toBeHidden();
2531

2632
// Organization management
2733
await tabBarButtons.nth(2).click();
2834
await expect(workspaces).toBeOrganizationPage();
2935
await fabButton.click();
36+
await expect(fabModal).toBeVisible();
3037
await expect(fabModalOptions).toHaveCount(2);
3138
await expect(fabModalOptions).toHaveText(['Invite a user', 'Copy link (PKI)']);
3239
await fabButton.click();
40+
await expect(fabModal).toBeHidden();
3341

3442
// No button in profile page
3543
await tabBarButtons.nth(3).click();
3644
await expect(workspaces).toBeMyProfilePage();
3745
await fabButton.click();
46+
await expect(fabModal).toBeVisible();
3847
await expect(fabModalOptions).toHaveCount(2);
3948
await expect(fabModalOptions).toHaveText(['Invite a user', 'Copy link (PKI)']);
4049
await fabButton.click();
50+
await expect(fabModal).toBeHidden();
4151
});
4252

4353
msTest('Fab button and menu as standard and reader', async ({ workspacesStandard }) => {
4454
await workspacesStandard.setDisplaySize(DisplaySize.Small);
4555
const fabButton = workspacesStandard.locator('#add-menu-fab-button');
4656
const tabBarButtons = workspacesStandard.locator('#tab-bar').locator('.tab-bar-menu-button');
47-
const fabModalOptions = workspacesStandard.locator('#fab-modal').getByRole('listitem');
57+
const fabModal = workspacesStandard.locator('.tab-menu-modal');
58+
const fabModalOptions = fabModal.getByRole('listitem');
4859

4960
// WorkspacesPage
61+
await expect(fabModal).toBeHidden();
5062
await expect(fabButton).toBeVisible();
5163
await fabButton.click();
64+
await expect(fabModal).toBeVisible();
5265
await expect(fabModalOptions).toHaveCount(1);
5366
await expect(fabModalOptions).toHaveText(['New workspace']);
5467
await fabButton.click();
68+
await expect(fabModal).toBeHidden();
5569

5670
// No button in reader workspace
5771
await workspacesStandard.locator('.workspaces-container-grid').locator('.workspace-card-item').nth(0).click();

client/tests/e2e/specs/users_list.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,11 @@ msTest('User filter popover default state', async ({ usersPage }) => {
321321
async function toggleFilter(page: Page, name: string): Promise<void> {
322322
await page.locator('#activate-users-ms-action-bar').locator('#select-filter-popover-button').click();
323323
const popover = page.locator('.filter-popover');
324+
await expect(popover).toBeVisible();
324325
await popover.getByRole('listitem').filter({ hasText: name }).locator('ion-checkbox').click();
325326
// Click the backdrop to hide the popover
326-
await page.locator('.filter-popover').locator('ion-backdrop').click();
327+
await popover.locator('ion-backdrop').click();
328+
await expect(popover).toBeHidden();
327329
}
328330

329331
msTest('Filter users list', async ({ usersPage }) => {

0 commit comments

Comments
 (0)