-
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
12 changed files
with
128 additions
and
150 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,2 @@ | ||
{ | ||
} |
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,30 @@ | ||
import { expect, type Page } from '@playwright/test'; | ||
import { MainPage } from '../pages/main-page'; | ||
import { ConfirmInstallationPage } from '../pages/confirm-installation-page'; | ||
import { InstallingPage } from '../pages/installing-page'; | ||
import { InstallationFinishedPage } from '../pages/installation-finished-page'; | ||
|
||
export class InstallActor { | ||
readonly page: Page; | ||
readonly mainPage: MainPage; | ||
readonly confirmInstallationPage: ConfirmInstallationPage; | ||
readonly installationProgressPage: InstallingPage; | ||
readonly installationFinishedPage: InstallationFinishedPage; | ||
|
||
constructor(page: Page, | ||
mainPage: MainPage) { | ||
this.page = page; | ||
this.mainPage = mainPage; | ||
} | ||
|
||
async handleInstallation() { | ||
await expect(this.page.getByText("Installation will take")).toBeVisible({ timeout: 2 * 60 * 1000 }); | ||
await this.mainPage.install(); | ||
const confirmInstallationPage = new ConfirmInstallationPage(this.page); | ||
const installationProgressPage = new InstallingPage(this.page); | ||
const installationFinishedPage = new InstallationFinishedPage(this.page); | ||
await confirmInstallationPage.confirm(); | ||
await installationProgressPage.expectProgress(); | ||
await installationFinishedPage.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 InstallationFinishedPage { | ||
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 InstallingPage { | ||
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
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
Oops, something went wrong.