Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(pw): Cloud - OpenID Auth Flow test fail issue

Ramesh Manef435face3c56
diff --git a/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts b/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts
index aa1e9e37d3..228a93bceb 100644
--- a/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts
+++ b/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts
@@ -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
diff --git a/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts b/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts
index 9963c5737d..c6226b20f7 100644
--- a/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts
+++ b/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts
@@ -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);
+ }
}
}