-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create POMs for installation process
- Related ticket: https://progress.opensuse.org/issues/132890
- Loading branch information
Showing
6 changed files
with
105 additions
and
50 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { expect, type Page } from '@playwright/test'; | ||
import { MainPage } from '../pages/main-page'; | ||
import { ConfirmInstallationPage } from '../pages/confirm-installation-page'; | ||
import { InstallationProgressPage } from '../pages/installing-page'; | ||
import { CongratulationsPage } from '../pages/installation-finished-page'; | ||
|
||
export class InstallActor { | ||
readonly page: Page; | ||
readonly mainPage: MainPage; | ||
readonly confirmInstallationPage: ConfirmInstallationPage; | ||
readonly installationProgressPage: InstallationProgressPage; | ||
readonly congratulationsPage: CongratulationsPage; | ||
|
||
constructor(page: Page, | ||
mainPage: MainPage, | ||
confirmInstallationPage: ConfirmInstallationPage, | ||
installationProgressPage: InstallationProgressPage, | ||
congratulationsPage: CongratulationsPage) { | ||
this.page = page; | ||
this.mainPage = mainPage; | ||
this.confirmInstallationPage = confirmInstallationPage; | ||
this.installationProgressPage = installationProgressPage; | ||
this.congratulationsPage = congratulationsPage; | ||
} | ||
|
||
async handleInstallation() { | ||
await this.mainPage.install(); | ||
await this.confirmInstallationPage.confirm(); | ||
await this.installationProgressPage.expectProgress(); | ||
await this.congratulationsPage.expectCongratulations(); | ||
} | ||
} |
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,22 @@ | ||
import { expect, type Locator, type Page } from '@playwright/test'; | ||
|
||
export class ConfirmInstallationPage { | ||
readonly page: Page; | ||
readonly confirmButton: Locator; | ||
readonly cancelButton: Locator; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.confirmButton = page.getByRole('button', { name: 'Continue' }); | ||
this.cancelButton = page.getByRole('button', { name: 'Cancel' }); | ||
} | ||
|
||
async confirm() { | ||
await this.confirmButton.click(); | ||
} | ||
|
||
async cancel() { | ||
await this.cancelButton.click(); | ||
} | ||
|
||
} |
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,25 @@ | ||
import { expect, type Locator, type Page } from '@playwright/test'; | ||
|
||
export class CongratulationsPage { | ||
readonly page: Page; | ||
readonly heading: Locator; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.heading = page.getByRole("heading", { name: 'Congratulations!' }); | ||
} | ||
|
||
async expectCongratulations() { | ||
while (true) { | ||
try { | ||
await this.heading.waitFor({ timeout: 30 * 1000 }); | ||
break; | ||
} | ||
catch (error) { | ||
// do not ignore other errors | ||
if (error.constructor.name !== 'TimeoutError') throw (error); | ||
} | ||
} | ||
} | ||
|
||
} |
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,16 @@ | ||
import { expect, type Locator, type Page } from '@playwright/test'; | ||
|
||
export class InstallationProgressPage { | ||
readonly page: Page; | ||
readonly progressText: Locator; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
this.progressText = page.getByText('Installing packages'); | ||
} | ||
|
||
async expectProgress() { | ||
await expect(this.progressText).toBeVisible({ timeout: 8 * 60 * 1000 }); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
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