-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add-task-for-idle-removal
- Loading branch information
Showing
13 changed files
with
180 additions
and
31 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
const { test, expect } = require('@playwright/test'); | ||
|
||
import { LoginPage } from '../fixtures/loginPage'; | ||
|
||
import products from '../products.json'; | ||
import users from '../users.json'; | ||
|
||
const product = "osparc"; | ||
const productUrl = products[product]; | ||
const user = users[product][0]; | ||
|
||
test.describe.serial(`Left Filters:`, () => { | ||
let page = null; | ||
let loginPageFixture = null; | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
page = await browser.newPage(); | ||
loginPageFixture = new LoginPage(page, productUrl); | ||
const role = await loginPageFixture.login(user.email, user.password); | ||
expect(role).toBe(user.role); | ||
}); | ||
|
||
test.afterAll(async ({ browser }) => { | ||
await loginPageFixture.logout(); | ||
await page.close(); | ||
await browser.close(); | ||
}); | ||
|
||
test(`Context`, async () => { | ||
const contextTree = page.getByTestId("contextTree"); | ||
await expect(contextTree).toBeVisible({ | ||
timeout: 30000 // it will take some time to load the Study Browser | ||
}); | ||
|
||
const workspacesAndFoldersTreeItems = page.getByTestId("workspacesAndFoldersTreeItem"); | ||
const count = await workspacesAndFoldersTreeItems.count(); | ||
// at least two: My Workspace and Shared Workspaces | ||
expect(count > 1).toBeTruthy(); | ||
}); | ||
|
||
test(`Tags`, async () => { | ||
const tagsFilter = page.getByTestId("tagsFilter"); | ||
await expect(tagsFilter).toBeVisible({ | ||
timeout: 30000 // it will take some time to load the Study Browser | ||
}); | ||
|
||
const tagFilterItems = page.getByTestId("tagFilterItem"); | ||
const count = await tagFilterItems.count(); | ||
// at least two and less than 6 (max five are shown) | ||
expect(count > 1 && count < 6).toBeTruthy(); | ||
}); | ||
}); |
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,81 @@ | ||
/* eslint-disable no-undef */ | ||
|
||
const { test, expect } = require('@playwright/test'); | ||
|
||
import { LoginPage } from '../fixtures/loginPage'; | ||
|
||
import products from '../products.json'; | ||
import users from '../users.json'; | ||
|
||
const expectedElements = { | ||
"osparc": { | ||
"plusButton": { | ||
"id": "newStudyBtn", | ||
}, | ||
}, | ||
"s4l": { | ||
"plusButton": { | ||
"id": "startS4LButton", | ||
}, | ||
}, | ||
"s4lacad": { | ||
"plusButton": { | ||
"id": "startS4LButton", | ||
}, | ||
}, | ||
"s4llite": { | ||
"plusButton": { | ||
"id": "startS4LButton", | ||
}, | ||
}, | ||
"tis": { | ||
"plusButton": { | ||
"id": "newStudyBtn", | ||
}, | ||
}, | ||
"tiplite": { | ||
"plusButton": { | ||
"id": "newStudyBtn", | ||
}, | ||
}, | ||
}; | ||
|
||
for (const product in products) { | ||
if (product in users) { | ||
const productUrl = products[product]; | ||
const productUsers = users[product]; | ||
for (const user of productUsers) { | ||
// expected roles for users: "USER" | ||
const role = "USER"; | ||
expect(user.role).toBe(role); | ||
|
||
test.describe.serial(`Main View: ${product}`, () => { | ||
let page = null; | ||
let loginPageFixture = null; | ||
|
||
test.beforeAll(async ({ browser }) => { | ||
page = await browser.newPage(); | ||
loginPageFixture = new LoginPage(page, productUrl); | ||
const role = await loginPageFixture.login(user.email, user.password); | ||
expect(role).toBe(user.role); | ||
}); | ||
|
||
test.afterAll(async ({ browser }) => { | ||
await loginPageFixture.logout(); | ||
await page.close(); | ||
await browser.close(); | ||
}); | ||
|
||
test(`Plus button`, async () => { | ||
expect(expectedElements[product]["plusButton"]).toBeDefined(); | ||
|
||
const plusButtonId = expectedElements[product]["plusButton"]["id"]; | ||
const plusButton = page.getByTestId(plusButtonId); | ||
await expect(plusButton).toBeVisible({ | ||
timeout: 30000 // it will take some time to load the Study Browser | ||
}); | ||
}); | ||
}); | ||
} | ||
} | ||
} |
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