Browse Source

fix: Fixed test

pull/6922/head
Muhammed Mustafa 10 months ago
parent
commit
84fc98987a
  1. 8
      tests/playwright/pages/Dashboard/common/Cell/index.ts

8
tests/playwright/pages/Dashboard/common/Cell/index.ts

@ -381,25 +381,25 @@ export class CellPageObject extends BasePage {
async verifyRoleAccess(param: { role: string }) { async verifyRoleAccess(param: { role: string }) {
const role = param.role.toLowerCase(); const role = param.role.toLowerCase();
const count = role === 'creator' || role === 'editor' || role === 'owner' ? 1 : 0; const isEditAccess = role === 'creator' || role === 'editor' || role === 'owner';
// normal text cell // normal text cell
const cell = this.get({ index: 0, columnHeader: 'Country' }); const cell = this.get({ index: 0, columnHeader: 'Country' });
// editable cell // editable cell
await cell.dblclick(); await cell.dblclick();
await expect(cell.locator(`input`)).toHaveCount(count); await expect(cell.locator(`input`)).toHaveCount(isEditAccess ? 1 : 0);
// press escape to close the input // press escape to close the input
await cell.press('Escape'); await cell.press('Escape');
await cell.press('Escape'); await cell.press('Escape');
await cell.click({ button: 'right', clickCount: 1 }); await cell.click({ button: 'right', clickCount: 1 });
await expect(this.rootPage.locator(`.nc-dropdown-grid-context-menu:visible`)).toHaveCount(count); await expect(this.rootPage.locator(`.nc-dropdown-grid-context-menu:visible`)).toHaveCount(1);
// virtual cell // virtual cell
const vCell = this.get({ index: 0, columnHeader: 'Cities' }); const vCell = this.get({ index: 0, columnHeader: 'Cities' });
await vCell.hover(); await vCell.hover();
// in-cell add // in-cell add
await expect(vCell.locator('.nc-action-icon.nc-plus:visible')).toHaveCount(count); await expect(vCell.locator('.nc-action-icon.nc-plus:visible')).toHaveCount(isEditAccess ? 1 : 0);
// virtual cell link text // virtual cell link text
const linkText = await getTextExcludeIconText(vCell); const linkText = await getTextExcludeIconText(vCell);

Loading…
Cancel
Save