Browse Source

Merge pull request #7485 from nocodb/test/user-invite-fix

test: remove user before retry
pull/7498/head
Raju Udava 10 months ago committed by GitHub
parent
commit
4ef097b6b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      tests/playwright/pages/Account/Users.ts
  2. 3
      tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts

3
tests/playwright/pages/Account/Users.ts

@ -50,7 +50,8 @@ export class AccountUsersPage extends BasePage {
await this.verifyToast({ message: 'Successfully added user' }); await this.verifyToast({ message: 'Successfully added user' });
// TODO: Wait on the invite api and get the invite url a better way as we are not waiting if the url is reflected in the UI // TODO: Wait on the invite api and get the invite url a better way as we are not waiting if the url is reflected in the UI
await this.rootPage.waitForTimeout(1000); // await this.rootPage.waitForTimeout(1000);
await this.inviteUserModal.waitFor({ state: 'visible' });
// http://localhost:3000/#/signup/a5e7bf3a-cbb0-46bc-87f7-c2ae21796707 // http://localhost:3000/#/signup/a5e7bf3a-cbb0-46bc-87f7-c2ae21796707
return (await this.inviteUserModal.locator(`.ant-alert-message`).innerText()).split('\n')[0]; return (await this.inviteUserModal.locator(`.ant-alert-message`).innerText()).split('\n')[0];

3
tests/playwright/tests/db/usersAccounts/accountUserManagement.spec.ts

@ -52,7 +52,8 @@ test.describe('User roles', () => {
for (let i = 0; i < roleDb.length; i++) { for (let i = 0; i < roleDb.length; i++) {
const user = await api.orgUsers.list(); const user = await api.orgUsers.list();
if (user.list.length > 0) { if (user.list.length > 0) {
const u = user.list.find((u: any) => u.email === roleDb[i].email); // const u = user.list.find((u: any) => u.email === roleDb[i].email);
const u = user.list.find((u: any) => u.email === accountUsersPage.prefixEmail(roleDb[i].email));
if (u) await api.orgUsers.delete(u.id); if (u) await api.orgUsers.delete(u.id);
} }
} }

Loading…
Cancel
Save