-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests/screenshots): add tests for Scheduling
- Loading branch information
1 parent
fc25ad4
commit b0066eb
Showing
16 changed files
with
154 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
packages/ui/tests/screenshots/pages/scheduling/scheduling.base.screen.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); | ||
}); |
Binary file added
BIN
+55.3 KB
...uling/scheduling.base.screen.ts-snapshots/Scheduling---ACL-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.9 KB
...g/scheduling.base.screen.ts-snapshots/Scheduling---Details-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.1 KB
...g/scheduling.base.screen.ts-snapshots/Scheduling---Details-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.7 KB
...g/scheduling.base.screen.ts-snapshots/Scheduling---Details-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.4 KB
...g/scheduling.base.screen.ts-snapshots/Scheduling---Details-4-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.1 KB
...g/scheduling.base.screen.ts-snapshots/Scheduling---Details-5-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+38.3 KB
...g/scheduling.base.screen.ts-snapshots/Scheduling---Details-6-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.9 KB
...ng/scheduling.base.screen.ts-snapshots/Scheduling---Editor-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+45.1 KB
...ng/scheduling.base.screen.ts-snapshots/Scheduling---Editor-2-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+53 KB
...ng/scheduling.base.screen.ts-snapshots/Scheduling---Editor-3-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+39 KB
...ng/scheduling.base.screen.ts-snapshots/Scheduling---Editor-4-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.9 KB
...ng/scheduling.base.screen.ts-snapshots/Scheduling---Editor-5-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+48 KB
.../scheduling.base.screen.ts-snapshots/Scheduling---Overview-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters