Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default installation test using POMs #17

Merged
merged 1 commit into from
Aug 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
63 changes: 63 additions & 0 deletions tests/default_installation.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { test, expect } from '@playwright/test';
Copy link
Owner

@jknphy jknphy Aug 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be default-installation.spec.ts
Connected with the different formats - or _ what do you think about https://progress.opensuse.org/issues/134228#note-11? we should have those folders ci/ and e2e/ to distinguish properly, could you file ticket in case you don't plan it here? it will help IMO.

import { IndexActor } from "../actors/index-actor";
import { MainPage } from '../pages/main-page';
import { ProductSelectionOpensusePage } from '../pages/product-selection-opensuse-page';
import { UsersPage } from '../pages/users-page';
import { DefineUserPage } from '../pages/define-user-page';
import { ConfigureRootPasswordPage } from '../pages/configure-root-password-page';

const minute = 60 * 1000;
test.describe('The main page', () => {
test.beforeEach(async ({ page }) => {
const productSelectionOpensusePage = new ProductSelectionOpensusePage(page);
const mainPage = new MainPage(page);
const indexActor = new IndexActor(page, mainPage, productSelectionOpensusePage);
indexActor.goto();
indexActor.handleProductSelectionIfAny();
});

test('Default installation test', async ({ page }) => {
const mainPage = new MainPage(page);
await test.step("set mandatory user and root password", async () => {

await mainPage.accessUsers();

const usersPage = new UsersPage(page);
await usersPage.expectNoUserDefined();
await usersPage.defineUser();
const defineUserPage = new DefineUserPage(page);
await defineUserPage.fillUserFullName('Bernhard M. Wiedemann');
await defineUserPage.fillUserName('bernhard');
await defineUserPage.fillAndConfirmPassword('nots3cr3t');
await defineUserPage.confirm();
await usersPage.expectRootPasswordNotSet();
await usersPage.configureRootPassword();
const configureRootPasswordPage = new ConfigureRootPasswordPage(page);
await configureRootPasswordPage.fillAndConfirmPassword('nots3cr3t');
await configureRootPasswordPage.confirm();
await usersPage.back();
});

//Installation
await test.step("Run installation", async () => {
test.setTimeout(30 * minute);
// start the installation
await expect(page.getByText("Installation will take")).toBeVisible({ timeout: 2 * minute });
await mainPage.install();
await expect(page.getByText("Confirm Installation")).toBeVisible({ timeout: 2 * minute });
await page.getByRole("button", { name: "Continue" }).click();
// wait for the package installation progress
await expect(page.getByText("Installing packages")).toBeVisible({ timeout: 8 * minute });
while (true) {
try {
await page.getByRole("heading", { name: "Congratulations!" }).waitFor({ timeout: minute / 2 });
break;
}
catch (error) {
// do not ignore other errors
if (error.constructor.name !== "TimeoutError") throw (error);
}
}
});
});
});