Skip to content

Commit

Permalink
chore(test): pass custom settings object into podman-desktop-runner
Browse files Browse the repository at this point in the history
Signed-off-by: Tibor Dancs <[email protected]>
  • Loading branch information
ScrewTSW committed Sep 6, 2024
1 parent dcae36e commit 1fcb4ad
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions tests/playwright/src/ai-lab-extension.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@

import type { Page } from '@playwright/test';
import type { DashboardPage, ExtensionsPage, Runner } from '@podman-desktop/tests-playwright';
import { NavigationBar, expect as playExpect, test, RunnerOptions, waitForPodmanMachineStartup } from '@podman-desktop/tests-playwright';
import {
NavigationBar,
expect as playExpect,
test,
RunnerOptions,
waitForPodmanMachineStartup,
} from '@podman-desktop/tests-playwright';
import { AILabPage } from './model/ai-lab-page';
import type { AILabRecipesCatalogPage } from './model/ai-lab-recipes-catalog-page';
import type { AILabAppDetailsPage } from './model/ai-lab-app-details-page';
Expand All @@ -30,7 +36,11 @@ const AI_LAB_CATALOG_EXTENSION_LABEL: string = 'redhat.ai-lab';
const AI_LAB_NAVBAR_EXTENSION_LABEL: string = 'AI Lab';
const AI_LAB_PAGE_BODY_LABEL: string = 'Webview AI Lab';
const AI_LAB_AI_APP_NAME: string = 'ChatBot';
const isLinux = os.platform() === 'linux';
const isWindows = os.platform() === 'win32';
const isCI = process.env.AI_LAB_CI_RUN;
const customSettingsPodmanPath = isWindows
? `${process.env.USERPROFILE}\\tools\\podman\\podman-5.2.0\\usr\\bin\\podman.exe`
: '/usr/bin/podman'; //todo: need to get podman path for linux and mac

let webview: Page;
let aiLabPage: AILabPage;
Expand All @@ -41,7 +51,21 @@ let dashboardPage: DashboardPage;
let extensionsPage: ExtensionsPage;

test.use({
runnerOptions: new RunnerOptions({ customFolder: 'ai-lab-tests-pd' }),
runnerOptions: new RunnerOptions({
customFolder: 'ai-lab-e2e',
autoCheckUpdates: false,
autoUpdate: false,
extesionsDisabled: [
'podman-desktop.compose',
'podman-desktop.docker',
'podman-desktop.kind',
'podman-desktop.kube-context',
'podman-desktop.kubectl-cli',
'podman-desktop.registries',
'podman-desktop.lima',
],
binaryPath: isCI ? customSettingsPodmanPath : undefined,
}),
});
test.beforeAll(async ({ runner, welcomePage, page }) => {
runner.setVideoAndTraceName('ai-lab-e2e');
Expand Down Expand Up @@ -79,7 +103,7 @@ test.describe.serial(`AI Lab extension installation and verification`, () => {
});
});
test.describe.serial(`AI Lab extension verification`, () => {
test.skip(isLinux, `Skipping AI App deployment on Linux`);
test.skip(os.platform() === 'linux', `Skipping AI App deployment on Linux`);
test(`Open Recipes Catalog`, async () => {
recipesCatalogPage = await aiLabPage.navigationBar.openRecipesCatalog();
await recipesCatalogPage.waitForLoad();
Expand Down

0 comments on commit 1fcb4ad

Please sign in to comment.