mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 09:17:23 +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')
|
.locator('span')
|
||||||
.nth(1)
|
.nth(1)
|
||||||
.click();
|
.click();
|
||||||
await expect(page.getByRole('tab').getByText('Plugin settings')).toBeVisible();
|
await expect(page.getByText('Plugin settings')).toBeVisible();
|
||||||
await updateRole({
|
await updateRole({
|
||||||
name: roleData.name,
|
name: roleData.name,
|
||||||
snippets: ['!pm.*'],
|
snippets: ['!pm.*'],
|
||||||
|
@ -29,8 +29,10 @@ test('menu permission ', async ({ page, mockPage, mockRole, updateRole }) => {
|
|||||||
.nth(1)
|
.nth(1)
|
||||||
.click();
|
.click();
|
||||||
await page.getByRole('tab').getByText('Menu').click();
|
await page.getByRole('tab').getByText('Menu').click();
|
||||||
await page.waitForSelector('.ant-table');
|
await page.waitForTimeout(1000);
|
||||||
await expect(page.getByRole('row', { name: 'page1' }).locator('.ant-checkbox-input')).toBeChecked({ checked: true });
|
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 });
|
await expect(page.getByRole('row', { name: 'page2' }).locator('.ant-checkbox-input')).toBeChecked({ checked: false });
|
||||||
//修改菜单权限,page1无权限,page2有权限
|
//修改菜单权限,page1无权限,page2有权限
|
||||||
await updateRole({ name: roleData.name, menuUiSchemas: [uid2] });
|
await updateRole({ name: roleData.name, menuUiSchemas: [uid2] });
|
||||||
@ -47,8 +49,10 @@ test('menu permission ', async ({ page, mockPage, mockRole, updateRole }) => {
|
|||||||
.nth(1)
|
.nth(1)
|
||||||
.click();
|
.click();
|
||||||
await page.getByRole('tab').getByText('Menu').click();
|
await page.getByRole('tab').getByText('Menu').click();
|
||||||
await page.waitForSelector('.ant-table');
|
await page.waitForTimeout(1000);
|
||||||
await expect(page.getByRole('row', { name: 'page1' }).locator('.ant-checkbox-input')).toBeChecked({ checked: false });
|
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 expect(page.getByRole('row', { name: 'page2' }).locator('.ant-checkbox-input')).toBeChecked({ checked: true });
|
||||||
//通过路由访问无权限的菜单,跳到有权限的第一个菜单
|
//通过路由访问无权限的菜单,跳到有权限的第一个菜单
|
||||||
await page.goto(`/admin/${uid1}`);
|
await page.goto(`/admin/${uid1}`);
|
||||||
|
Loading…
Reference in New Issue
Block a user