diff --git a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts index 36cb8b5e65..d574e48f0c 100644 --- a/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts +++ b/tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts @@ -88,6 +88,8 @@ export class LeftSidebarPage extends BasePage { await this.clickWorkspace(); const nodes = this.modal_workspace.locator('[data-testid="nc-workspace-list"]'); + await this.rootPage.waitForTimeout(2000); + for (let i = 0; i < (await nodes.count()); i++) { const text = await getTextExcludeIconText(nodes.nth(i)); if (text.toLowerCase() === param.title.toLowerCase()) { @@ -96,5 +98,7 @@ export class LeftSidebarPage extends BasePage { } } await this.rootPage.keyboard.press('Escape'); + + await this.rootPage.waitForTimeout(3500); } } diff --git a/tests/playwright/pages/Dashboard/common/WorkspaceMenu/index.ts b/tests/playwright/pages/Dashboard/common/WorkspaceMenu/index.ts index e294dcfb47..025e4a4d07 100644 --- a/tests/playwright/pages/Dashboard/common/WorkspaceMenu/index.ts +++ b/tests/playwright/pages/Dashboard/common/WorkspaceMenu/index.ts @@ -17,6 +17,16 @@ export class WorkspaceMenuObject extends BasePage { await this.rootPage.locator('[data-testid="nc-workspace-menu"]').click(); } + async switchWorkspace({ workspaceTitle }: { workspaceTitle: string }) { + await this.toggle(); + await this.rootPage.waitForTimeout(2500); + await this.rootPage.getByTestId('nc-workspace-list').getByText(workspaceTitle).click({ + force: true, + }); + await this.rootPage.keyboard.press('Escape'); + await this.rootPage.waitForTimeout(4000); + } + async click({ menu, subMenu }: { menu: string; subMenu: string }) { const pMenu = this.rootPage.locator(`.nc-dropdown-workspace-menu:visible`); await pMenu.locator(`div.nc-workspace-menu-item:has-text("${menu}"):visible`).click(); diff --git a/tests/playwright/tests/db/features/baseShare.spec.ts b/tests/playwright/tests/db/features/baseShare.spec.ts index 713f168810..5c5d997c43 100644 --- a/tests/playwright/tests/db/features/baseShare.spec.ts +++ b/tests/playwright/tests/db/features/baseShare.spec.ts @@ -1,6 +1,6 @@ import { test } from '@playwright/test'; import { DashboardPage } from '../../../pages/Dashboard'; -import setup, { unsetup } from '../../../setup'; +import setup, { NcContext, unsetup } from '../../../setup'; import { ToolbarPage } from '../../../pages/Dashboard/common/Toolbar'; import { LoginPage } from '../../../pages/LoginPage'; import { getDefaultPwd } from '../../../tests/utils/general'; @@ -9,7 +9,7 @@ import { getDefaultPwd } from '../../../tests/utils/general'; test.describe('Shared base', () => { let dashboard: DashboardPage; let toolbar: ToolbarPage; - let context: any; + let context: NcContext; let loginPage: LoginPage; async function roleTest(role: string) { @@ -83,7 +83,13 @@ test.describe('Shared base', () => { withoutPrefix: true, }); - // await dashboard.treeView.openProject({ title: context.project.title }); + await dashboard.rootPage.waitForTimeout(1000); + + await dashboard.grid.workspaceMenu.switchWorkspace({ + workspaceTitle: context.workspace.title, + }); + + await dashboard.treeView.openProject({ title: context.project.title, context }); await dashboard.treeView.openTable({ title: 'Country' }); url = await dashboard.grid.topbar.getSharedBaseUrl({ role: 'viewer', enableSharedBase: false }); diff --git a/tests/playwright/tests/db/features/verticalFillHandle.spec.ts b/tests/playwright/tests/db/features/verticalFillHandle.spec.ts index ecb2825ca7..020e386f26 100644 --- a/tests/playwright/tests/db/features/verticalFillHandle.spec.ts +++ b/tests/playwright/tests/db/features/verticalFillHandle.spec.ts @@ -212,7 +212,7 @@ test.describe('Fill Handle', () => { await unsetup(p.context); }); - test('Miscellaneous (Checkbox, attachment) @flaky', async () => { + test('Miscellaneous (Checkbox, attachment)', async () => { const fields = [ { title: 'Checkbox', value: 'true', type: 'checkbox' }, { title: 'Attachment', value: `${process.cwd()}/fixtures/sampleFiles/1.json`, type: 'attachment' },