diff --git a/web/crux-ui/e2e/with-login/container-config/common-editor.spec.ts b/web/crux-ui/e2e/with-login/container-config/common-editor.spec.ts index fd56c19a6..6fa73895e 100644 --- a/web/crux-ui/e2e/with-login/container-config/common-editor.spec.ts +++ b/web/crux-ui/e2e/with-login/container-config/common-editor.spec.ts @@ -1,5 +1,5 @@ +import { WS_TYPE_PATCH_CONFIG } from '@app/models' import { expect, Page } from '@playwright/test' -import { test } from '../../utils/test.fixture' import { NGINX_TEST_IMAGE_WITH_TAG, TEAM_ROUTES } from 'e2e/utils/common' import { createStorage } from 'e2e/utils/storages' import { @@ -20,33 +20,33 @@ import { wsPatchMatchVolume, } from 'e2e/utils/websocket-match' import { createImage, createProject, createVersion } from '../../utils/projects' +import { test } from '../../utils/test.fixture' import { waitSocketRef, wsPatchSent } from '../../utils/websocket' -import { WS_TYPE_PATCH_CONFIG } from '@app/models' const setup = async ( page: Page, projectName: string, versionName: string, imageName: string, -): Promise<{ projectId: string; versionId: string; imageId: string }> => { +): Promise<{ imageConfigId: string }> => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, versionName, 'Incremental') const imageConfigId = await createImage(page, projectId, versionId, imageName) - return { projectId, versionId, imageConfigId } + return { imageConfigId } } test.describe.configure({ mode: 'parallel' }) test.describe('Image common config from editor', () => { test('Container name should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'name-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'name-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const name = 'new-container-name' @@ -60,13 +60,13 @@ test.describe('Image common config from editor', () => { }) test('Expose strategy should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'expose-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'expose-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchExpose('exposeWithTls')) await page.getByRole('button', { name: 'HTTPS', exact: true }).click() @@ -78,13 +78,13 @@ test.describe('Image common config from editor', () => { }) test('User should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'user-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'user-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const user = 23 @@ -98,13 +98,13 @@ test.describe('Image common config from editor', () => { }) test('TTY should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'tty-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'tty-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("TTY")').click() @@ -118,13 +118,13 @@ test.describe('Image common config from editor', () => { }) test('Port should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'port-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'port-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Ports")').click() @@ -148,13 +148,13 @@ test.describe('Image common config from editor', () => { }) test('Port ranges should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'port-range-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'port-range-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Port ranges")').click() @@ -191,13 +191,13 @@ test.describe('Image common config from editor', () => { }) test('Secrets should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'secrets-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'secrets-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Secrets")').click() @@ -217,13 +217,13 @@ test.describe('Image common config from editor', () => { }) test('Commands should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'commands-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'commands-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Commands")').click() @@ -240,13 +240,13 @@ test.describe('Image common config from editor', () => { }) test('Arguments should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'arguments-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'arguments-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Arguments")').click() @@ -263,12 +263,12 @@ test.describe('Image common config from editor', () => { }) test('Routing should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'routing-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'routing-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Ports")').click() @@ -314,17 +314,12 @@ test.describe('Image common config from editor', () => { }) test('Environment should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'environment-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'environment-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Environment")').click() @@ -343,17 +338,12 @@ test.describe('Image common config from editor', () => { }) test('Config container should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'config-container-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'config-container-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Config container")').click() const confDiv = page.locator('div.grid:has(label:has-text("CONFIG CONTAINER"))') @@ -378,17 +368,12 @@ test.describe('Image common config from editor', () => { }) test('Init containers should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'init-container-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'init-container-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const name = 'container-name' const image = 'image' @@ -436,12 +421,12 @@ test.describe('Image common config from editor', () => { }) test('Volume should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'volume-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'volume-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Volume")').click() @@ -470,7 +455,7 @@ test.describe('Image common config from editor', () => { }) test('Storage should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'storage-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'storage-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const storageName = 'image-editor-storage' const storageId = await createStorage(page, storageName, 'storage.com', '1234', '12345') @@ -479,7 +464,7 @@ test.describe('Image common config from editor', () => { await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Volume")').click() diff --git a/web/crux-ui/e2e/with-login/container-config/container-config-filters.spec.ts b/web/crux-ui/e2e/with-login/container-config/container-config-filters.spec.ts index 12d4e5598..fbf3249a5 100644 --- a/web/crux-ui/e2e/with-login/container-config/container-config-filters.spec.ts +++ b/web/crux-ui/e2e/with-login/container-config/container-config-filters.spec.ts @@ -1,28 +1,24 @@ import { expect, Page } from '@playwright/test' -import { test } from '../../utils/test.fixture' import { NGINX_TEST_IMAGE_WITH_TAG, TEAM_ROUTES } from 'e2e/utils/common' import { createImage, createProject, createVersion } from '../../utils/projects' +import { test } from '../../utils/test.fixture' const setup = async ( page: Page, projectName: string, versionName: string, imageName: string, -): Promise<{ projectId: string; versionId: string; imageId: string }> => { +): Promise<{ imageConfigId: string }> => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, versionName, 'Incremental') const imageConfigId = await createImage(page, projectId, versionId, imageName) - return { - projectId, - versionId, - imageConfigId, - } + return { imageConfigId } } test.describe('Filters', () => { test('None should be selected by default', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'filter-all', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'filter-all', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') @@ -34,7 +30,7 @@ test.describe('Filters', () => { }) test('All should not be selected if one of the main filters are not selected', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'filter-select', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'filter-select', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') @@ -47,7 +43,7 @@ test.describe('Filters', () => { }) test('Main filter should not be selected if one of its sub filters are not selected', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'sub-filter', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'sub-filter', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') @@ -62,7 +58,7 @@ test.describe('Filters', () => { }) test('Config field should be invisible if its sub filter is not selected', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'sub-deselect', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'sub-deselect', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') diff --git a/web/crux-ui/e2e/with-login/container-config/docker-editor.spec.ts b/web/crux-ui/e2e/with-login/container-config/docker-editor.spec.ts index 04b04e169..7a68cc2e8 100644 --- a/web/crux-ui/e2e/with-login/container-config/docker-editor.spec.ts +++ b/web/crux-ui/e2e/with-login/container-config/docker-editor.spec.ts @@ -17,27 +17,22 @@ const setup = async ( projectName: string, versionName: string, imageName: string, -): Promise<{ projectId: string; versionId: string; imageId: string }> => { +): Promise<{ imageConfigId: string }> => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, versionName, 'Incremental') const imageConfigId = await createImage(page, projectId, versionId, imageName) - return { projectId, versionId, imageConfigId: imageConfigId } + return { imageConfigId } } test.describe('Image docker config from editor', () => { test('Network mode should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'networkmode-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'networkmode-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const mode = 'host' @@ -53,17 +48,12 @@ test.describe('Image docker config from editor', () => { }) test('Docker labels should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'dockerlabel-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'dockerlabel-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const key = 'docker-key' const value = 'docker-value' @@ -84,17 +74,12 @@ test.describe('Image docker config from editor', () => { }) test('Restart policy should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'restartpolicy-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'restartpolicy-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG, wsPatchMatchRestartPolicy('always')) await page.locator('div.grid:has(label:has-text("RESTART POLICY")) button:has-text("Always")').click() @@ -108,12 +93,12 @@ test.describe('Image docker config from editor', () => { }) test('Log config should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'logconfig-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'logconfig-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Log config")').click() @@ -137,12 +122,12 @@ test.describe('Image docker config from editor', () => { }) test('Networks should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'networks-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'networks-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Networks")').click() diff --git a/web/crux-ui/e2e/with-login/container-config/docker-json.spec.ts b/web/crux-ui/e2e/with-login/container-config/docker-json.spec.ts index 507b3d2bc..ab69528e8 100644 --- a/web/crux-ui/e2e/with-login/container-config/docker-json.spec.ts +++ b/web/crux-ui/e2e/with-login/container-config/docker-json.spec.ts @@ -17,24 +17,24 @@ const setup = async ( projectName: string, versionName: string, imageName: string, -): Promise<{ projectId: string; versionId: string; imageId: string }> => { +): Promise<{ imageConfigId: string }> => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, versionName, 'Incremental') const imageConfigId = await createImage(page, projectId, versionId, imageName) - return { projectId, versionId, imageConfigId: imageConfigId } + return { imageConfigId } } test.describe.configure({ mode: 'parallel' }) test.describe('Image docker config from JSON', () => { test('Network mode should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'networkmode-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'networkmode-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const mode = 'host' @@ -57,12 +57,12 @@ test.describe('Image docker config from JSON', () => { }) test('Docker labels should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'dockerlabel-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'dockerlabel-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const key = 'docker-key' const value = 'docker-value' @@ -89,17 +89,12 @@ test.describe('Image docker config from JSON', () => { }) test('Restart policy should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'restartpolicy-json', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'restartpolicy-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const jsonEditorButton = await page.waitForSelector('button:has-text("JSON")') await jsonEditorButton.click() @@ -120,12 +115,12 @@ test.describe('Image docker config from JSON', () => { }) test('Log config should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'logconfig-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'logconfig-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const type = 'json-file' const key = 'logger-key' @@ -151,12 +146,12 @@ test.describe('Image docker config from JSON', () => { }) test('Networks should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'networks-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'networks-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Networks")').click() diff --git a/web/crux-ui/e2e/with-login/container-config/image-config-view-state.spec.ts b/web/crux-ui/e2e/with-login/container-config/image-config-view-state.spec.ts index fde1249dc..414acbf56 100644 --- a/web/crux-ui/e2e/with-login/container-config/image-config-view-state.spec.ts +++ b/web/crux-ui/e2e/with-login/container-config/image-config-view-state.spec.ts @@ -8,21 +8,17 @@ const setup = async ( projectName: string, versionName: string, imageName: string, -): Promise<{ projectId: string; versionId: string; imageId: string }> => { +): Promise<{ imageConfigId: string }> => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, versionName, 'Incremental') const imageConfigId = await createImage(page, projectId, versionId, imageName) - return { - projectId, - versionId, - imageId: imageConfigId, - } + return { imageConfigId } } test.describe('View state', () => { test('Editor state should show the configuration fields', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'editor-state-conf', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'editor-state-conf', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') @@ -39,7 +35,7 @@ test.describe('View state', () => { }) test('JSON state should show the json editor', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'editor-state-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'editor-state-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') diff --git a/web/crux-ui/e2e/with-login/container-config/kubernetes-editor.spec.ts b/web/crux-ui/e2e/with-login/container-config/kubernetes-editor.spec.ts index ef3d1b0e1..972d7a16f 100644 --- a/web/crux-ui/e2e/with-login/container-config/kubernetes-editor.spec.ts +++ b/web/crux-ui/e2e/with-login/container-config/kubernetes-editor.spec.ts @@ -25,28 +25,23 @@ const setup = async ( projectName: string, versionName: string, imageName: string, -): Promise<{ projectId: string; versionId: string; imageId: string }> => { +): Promise<{ imageConfigId: string }> => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, versionName, 'Incremental') const imageConfigId = await createImage(page, projectId, versionId, imageName) - return { projectId, versionId, imageConfigId: imageConfigId } + return { imageConfigId } } test.describe('Image kubernetes config from editor', () => { test('Deployment strategy should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'deployment-strategy-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'deployment-strategy-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const strategy = 'rolling' @@ -60,18 +55,13 @@ test.describe('Image kubernetes config from editor', () => { }) test('Custom headers should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'custom-headers-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'custom-headers-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Custom headers")').click() @@ -90,18 +80,13 @@ test.describe('Image kubernetes config from editor', () => { }) test('Proxy headers should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'proxy-headers-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'proxy-headers-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Proxy headers")').click() @@ -115,18 +100,13 @@ test.describe('Image kubernetes config from editor', () => { }) test('Load balancer should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'load-balancer-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'load-balancer-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Use load balancer")').click() @@ -159,18 +139,13 @@ test.describe('Image kubernetes config from editor', () => { }) test('Health check config should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'health-check-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'health-check-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Health check config")').click() @@ -202,17 +177,12 @@ test.describe('Image kubernetes config from editor', () => { }) test('Resource config should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'resource-config-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'resource-config-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Resource config")').click() @@ -247,13 +217,13 @@ test.describe('Image kubernetes config from editor', () => { page.locator(`div.max-h-128 > div:nth-child(2):near(label:has-text("${category}"))`) test('Labels should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'labels-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'labels-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.getByRole('button', { name: 'Labels', exact: true }).click() @@ -288,18 +258,13 @@ test.describe('Image kubernetes config from editor', () => { }) test('Annotations should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'annotations-editor', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'annotations-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.getByRole('button', { name: 'Annotations', exact: true }).click() diff --git a/web/crux-ui/e2e/with-login/container-config/kubernetes-json.spec.ts b/web/crux-ui/e2e/with-login/container-config/kubernetes-json.spec.ts index 166bf48c6..3e372bf41 100644 --- a/web/crux-ui/e2e/with-login/container-config/kubernetes-json.spec.ts +++ b/web/crux-ui/e2e/with-login/container-config/kubernetes-json.spec.ts @@ -1,5 +1,5 @@ +import { WS_TYPE_PATCH_CONFIG } from '@app/models' import { expect, Page } from '@playwright/test' -import { test } from '../../utils/test.fixture' import { NGINX_TEST_IMAGE_WITH_TAG, TEAM_ROUTES } from 'e2e/utils/common' import { wsPatchMatchCustomHeader, @@ -17,36 +17,31 @@ import { wsPatchMatchServiceLabel, } from 'e2e/utils/websocket-match' import { createImage, createProject, createVersion } from '../../utils/projects' +import { test } from '../../utils/test.fixture' import { waitSocketRef, wsPatchSent } from '../../utils/websocket' -import { WS_TYPE_PATCH_CONFIG } from '@app/models' const setup = async ( page: Page, projectName: string, versionName: string, imageName: string, -): Promise<{ projectId: string; versionId: string; imageId: string }> => { +): Promise<{ imageConfigId: string }> => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, versionName, 'Incremental') const imageConfigId = await createImage(page, projectId, versionId, imageName) - return { projectId, versionId, imageConfigId: imageConfigId } + return { imageConfigId } } test.describe('Image kubernetes config from JSON', () => { test('Deployment strategy should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'deployment-strategy-json', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'deployment-strategy-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const strategy = 'rolling' @@ -67,18 +62,13 @@ test.describe('Image kubernetes config from JSON', () => { }) test('Custom headers should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'custom-headers-json', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'custom-headers-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const header = 'test-header' @@ -102,18 +92,13 @@ test.describe('Image kubernetes config from JSON', () => { }) test('Proxy headers should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'proxy-headers-json', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'proxy-headers-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const jsonEditorButton = await page.waitForSelector('button:has-text("JSON")') await jsonEditorButton.click() @@ -132,18 +117,13 @@ test.describe('Image kubernetes config from JSON', () => { }) test('Load balancer should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'load-balancer-json', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'load-balancer-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const key = 'balancer-key' const value = 'balancer-value' @@ -177,13 +157,13 @@ test.describe('Image kubernetes config from JSON', () => { }) test('Health check config should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'health-check-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'health-check-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const port = 12560 const liveness = 'test/liveness/' @@ -216,18 +196,13 @@ test.describe('Image kubernetes config from JSON', () => { }) test('Resource config should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup( - page, - 'resource-config-json', - '1.0.0', - NGINX_TEST_IMAGE_WITH_TAG, - ) + const { imageConfigId } = await setup(page, 'resource-config-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const cpuLimits = '50' const cpuRequests = '25' @@ -266,13 +241,13 @@ test.describe('Image kubernetes config from JSON', () => { page.locator(`div.max-h-128 > div:nth-child(2):near(label:has-text("${category}"))`) test('Labels should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'labels-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'labels-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const key = 'label-key' const value = 'label-value' @@ -310,13 +285,13 @@ test.describe('Image kubernetes config from JSON', () => { }) test('Annotations should be saved', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'annotations-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'annotations-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const key = 'annotation-key' const value = 'annotation-value' diff --git a/web/crux-ui/e2e/with-login/deployment/deployment-copy.spec.ts b/web/crux-ui/e2e/with-login/deployment/deployment-copy.spec.ts index 76e850913..99bd90b95 100644 --- a/web/crux-ui/e2e/with-login/deployment/deployment-copy.spec.ts +++ b/web/crux-ui/e2e/with-login/deployment/deployment-copy.spec.ts @@ -24,7 +24,7 @@ const addSecretToImage = async ( await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const jsonEditorButton = await page.waitForSelector('button:has-text("JSON")') await jsonEditorButton.click() diff --git a/web/crux-ui/e2e/with-login/deployment/deployment-copyability-versioned.spec.ts b/web/crux-ui/e2e/with-login/deployment/deployment-copyability-versioned.spec.ts index 7a78d13bd..5837f5cb0 100644 --- a/web/crux-ui/e2e/with-login/deployment/deployment-copyability-versioned.spec.ts +++ b/web/crux-ui/e2e/with-login/deployment/deployment-copyability-versioned.spec.ts @@ -1,11 +1,11 @@ -import { ProjectType, WS_TYPE_PATCH_CONFIG } from '@app/models' +import { ProjectType, WS_TYPE_PATCH_IMAGE } from '@app/models' import { Page, expect } from '@playwright/test' import { NGINX_TEST_IMAGE_WITH_TAG, TEAM_ROUTES, waitForURLExcept } from '../../utils/common' import { deployWithDagent } from '../../utils/node-helper' import { createNode } from '../../utils/nodes' import { addDeploymentToVersion, - createImage as imageConfigId, + createImage, createProject, createVersion, fillDeploymentPrefix, @@ -39,7 +39,7 @@ test.describe('Versioned Project', () => { const { projectId } = await setup(page, nodeName, projectName, 'versioned') const versionId = await createVersion(page, projectId, '0.1.0', 'Incremental') - await imageConfigId(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) + await createImage(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) const { id: deploymentId } = await addDeploymentToVersion(page, projectId, versionId, nodeName, { prefix }) await page.goto(TEAM_ROUTES.deployment.details(deploymentId)) @@ -66,7 +66,7 @@ test.describe('Versioned Project', () => { const { projectId } = await setup(page, nodeName, projectName, 'versioned') const versionId = await createVersion(page, projectId, '0.1.0', 'Incremental') - await imageConfigId(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) + await createImage(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) const { id: deploymentId } = await addDeploymentToVersion(page, projectId, versionId, nodeName, { prefix }) await page.goto(TEAM_ROUTES.deployment.details(deploymentId)) @@ -93,7 +93,7 @@ test.describe('Versioned Project', () => { const { projectId } = await setup(page, nodeName, projectName, 'versioned') const versionId = await createVersion(page, projectId, '1.0.0', 'Incremental') - await imageConfigId(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) + await createImage(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) await addDeploymentToVersion(page, projectId, versionId, nodeName, { prefix }) await page.goto(TEAM_ROUTES.deployment.list()) @@ -118,13 +118,13 @@ test.describe('Versioned Project', () => { const projectId = await createProject(page, projectName, 'versioned') const versionId = await createVersion(page, projectId, '0.1.0', 'Incremental') - const imageId = await imageConfigId(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) + const imageId = await createImage(page, projectId, versionId, NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) - await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) + await page.goto(TEAM_ROUTES.project.versions(projectId).imageDetails(versionId, imageId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const editorButton = await page.waitForSelector('button:has-text("JSON")') await editorButton.click() @@ -145,7 +145,7 @@ test.describe('Versioned Project', () => { useParentConfig: false, }, ] - const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_CONFIG) + const wsSent = wsPatchSent(ws, wsRoute, WS_TYPE_PATCH_IMAGE) await jsonContainer.fill(JSON.stringify(configObject)) await wsSent diff --git a/web/crux-ui/e2e/with-login/deployment/deployment-deletability.spec.ts b/web/crux-ui/e2e/with-login/deployment/deployment-deletability.spec.ts index 62ba1da13..7d605877c 100644 --- a/web/crux-ui/e2e/with-login/deployment/deployment-deletability.spec.ts +++ b/web/crux-ui/e2e/with-login/deployment/deployment-deletability.spec.ts @@ -17,7 +17,7 @@ test('In progress deployment should be not deletable', async ({ page }) => { await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const editorButton = await page.waitForSelector('button:has-text("JSON")') await editorButton.click() diff --git a/web/crux-ui/e2e/with-login/image-config.spec.ts b/web/crux-ui/e2e/with-login/image-config.spec.ts index a03b93299..eb009625d 100644 --- a/web/crux-ui/e2e/with-login/image-config.spec.ts +++ b/web/crux-ui/e2e/with-login/image-config.spec.ts @@ -119,13 +119,13 @@ const wsPatchMatchPorts = (internalPort: string, externalPort?: string) => (payl test.describe('Image configurations', () => { test('Port should be saved after adding it from the config field', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'port-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'port-editor', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) await page.locator('button:has-text("Ports")').click() @@ -152,13 +152,13 @@ test.describe('Image configurations', () => { }) test('Port should be saved after adding it from the json editor', async ({ page }) => { - const { projectId, versionId, imageConfigId } = await setup(page, 'port-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) + const { imageConfigId } = await setup(page, 'port-json', '1.0.0', NGINX_TEST_IMAGE_WITH_TAG) const sock = waitSocketRef(page) await page.goto(TEAM_ROUTES.containerConfig.details(imageConfigId)) await page.waitForSelector('h2:text-is("Image")') const ws = await sock - const wsRoute = TEAM_ROUTES.project.versions(projectId).detailsSocket(versionId) + const wsRoute = TEAM_ROUTES.containerConfig.detailsSocket(imageConfigId) const jsonEditorButton = await page.waitForSelector('button:has-text("JSON")') await jsonEditorButton.click()