diff --git a/packages/ui/scripts/dev.localmode-env.sh b/packages/ui/scripts/dev.localmode-env.sh index 68eba31fa..a139f9860 100644 --- a/packages/ui/scripts/dev.localmode-env.sh +++ b/packages/ui/scripts/dev.localmode-env.sh @@ -25,6 +25,10 @@ if [ $? -ne 0 ]; then echo -e "\n\nrun_local_cluster.sh is downloaded, to run your cluster use command:" command="./run_local_cluster.sh --yt-version dev --docker-hostname $(hostname) --fqdn localhost --node-count 2 --ui-app-installation ${APP_INSTALLATION:-''}" + if [ "$SKIP_PULL" != "" ]; then + command="$command --ui-skip-pull true --yt-skip-pull true" + fi + if [ "$UI_VERSION_LOCAL" != "" ]; then docker tag $(npm run -s show:docker-image-name):local $(npm run -s show:docker-image-name:stable):local command="$command --ui-version $UI_VERSION_LOCAL --ui-skip-pull true" diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts new file mode 100644 index 000000000..b87681e64 --- /dev/null +++ b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts @@ -0,0 +1,127 @@ +import {Page, expect, test} from '@playwright/test'; +import {makeClusterUrl} from '../../../utils'; +import {BasePage} from '../../../utils/BasePage'; +import {replaceInnerHtml} from '../../../utils/dom'; + +class Scheduling extends BasePage { + async waitForLoadedPool() { + await this.page.waitForSelector('.elements-table__row :text("yt-e2e-pool-1")'); + } + + async setDetailsMode( + mode: 'CPU' | 'Memory' | 'GPU' | 'User slots' | 'Operations' | 'Integral guarantees', + ) { + await this.page.click(`.scheduling-details__toolbar :text("${mode}")`, {force: true}); + } + + async replaceEstimatedGuarantee(type: 'cpu' | 'memory') { + await replaceInnerHtml(this.page, { + [`tbody .scheduling-details__table-item_type_abs-guaranteed-${type}`]: '0.00', + }); + } + + async showPoolEditor(pool: string) { + const editBtn = await this.page.getByTitle(`edit pool ${pool}`); + await editBtn.scrollIntoViewIfNeeded(); + await editBtn.click(); + } +} + +const scheduling = (page: Page) => new Scheduling({page}); + +test('Scheduling - Overview', async ({page}) => { + await page.goto(makeClusterUrl(`scheduling/overview?pool=yt-e2e-pool-1&tree=default`)); + + await scheduling(page).waitForLoadedPool(); + + await expect(page).toHaveScreenshot(); +}); + +test('Scheduling - ACL', async ({page}) => { + await page.goto(makeClusterUrl(`scheduling/acl?pool=yt-e2e-pool-1&tree=default`)); + + await scheduling(page).waitForACL(); + + await expect(page).toHaveScreenshot(); +}); + +test('Scheduling - Details', async ({page}) => { + await page.goto( + makeClusterUrl(`scheduling/details?pool=yt-e2e-pool-1&tree=default&contentMode=cpu`), + ); + + await scheduling(page).waitForLoadedPool(); + + await test.step('CPU', async () => { + await scheduling(page).replaceEstimatedGuarantee('cpu'); + await expect(page).toHaveScreenshot(); + }); + + await test.step('Memory', async () => { + await scheduling(page).setDetailsMode('Memory'); + await scheduling(page).replaceEstimatedGuarantee('memory'); + await expect(page).toHaveScreenshot(); + }); + + await test.step('GPU', async () => { + await scheduling(page).setDetailsMode('GPU'); + await expect(page).toHaveScreenshot(); + }); + + await test.step('User slots', async () => { + await scheduling(page).setDetailsMode('User slots'); + await expect(page).toHaveScreenshot(); + }); + + await test.step('Operations', async () => { + await scheduling(page).setDetailsMode('Operations'); + await expect(page).toHaveScreenshot(); + }); + + await test.step('Integral guarantees', async () => { + await scheduling(page).setDetailsMode('Integral guarantees'); + await expect(page).toHaveScreenshot(); + }); +}); + +test('Scheduling - Editor', async ({page}) => { + await page.goto( + makeClusterUrl(`scheduling/details?pool=yt-e2e-pool-1&tree=default&contentMode=cpu`), + ); + + await scheduling(page).showPoolEditor('yt-e2e-pool-1'); + + await test.step('General', async () => { + await scheduling(page).dfDialog.waitForField('Max running operation count'); + + await expect(page).toHaveScreenshot(); + }); + + await test.step('Strong Guarantee', async () => { + await scheduling(page).dfDialog.showTab('Strong Guarantee'); + await scheduling(page).dfDialog.waitForField('CPU'); + + await expect(page).toHaveScreenshot(); + }); + + await test.step('Integral Guarantee', async () => { + await scheduling(page).dfDialog.showTab('Integral Guarantee'); + await scheduling(page).dfDialog.waitForField('Burst CPU'); + + await expect(page).toHaveScreenshot(); + }); + + await test.step('Resource limits', async () => { + await scheduling(page).dfDialog.showTab('Resource limits'); + await scheduling(page).dfDialog.waitForField('User slots'); + + await expect(page).toHaveScreenshot(); + }); + + await test.step('Other settings', async () => { + await scheduling(page).dfDialog.showTab('Other settings'); + await scheduling(page).dfDialog.waitForField('Create ephemeral subpools'); + + await expect(page).toHaveScreenshot(); + }); +}); diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---ACL-1-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---ACL-1-chromium-linux.png new file mode 100644 index 000000000..b6013e5da Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---ACL-1-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-1-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-1-chromium-linux.png new file mode 100644 index 000000000..babae3097 Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-1-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-2-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-2-chromium-linux.png new file mode 100644 index 000000000..0bc85c199 Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-2-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-3-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-3-chromium-linux.png new file mode 100644 index 000000000..2738feefe Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-3-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-4-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-4-chromium-linux.png new file mode 100644 index 000000000..edb85130f Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-4-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-5-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-5-chromium-linux.png new file mode 100644 index 000000000..2646b5f22 Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-5-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-6-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-6-chromium-linux.png new file mode 100644 index 000000000..9e628a0da Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Details-6-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-1-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-1-chromium-linux.png new file mode 100644 index 000000000..6dce16eaa Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-1-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-2-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-2-chromium-linux.png new file mode 100644 index 000000000..c48526a0d Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-2-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-3-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-3-chromium-linux.png new file mode 100644 index 000000000..8629eb8ac Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-3-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-4-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-4-chromium-linux.png new file mode 100644 index 000000000..9f1034287 Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-4-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-5-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-5-chromium-linux.png new file mode 100644 index 000000000..0257e3b58 Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Editor-5-chromium-linux.png differ diff --git a/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Overview-1-chromium-linux.png b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Overview-1-chromium-linux.png new file mode 100644 index 000000000..af8be1549 Binary files /dev/null and b/packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts-snapshots/Scheduling---Overview-1-chromium-linux.png differ diff --git a/packages/ui/tests/utils/BasePage.ts b/packages/ui/tests/utils/BasePage.ts index 107ed45f1..4ad08c14e 100644 --- a/packages/ui/tests/utils/BasePage.ts +++ b/packages/ui/tests/utils/BasePage.ts @@ -2,11 +2,30 @@ import {Page} from '@playwright/test'; import {replaceInnerHtml} from './dom'; import {E2E_DIR_NAME} from '.'; +class DFDialogComponent { + readonly page; + + constructor(page: Page) { + this.page = page; + } + + async showTab(name: string) { + await this.page.click(`.df-dialog-tab__name :text("${name}")`); + await this.page.mouse.move(0, 0); + } + + async waitForField(title: string) { + await this.page.waitForSelector(`.df-dialog__label :text("${title}")`); + } +} + export class BasePage { readonly page: Page; + readonly dfDialog: DFDialogComponent; constructor({page}: {page: Page}) { this.page = page; + this.dfDialog = new DFDialogComponent(page); } async waitForTable(selector: string, rowCount: number) { @@ -22,4 +41,8 @@ export class BasePage { async replaceBreadcrumbsTestDir() { await this.replaceBreadcrumbsByTitle(E2E_DIR_NAME, 'e2e.1970-01-01.00:00:00.xxxxxxxxxxx'); } + + async waitForACL() { + await this.page.waitForSelector('.navigation-acl__row .yt-subject-link'); + } }