Skip to content

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

fix(pw): sso test fail issue

Ramesh Mane8bfc3e294762
diff --git a/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue b/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue
index e61a2c80e9..fac13917f4 100644
--- a/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue
+++ b/packages/nc-gui/components/dashboard/Sidebar/UserInfo.vue
@@ -104,6 +104,7 @@ const accountUrl = computed(() => {
'nc-mini-sidebar-ws-item !w-[var(--mini-sidebar-width)] flex-none': isMiniSidebar,
}"
data-testid="nc-sidebar-userinfo"
+ :data-email="user?.email"
>
<div
v-if="isMiniSidebar"
@@ -132,7 +133,7 @@ const accountUrl = computed(() => {
</div>
</NcTooltip>
<template #overlay>
- <NcMenu data-testid="nc-sidebar-userinfo" variant="medium">
+ <NcMenu variant="medium">
<NcMenuItem data-testid="nc-sidebar-user-logout" @click="logout">
<div v-e="['c:user:logout']" class="flex gap-2 items-center min-w-40 md:min-w-70">
<GeneralLoader v-if="isLoggingOut" class="!ml-0.5 !mr-0.5 !max-h-4.5 !-mt-0.5" />
diff --git a/packages/nc-gui/components/dashboard/topbar/UserInfo.vue b/packages/nc-gui/components/dashboard/topbar/UserInfo.vue
index 1f37052f1b..58c238feab 100644
--- a/packages/nc-gui/components/dashboard/topbar/UserInfo.vue
+++ b/packages/nc-gui/components/dashboard/topbar/UserInfo.vue
@@ -72,10 +72,9 @@ const accountUrl = computed(() => {
<GeneralUserIcon :user="user" size="medium" class="!w-full !h-full !min-w-full cursor-pointer" />
</div>
<template #overlay>
- <NcMenu data-testid="nc-sidebar-userinfo" variant="small">
+ <NcMenu variant="small">
<div
class="flex flex-col justify-center py-1 px-3 gap-x-2 text-gray-700 rounded-lg min-h-8 text-small leading-[18px]"
- data-testid="nc-sidebar-userinfo"
>
<div v-if="name?.trim()" class="capitalize text-nc-content-gray font-bold">
{{ name }}
diff --git a/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts b/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts
index cc4d4a9223..b52c954964 100644
--- a/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts
+++ b/tests/playwright/pages/OrgAdmin/OpenIDLoginPage.ts
@@ -41,6 +41,6 @@ export class CloudOpenIDLoginPage extends BasePage {
authorize.locator(`[type="submit"]`).click(),
]);
- await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"]:has-text("${email.split('@')[0]}")`).waitFor();
+ await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"][data-email^="${email.split('@')[0]}"]`).waitFor();
}
}
diff --git a/tests/playwright/pages/OrgAdmin/SAMLLoginPage.ts b/tests/playwright/pages/OrgAdmin/SAMLLoginPage.ts
index 77d5a7a725..3171b2418a 100644
--- a/tests/playwright/pages/OrgAdmin/SAMLLoginPage.ts
+++ b/tests/playwright/pages/OrgAdmin/SAMLLoginPage.ts
@@ -40,6 +40,6 @@ export class CloudSAMLLoginPage extends BasePage {
signIn.locator(`#btn-sign-in`).click(),
]);
- await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"]:has-text("${email.split('@')[0]}")`).waitFor();
+ await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"][data-email^="${email.split('@')[0]}"]`).waitFor();
}
}
diff --git a/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts b/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts
index 299600be10..371203540b 100644
--- a/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts
+++ b/tests/playwright/pages/OrgAdmin/SSOLoginPage.ts
@@ -32,6 +32,6 @@ export class CloudSSOLoginPage extends BasePage {
signIn.getByTestId('nc-form-signin__submit').click(),
]);
- await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"]:has-text("${email.split('@')[0]}")`);
+ await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"][data-email^="${email.split('@')[0]}"]`).waitFor();
}
}
diff --git a/tests/playwright/pages/SsoIdpPage/OpenIDLoginPage.ts b/tests/playwright/pages/SsoIdpPage/OpenIDLoginPage.ts
index a118dd15aa..d5f8c5b857 100644
--- a/tests/playwright/pages/SsoIdpPage/OpenIDLoginPage.ts
+++ b/tests/playwright/pages/SsoIdpPage/OpenIDLoginPage.ts
@@ -36,6 +36,6 @@ export class OpenIDLoginPage extends BasePage {
authorize.locator(`[type="submit"]`).click(),
]);
- await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"]:has-text("${email.split('@')[0]}")`);
+ await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"][data-email^="${email.split('@')[0]}"]`).waitFor();
}
}
diff --git a/tests/playwright/pages/SsoIdpPage/SAMLLoginPage.ts b/tests/playwright/pages/SsoIdpPage/SAMLLoginPage.ts
index 3d198f8739..d4bb2bdbac 100644
--- a/tests/playwright/pages/SsoIdpPage/SAMLLoginPage.ts
+++ b/tests/playwright/pages/SsoIdpPage/SAMLLoginPage.ts
@@ -33,6 +33,6 @@ export class SAMLLoginPage extends BasePage {
signIn.locator(`#btn-sign-in`).click(),
]);
- await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"]:has-text("${email.split('@')[0]}")`);
+ await this.rootPage.locator(`[data-testid="nc-sidebar-userinfo"][data-email^="${email.split('@')[0]}"]`).waitFor();
}
}