Skip to content

Commit

Permalink
chore(tests): fix onboard tests running on linux (podman-desktop#6328)
Browse files Browse the repository at this point in the history
fixes issue with running onboarding tests on linux platform
Signed-off-by: Vladimir Lazar <[email protected]>
  • Loading branch information
cbr7 authored Mar 8, 2024
1 parent 634c321 commit cce30a7
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
39 changes: 21 additions & 18 deletions tests/src/podman-machine-dashboard-onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { PodmanDesktopRunner } from './runner/podman-desktop-runner';
import { WelcomePage } from './model/pages/welcome-page';
import { deletePodmanMachine } from './utility/operations';
import { NavigationBar } from './model/workbench/navigation';
import * as os from 'node:os';

let pdRunner: PodmanDesktopRunner;
let page: Page;
Expand Down Expand Up @@ -52,22 +53,24 @@ afterAll(async () => {
await pdRunner.close();
});

describe.runIf(process.env.TEST_PODMAN_MACHINE !== undefined && process.env.TEST_PODMAN_MACHINE === 'true')(
`Podman machine onboarding from Dashboard`,
async () => {
test('Create Podman machine from Dashboard', async () => {
const navigationBar = new NavigationBar(page);
const dashboardPage = await navigationBar.openDashboard();
await playExpect(dashboardPage.initilizeAndStartButton).toBeEnabled();
await dashboardPage.initilizeAndStartButton.click();
await playExpect(dashboardPage.podmanMachineConnectionStatus).toHaveText('RUNNING', { timeout: 300000 });
}, 320000);
describe.skipIf(os.platform() === 'linux')(async () => {
describe.runIf(process.env.TEST_PODMAN_MACHINE !== undefined && process.env.TEST_PODMAN_MACHINE === 'true')(
`Podman machine onboarding from Dashboard`,
async () => {
test('Create Podman machine from Dashboard', async () => {
const navigationBar = new NavigationBar(page);
const dashboardPage = await navigationBar.openDashboard();
await playExpect(dashboardPage.initilizeAndStartButton).toBeEnabled();
await dashboardPage.initilizeAndStartButton.click();
await playExpect(dashboardPage.podmanMachineConnectionStatus).toHaveText('RUNNING', { timeout: 300000 });
}, 320000);

test.runIf(process.env.MACHINE_CLEANUP !== undefined && process.env.MACHINE_CLEANUP === 'true')(
'Clean Up Podman Machine',
async () => {
await deletePodmanMachine(page, PODMAN_MACHINE_NAME);
},
);
},
);
test.runIf(process.env.MACHINE_CLEANUP !== undefined && process.env.MACHINE_CLEANUP === 'true')(
'Clean Up Podman Machine',
async () => {
await deletePodmanMachine(page, PODMAN_MACHINE_NAME);
},
);
},
);
});
3 changes: 2 additions & 1 deletion tests/src/podman-machine-onboarding.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { deletePodmanMachine } from './utility/operations';
import { PodmanOnboardingPage } from './model/pages/podman-onboarding-page';
import { ResourcesPodmanConnections } from './model/pages/resources-podman-connections-page';
import { PodmanMachineDetails } from './model/pages/podman-machine-details-page';
import * as os from 'node:os';

const PODMAN_MACHINE_STARTUP_TIMEOUT: number = 360_000;
const PODMAN_MACHINE_NAME: string = 'Podman Machine';
Expand Down Expand Up @@ -71,7 +72,7 @@ beforeEach<RunnerTestContext>(async ctx => {
ctx.pdRunner = pdRunner;
});

describe('Podman Machine verification', async () => {
describe.skipIf(os.platform() === 'linux')('Podman Machine verification', async () => {
describe('Podman Machine onboarding workflow', async () => {
test('Setup Podman push notification is present', async () => {
dashboardPage = await navigationBar.openDashboard();
Expand Down

0 comments on commit cce30a7

Please sign in to comment.