From 75709e68f30dd3812fadc77d1fe55e8fd3a5eeb5 Mon Sep 17 00:00:00 2001 From: mortadarefd Date: Fri, 20 Oct 2023 11:58:50 +0300 Subject: [PATCH] fix: added container image test --- .../pages/ExecutorGeneralSettingsPage.ts | 11 ++++++++ packages/e2e-tests/tests/executors.spec.ts | 25 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/e2e-tests/pages/ExecutorGeneralSettingsPage.ts b/packages/e2e-tests/pages/ExecutorGeneralSettingsPage.ts index 1079e8da6..49f02477f 100644 --- a/packages/e2e-tests/pages/ExecutorGeneralSettingsPage.ts +++ b/packages/e2e-tests/pages/ExecutorGeneralSettingsPage.ts @@ -20,6 +20,17 @@ export class ExecutorGeneralSettingsPage { expect(executorTypeLocator.isVisible()).toBeTruthy(); } + public async selectContainerImageTab(): Promise { + await this.page.click('div[data-test="sidebar-navigation-link:container-image"]'); + } + + public async validateContainerImageSettings(containerImage: string): Promise { + const containerImageLocator = this.page.locator( + `//input[@id="container-image-settings-name-type_container_image" and @value="${containerImage}"]` + ); + expect(containerImageLocator.isVisible()).toBeTruthy(); + } + public async deleteExecutor(executorName: string): Promise { await this.page.click('button[data-testid="configuration-card-confirm-button"]'); await this.page.getByTestId('delete-entity-input').fill(executorName); diff --git a/packages/e2e-tests/tests/executors.spec.ts b/packages/e2e-tests/tests/executors.spec.ts index 6e2924085..883dbf898 100644 --- a/packages/e2e-tests/tests/executors.spec.ts +++ b/packages/e2e-tests/tests/executors.spec.ts @@ -86,7 +86,30 @@ test(`Custom container executor - delete executor`, async ({page}) => { expect(isDeleted).toBeTruthy(); }); -test.skip(`Custom container executor - container image`, async ({page}) => {}); +test(`Custom container executor - container image`, async ({page}) => { + const executorName = 'container-executor-curl-1'; + const executorData = testDataHandler.getExecutor(executorName); + const realExecutorName = executorData.name; + await api.assureExecutorCreated(executorData); + + const mainPage = new MainPage(page); + await mainPage.visitMainPage(); + + const navigationSiderPage = new NavigationSiderPage(page); + await navigationSiderPage.openMenuItem('executors'); + + const executorsPage = new ExecutorsPage(page); + await executorsPage.openExecutorSettings(realExecutorName); + + const executorGeneralSettingsPage = new ExecutorGeneralSettingsPage(page); + + await executorGeneralSettingsPage.selectContainerImageTab(); + + await executorGeneralSettingsPage.validateContainerImageSettings(executorData.image); + + // Cleanup + await api.removeExecutor(realExecutorName); +}); test.skip(`Custom container executor - command and arguments`, async ({page}) => {});