From 6c69de9c835f19dfcadc9806d94704cbf8b20c71 Mon Sep 17 00:00:00 2001 From: Tibor Dancs Date: Thu, 5 Sep 2024 11:47:37 +0200 Subject: [PATCH] chore(test): pass custom settings object into podman-desktop-runner Signed-off-by: Tibor Dancs --- tests/playwright/src/ai-lab-extension.spec.ts | 35 +++++++++++++++++-- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/tests/playwright/src/ai-lab-extension.spec.ts b/tests/playwright/src/ai-lab-extension.spec.ts index f1bcc1cfc..dc171be59 100644 --- a/tests/playwright/src/ai-lab-extension.spec.ts +++ b/tests/playwright/src/ai-lab-extension.spec.ts @@ -18,7 +18,18 @@ import type { Page } from '@playwright/test'; import type { DashboardPage, ExtensionsPage } from '@podman-desktop/tests-playwright'; +<<<<<<< HEAD import { NavigationBar, Runner, expect as playExpect, test, RunnerOptions, waitForPodmanMachineStartup } from '@podman-desktop/tests-playwright'; +======= +import { + NavigationBar, + Runner, + waitForPodmanMachineStartup, + RunnerOptions, + expect as playExpect, + test, +} from '@podman-desktop/tests-playwright'; +>>>>>>> 70cd1b9 (chore(test): pass custom settings object into podman-desktop-runner) 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'; @@ -30,7 +41,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; @@ -41,7 +56,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'); @@ -79,7 +108,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();