mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:38:51 +00:00
fix: acl e2e failed (#3835)
* test: acl e2e test * refactor: test: acle e2e test fix
This commit is contained in:
parent
d3bd0c71dd
commit
e95f4ab123
@ -70,7 +70,7 @@ test('allows to confgiure plugins ', async ({ page, mockPage, mockRole, updateRo
|
||||
.locator('span')
|
||||
.nth(1)
|
||||
.click();
|
||||
await expect(page.getByRole('tab').getByText('Plugin settings')).toBeVisible();
|
||||
await expect(page.getByText('Plugin settings')).toBeVisible();
|
||||
await updateRole({
|
||||
name: roleData.name,
|
||||
snippets: ['!pm.*'],
|
||||
|
@ -29,8 +29,10 @@ test('menu permission ', async ({ page, mockPage, mockRole, updateRole }) => {
|
||||
.nth(1)
|
||||
.click();
|
||||
await page.getByRole('tab').getByText('Menu').click();
|
||||
await page.waitForSelector('.ant-table');
|
||||
await expect(page.getByRole('row', { name: 'page1' }).locator('.ant-checkbox-input')).toBeChecked({ checked: true });
|
||||
await page.waitForTimeout(1000);
|
||||
await expect(page.getByRole('row', { name: 'page1' }).locator('.ant-checkbox-input').last()).toBeChecked({
|
||||
checked: true,
|
||||
});
|
||||
await expect(page.getByRole('row', { name: 'page2' }).locator('.ant-checkbox-input')).toBeChecked({ checked: false });
|
||||
//修改菜单权限,page1无权限,page2有权限
|
||||
await updateRole({ name: roleData.name, menuUiSchemas: [uid2] });
|
||||
@ -47,8 +49,10 @@ test('menu permission ', async ({ page, mockPage, mockRole, updateRole }) => {
|
||||
.nth(1)
|
||||
.click();
|
||||
await page.getByRole('tab').getByText('Menu').click();
|
||||
await page.waitForSelector('.ant-table');
|
||||
await expect(page.getByRole('row', { name: 'page1' }).locator('.ant-checkbox-input')).toBeChecked({ checked: false });
|
||||
await page.waitForTimeout(1000);
|
||||
await expect(page.getByRole('row', { name: 'page1' }).locator('.ant-checkbox-input').last()).toBeChecked({
|
||||
checked: false,
|
||||
});
|
||||
await expect(page.getByRole('row', { name: 'page2' }).locator('.ant-checkbox-input')).toBeChecked({ checked: true });
|
||||
//通过路由访问无权限的菜单,跳到有权限的第一个菜单
|
||||
await page.goto(`/admin/${uid1}`);
|
||||
|
Loading…
Reference in New Issue
Block a user