Browse Source

fix: test contex menu

pull/6459/head
sreehari jayaraj 1 year ago
parent
commit
430dbd13dc
  1. 2
      packages/nc-gui/components/account/UserList.vue
  2. 8
      tests/playwright/pages/Account/Users.ts

2
packages/nc-gui/components/account/UserList.vue

@ -4,7 +4,7 @@ import type { OrgUserReqType, RequestParams, Roles, UserType } from 'nocodb-sdk'
import type { User } from '#imports'
import { extractSdkResponseErrorMsg, iconMap, useApi, useCopy, useDashboard, useNuxtApp } from '#imports'
const { api, isLoading } = useApi()
const { api } = useApi()
const { $e } = useNuxtApp()

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

@ -71,12 +71,12 @@ export class AccountUsersPage extends BasePage {
email = this.prefixEmail(email);
await this.get().waitFor();
return this.get().locator(`[data-testid="nc-token-list"] span:has-text("${email}")`);
return this.get().locator(`[data-testid="nc-token-list"]:has-text("${email}")`);
}
async updateRole({ email, role }: { email: string; role: string }) {
const userRow = await this.getUserRow({ email });
await userRow.locator(`.nc-user-roles`).click();
await userRow.locator('.nc-user-roles').click();
await this.rootPage.locator(`.nc-users-list-role-option:visible:has-text("${role}")`).waitFor();
await this.rootPage.locator(`.nc-users-list-role-option:visible:has-text("${role}")`).last().click();
await this.rootPage.locator(`.nc-users-list-role-option`).last().waitFor({ state: 'hidden' });
@ -88,12 +88,12 @@ export class AccountUsersPage extends BasePage {
async openRowActionMenu({ email }: { email: string }) {
const userRow = await this.getUserRow({ email });
return userRow.locator(`.nc-user-row-action`).click();
return userRow.locator(`.nc-icon`).click();
}
async deleteUser({ email }: { email: string }) {
await this.openRowActionMenu({ email });
await this.rootPage.locator('[data-testid="nc-super-user-delete"]:visible').click();
await this.rootPage.locator('.nc-menu-item:has-text("Remove user")').click();
await this.rootPage.locator('.ant-modal.active button:has-text("Delete User")').click();
await this.verifyToast({ message: 'User deleted successfully' });
}

Loading…
Cancel
Save