Skip to content

Commit

Permalink
misc: rename session-launcher test module
Browse files Browse the repository at this point in the history
  • Loading branch information
lizable authored and yomybaby committed Oct 4, 2024
1 parent d17e749 commit a417ae2
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions e2e/session-luancher.test.ts → e2e/session-launcher.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
createSession,
deleteSession,
loginAsAdmin,
loginAsUser,
navigateTo,
} from './test-util';
Expand Down Expand Up @@ -52,3 +53,43 @@ test.describe('NEO Sessions Launcher', () => {
).toBeVisible();
});
});

test.describe('Restrict resource policy and see resource warning message', () => {
// TODO: fix this test
test.skip('superadmin to modify keypair resource policy', async ({
page,
}) => {
await loginAsAdmin(page);
// go to resource policy page
await navigateTo(page, 'resource-policy');
// modify resource limit (cpu, memory) to zero
await page
.getByRole('table')
.getByRole('button', { name: 'setting' })
.click();
await page.locator('.ant-checkbox-input').first().uncheck();
await page.getByLabel('CPU(optional)').click();
await page.getByLabel('CPU(optional)').fill('0');
await page
.locator(
'div:nth-child(2) > div > div > .ant-checkbox-wrapper > span:nth-child(2)',
)
.first()
.uncheck();
await page.getByLabel('Memory(optional)').click();
await page.getByLabel('Memory(optional)').fill('0');
await page.getByRole('button', { name: 'OK' }).click();
// go back to session page and see message in resource allocation section
await navigateTo(page, 'session/start');
await page.getByRole('button', { name: 'Next right' }).click();
const notEnoughCPUResourceMsg = await page
.locator('#resource_cpu_help')
.getByText('Allocatable resources falls')
.textContent();
const notEnoughRAMResourceMsg = await page
.getByText('Allocatable resources falls')
.nth(1)
.textContent();
expect(notEnoughCPUResourceMsg).toEqual(notEnoughRAMResourceMsg);
});
});

0 comments on commit a417ae2

Please sign in to comment.