Skip to content

Commit 93c9617

Browse files
committed
test filters
1 parent fbb0e41 commit 93c9617

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

tests/e2e-frontend/tests/serviceBrowser/leftFilters.spec.js

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,18 @@ test.describe.serial(`Left Filters:`, () => {
1717

1818
test.beforeAll(async ({ browser }) => {
1919
page = await browser.newPage();
20+
21+
const responsePromise = page.waitForResponse('**/services/-/latest**', {
22+
timeout: 30000
23+
});
24+
2025
loginPageFixture = new LoginPage(page, productUrl);
2126
const role = await loginPageFixture.login(user.email, user.password);
2227
expect(role).toBe(user.role);
28+
29+
await responsePromise;
30+
31+
await page.getByTestId("servicesTabBtn").click();
2332
});
2433

2534
test.afterAll(async ({ browser }) => {
@@ -29,14 +38,27 @@ test.describe.serial(`Left Filters:`, () => {
2938
});
3039

3140
test(`Filters`, async () => {
32-
const contextTree = page.getByTestId("contextTree");
33-
await expect(contextTree).toBeVisible({
41+
const sharedWithFilters = page.getByTestId("service-sharedWithFilterItem");
42+
await expect(sharedWithFilters).toBeVisible({
43+
timeout: 30000 // it will take some time to load the Study Browser
44+
});
45+
46+
const countSharedWith = await sharedWithFilters.count();
47+
// All Services
48+
// My Services
49+
// Shared with Me
50+
// Shared with Everyone
51+
expect(countSharedWith === 4).toBeTruthy();
52+
53+
54+
const serviceTypeFilters = page.getByTestId("service-serviceTypeFilterItem");
55+
await expect(serviceTypeFilters).toBeVisible({
3456
timeout: 30000 // it will take some time to load the Study Browser
3557
});
3658

37-
const workspacesAndFoldersTreeItems = page.getByTestId("workspacesAndFoldersTreeItem");
38-
const count = await workspacesAndFoldersTreeItems.count();
39-
// at least two: My Workspace and Shared Workspaces
40-
expect(count > 1).toBeTruthy();
59+
const countServiceType = await serviceTypeFilters.count();
60+
// Computational
61+
// Interactive
62+
expect(countServiceType === 2).toBeTruthy();
4163
});
4264
});

tests/e2e-frontend/tests/serviceBrowser/mainView.spec.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ for (const product in products) {
4949
test.beforeAll(async ({ browser }) => {
5050
page = await browser.newPage();
5151

52-
const responsePromise = page.waitForResponse('**/services/-/latest**');
52+
const responsePromise = page.waitForResponse('**/services/-/latest**', {
53+
timeout: 30000
54+
});
5355

5456
loginPageFixture = new LoginPage(page, productUrl);
5557
const role = await loginPageFixture.login(user.email, user.password);

0 commit comments

Comments
 (0)