Skip to content

Commit

Permalink
Put InstallActor in every test
Browse files Browse the repository at this point in the history
  • Loading branch information
rakoenig committed Oct 17, 2023
1 parent 946dbde commit 3c51bef
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 100 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
28 changes: 7 additions & 21 deletions tests/add-home-file-system.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { UserActor } from "../actors/user-actor";
import { MainPage } from '../pages/main-page';
import { ProductSelectionOpensusePage } from '../pages/product-selection-opensuse-page';
import { StoragePage } from '../pages/storage-page';
import { InstallActor } from '../actors/install-actor';

const minute = 60 * 1000;
test.describe('The main page', () => {
Expand All @@ -20,39 +21,24 @@ test.describe('The main page', () => {
const mainPage = new MainPage(page);
await test.step("Start to add home file system", async () => {
await mainPage.accessStorage();

const storagePage = new StoragePage(page);
await storagePage.accessAddFileSystem();
const addFileSystemPage = new AddFileSystemPage(page);
await addFileSystemPage.accept();
await storagePage.back();

});

await test.step("set mandatory user and root password", async () => {
await mainPage.accessUsers();
await (new UserActor(page)).handleUser();
});

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 page.getByRole("button", { name: "Install", exact: true }).click();
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);
}
}
});
const installActor = new InstallActor(page, mainPage);
await installActor.handleInstallation();
})
});
});
24 changes: 5 additions & 19 deletions tests/default_installation.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { IndexActor } from "../actors/index-actor";
import { UserActor } from "../actors/user-actor";
import { MainPage } from '../pages/main-page';
import { ProductSelectionOpensusePage } from '../pages/product-selection-opensuse-page';
import { InstallActor } from '../actors/install-actor';

const minute = 60 * 1000;
test.describe('The main page', () => {
Expand All @@ -14,7 +15,7 @@ test.describe('The main page', () => {
indexActor.handleProductSelectionIfAny();
});

test('Default installation test', async ({ page }) => {
test('Default installation test', async ({ page }) => {
const mainPage = new MainPage(page);
await test.step("set mandatory user and root password", async () => {
await mainPage.accessUsers();
Expand All @@ -24,23 +25,8 @@ test.describe('The main page', () => {
//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);
}
}
});
const installActor = new InstallActor(page, mainPage);
await installActor.handleInstallation();
})
});
});
24 changes: 5 additions & 19 deletions tests/encrypted_lvm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { StoragePage } from '../pages/storage-page';
import { MainPage } from '../pages/main-page';
import { ProductSelectionOpensusePage } from '../pages/product-selection-opensuse-page';
import { EncryptionPasswordPopup } from '../pages/encryption-password-popup';
import { InstallActor } from '../actors/install-actor';

const minute = 60 * 1000;
test.describe('The main page', () => {
Expand All @@ -16,7 +17,7 @@ test.describe('The main page', () => {
indexActor.handleProductSelectionIfAny();
});

test('Installation test with encrypted lvm file system', async ({ page }) => {
test('Installation test with encrypted lvm file system', async ({ page }) => {
const mainPage = new MainPage(page);
await test.step("set encrypted lvm file system", async () => {
await mainPage.accessStorage();
Expand All @@ -43,23 +44,8 @@ test.describe('The main page', () => {
//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);
}
}
});
const installActor = new InstallActor(page, mainPage);
await installActor.handleInstallation();
})
});
});
2 changes: 1 addition & 1 deletion tests/full-disk-encryption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ test.describe('The main page', () => {
indexActor.handleProductSelectionIfAny();
});

test('Full-disk encryption', async ({ page }) => {
test('Full-disk encryption', async ({ page }) => {
const mainPage = new MainPage(page);
await test.step("Set for Full-disk encryption", async () => {
await mainPage.accessStorage();
Expand Down
28 changes: 7 additions & 21 deletions tests/lvm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { UserActor } from "../actors/user-actor";
import { ProductSelectionOpensusePage } from '../pages/product-selection-opensuse-page';
import { MainPage } from '../pages/main-page';
import { StoragePage } from '../pages/storage-page';
import { InstallActor } from '../actors/install-actor';

const minute = 60 * 1000;
test.describe('The main page', () => {
Expand All @@ -15,7 +16,7 @@ test.describe('The main page', () => {
indexActor.handleProductSelectionIfAny();
});

test("Use logical volume management (LVM) as storage device for installation", async ({ page }) => {
test("Use logical volume management (LVM) as storage device for installation", async ({ page }) => {
const mainPage = new MainPage(page);
await test.step("Set LVM and Users", async () => {
await mainPage.accessStorage();
Expand All @@ -31,25 +32,10 @@ test.describe('The main page', () => {
await (new UserActor(page)).handleUser();
});

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);
}
}
});
await test.step("Run installation", async () => {
test.setTimeout(30 * minute);
const installActor = new InstallActor(page, mainPage);
await installActor.handleInstallation();
})
});
});
24 changes: 5 additions & 19 deletions tests/select-install-device.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { StoragePage } from '../pages/storage-page';
import { MainPage } from '../pages/main-page';
import { ProductSelectionOpensusePage } from '../pages/product-selection-opensuse-page';
import { InstallationDevicePage } from '../pages/install-device-page';
import { InstallActor } from '../actors/install-actor';

const minute = 60 * 1000;
test.describe('The main page', () => {
Expand All @@ -16,7 +17,7 @@ test.describe('The main page', () => {
indexActor.handleProductSelectionIfAny();
});

test('Installation on second available storage device', async ({ page }) => {
test('Installation on second available storage device', async ({ page }) => {
const mainPage = new MainPage(page);
await test.step("select second available device for installation", async () => {
const storagePage = new StoragePage(page);
Expand All @@ -39,23 +40,8 @@ test.describe('The main page', () => {
//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);
}
}
});
const installActor = new InstallActor(page, mainPage);
await installActor.handleInstallation();
})
});
});

0 comments on commit 3c51bef

Please sign in to comment.