Browse Source

fix: Fixed issue with base share test

pull/6498/head
Muhammed Mustafa 1 year ago
parent
commit
355149e531
  1. 4
      tests/playwright/pages/Dashboard/common/LeftSidebar/index.ts
  2. 10
      tests/playwright/pages/Dashboard/common/WorkspaceMenu/index.ts
  3. 12
      tests/playwright/tests/db/features/baseShare.spec.ts
  4. 2
      tests/playwright/tests/db/features/verticalFillHandle.spec.ts

4
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);
}
}

10
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();

12
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 });

2
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' },

Loading…
Cancel
Save