mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-24 23:25:21 +00:00
fix(pw): Cloud - OpenID Auth Flow test fail issue
This commit is contained in:
@@ -15,7 +15,7 @@ export class CloudOpenIDLoginPage extends BasePage {
|
||||
|
||||
async goto(_title = 'test', email: string) {
|
||||
await this.ssoLoginPage.goto(email);
|
||||
await this.ssoLoginPage.signIn({ email });
|
||||
await this.ssoLoginPage.signIn({ email, waitForUserInfoMenu: false });
|
||||
// // reload page to get latest app info
|
||||
// await this.rootPage.reload({ waitUntil: 'networkidle' });
|
||||
// // click sign in with SAML
|
||||
|
||||
@@ -21,7 +21,7 @@ export class CloudSSOLoginPage extends BasePage {
|
||||
return this.rootPage.locator('html');
|
||||
}
|
||||
|
||||
async signIn({ email }: { email: string }) {
|
||||
async signIn({ email, waitForUserInfoMenu = true }: { email: string; waitForUserInfoMenu?: boolean }) {
|
||||
const signIn = this.get();
|
||||
await signIn.locator('[data-testid="nc-form-org-sso-signin__email"]').waitFor();
|
||||
|
||||
@@ -32,9 +32,12 @@ export class CloudSSOLoginPage extends BasePage {
|
||||
signIn.getByTestId('nc-form-signin__submit').click(),
|
||||
]);
|
||||
|
||||
const userInfoMenu = this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"]`);
|
||||
await userInfoMenu.waitFor();
|
||||
// If it is cloud auth login flow then we first login sso and then redirect to localhost:4000 and there we need to login again
|
||||
if (waitForUserInfoMenu) {
|
||||
const userInfoMenu = this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"]`);
|
||||
await userInfoMenu.waitFor();
|
||||
|
||||
await expect(userInfoMenu).toHaveAttribute('data-email', email);
|
||||
await expect(userInfoMenu).toHaveAttribute('data-email', email);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user