Skip to content

Commit a88cc7a

Browse files
committed
Robustness improvements for playwright
Removed some calls to `isVisible()` function which returns a boolean which was being ignored by the code. Add extra wait so the internal dashboard is loaded before proceeding. Run tests in serial mode to mitigate race conditions in the XDMoD database.
1 parent af327c6 commit a88cc7a

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

tests/playwright/lib/internal_dashboard.page.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ class InternalDashboard extends BasePage implements LoginInterface {
1414

1515
async login(username: string, password: string, display: string) {
1616
await this.verifyLocation('/internal_dashboard', 'XDMoD Internal Dashboard');
17-
await this.usernameLocator.isVisible();
18-
await this.passwordLocator.isVisible();
19-
await this.submitLocator.isVisible();
2017

2118
await this.usernameLocator.fill(username);
2219
await this.passwordLocator.fill(password);
2320
await this.submitLocator.click();
24-
await this.submitLocator.isHidden();
21+
await expect(this.submitLocator).toBeHidden();
2522

26-
await this.logoutLinkLocator.isVisible();
2723
await expect(this.loggedInDisplayLocator).toContainText(display);
24+
25+
const userManagementTab = this.page.locator(selectors.header.tabs.user_management());
26+
await expect(userManagementTab).toBeVisible({ timeout: 10_000 });
2827
}
2928

3029
async logout() {

tests/playwright/playwright.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {PlaywrightTestConfig, devices} from '@playwright/test';
2-
// Comment to trigger CI man do I hate trello boards...
2+
33
const config: PlaywrightTestConfig = {
44
forbidOnly: !!process.env.CI,
55
retries: process.env.CI ? 2 : 0,
66
timeout: 60000,
7-
workers: 5,
7+
workers: 1,
88
use: {
99
trace: 'on-first-retry',
1010
video: 'on-first-retry',

0 commit comments

Comments
 (0)