From 074ba676868ad18a9509ff047e99fbf3b0c7110e Mon Sep 17 00:00:00 2001 From: Raju Udava <86527202+dstala@users.noreply.github.com> Date: Mon, 17 Jul 2023 22:29:39 +0530 Subject: [PATCH] test: fix for account list access from non admin roles Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com> --- .../users&Accounts/accountUserManagement.spec.ts | 14 +++++++++++--- tests/playwright/tests/db/views/viewForm.spec.ts | 7 +++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/playwright/tests/db/users&Accounts/accountUserManagement.spec.ts b/tests/playwright/tests/db/users&Accounts/accountUserManagement.spec.ts index fa2678a1c2..bb77608548 100644 --- a/tests/playwright/tests/db/users&Accounts/accountUserManagement.spec.ts +++ b/tests/playwright/tests/db/users&Accounts/accountUserManagement.spec.ts @@ -5,6 +5,7 @@ import { ProjectsPage } from '../../../pages/ProjectsPage'; import { SignupPage } from '../../../pages/SignupPage'; import setup from '../../../setup'; import { getDefaultPwd } from '../../utils/general'; +import { LoginPage } from '../../../pages/LoginPage'; const roleDb = [ { email: 'creator@nocodb.com', role: 'Organization Level Creator', url: '' }, @@ -31,20 +32,27 @@ test.describe('User roles', () => { test('Invite user, update role and delete user', async () => { test.slow(); - await accountUsersPage.goto(); - // invite user for (let i = 0; i < roleDb.length; i++) { + await accountUsersPage.goto(); + roleDb[i].url = await accountUsersPage.invite({ email: roleDb[i].email, role: roleDb[i].role, }); await accountUsersPage.closeInvite(); await signupAndVerify(i); - await accountUsersPage.goto(); + + await accountPage.signOut(); + const loginPage = new LoginPage(accountPage.rootPage); + await loginPage.fillEmail({ email: 'user@nocodb.com', withoutPrefix: true }); + await loginPage.fillPassword(getDefaultPwd()); + await loginPage.submit(); } // update role + await accountUsersPage.goto(); + for (let i = 0; i < roleDb.length; i++) { await accountUsersPage.updateRole({ email: roleDb[i].email, diff --git a/tests/playwright/tests/db/views/viewForm.spec.ts b/tests/playwright/tests/db/views/viewForm.spec.ts index 5547997db4..cb3f952e36 100644 --- a/tests/playwright/tests/db/views/viewForm.spec.ts +++ b/tests/playwright/tests/db/views/viewForm.spec.ts @@ -349,6 +349,9 @@ test.describe('Form view with LTAR', () => { await sharedForm.verifySuccessMessage(); await dashboard.rootPage.goto(url); + // kludge- reload + await dashboard.rootPage.reload(); + await dashboard.viewSidebar.openView({ title: 'Country' }); await dashboard.grid.cell.verify({ @@ -444,7 +447,11 @@ test.describe('Form view', () => { await sharedForm.cell.selectOption.select({ ...multiSelectParams, option: 'mar' }); await sharedForm.submit(); + await dashboard.rootPage.goto(url); + // kludge- reload + await dashboard.rootPage.reload(); + await dashboard.viewSidebar.openView({ title: 'selectBased' }); await dashboard.grid.cell.selectOption.verify({