diff --git a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts b/tests/playwright/pages/Dashboard/ViewSidebar/index.ts index 0823c8763d..4cc1f9e445 100644 --- a/tests/playwright/pages/Dashboard/ViewSidebar/index.ts +++ b/tests/playwright/pages/Dashboard/ViewSidebar/index.ts @@ -86,6 +86,13 @@ export class ViewSidebarPage extends BasePage { // Todo: Make selection better async verifyView({ title, index }: { title: string; index: number }) { + // flicker while page loading + await this.get() + .locator('[data-testid="view-item"]') + .nth(index) + .locator('[data-testid="truncate-label"]') + .waitFor({ state: 'visible' }); + await expect( this.get().locator('[data-testid="view-item"]').nth(index).locator('[data-testid="truncate-label"]') ).toHaveText(title, { ignoreCase: true }); diff --git a/tests/playwright/pages/Dashboard/common/Toolbar/ShareView.ts b/tests/playwright/pages/Dashboard/common/Toolbar/ShareView.ts index 819990b2b7..816d0e6538 100644 --- a/tests/playwright/pages/Dashboard/common/Toolbar/ShareView.ts +++ b/tests/playwright/pages/Dashboard/common/Toolbar/ShareView.ts @@ -1,5 +1,6 @@ import BasePage from '../../../Base'; import { ToolbarPage } from './index'; +import { getTextExcludeIconText } from '../../../../tests/utils/general'; export class ToolbarShareViewPage extends BasePage { readonly toolbar: ToolbarPage; @@ -29,8 +30,9 @@ export class ToolbarShareViewPage extends BasePage { } async getShareLink() { - // http://localhost:3000/#/nc/view/35231cff-05c5-49ab-9045-f410db79ba5a - return (await this.get().locator(`[data-testid="nc-modal-share-view__link"]`).innerText()).slice(0, 68); + const locator = this.get().locator(`[data-testid="nc-modal-share-view__link"]`); + const linkText = getTextExcludeIconText(locator); + return linkText; } async close() {