Browse Source

Merge pull request #5674 from nocodb/test/kludge-undo-redo

test: remove PW flakyness - undo-redo, attachment, select column
pull/5683/head
Raju Udava 2 years ago committed by GitHub
parent
commit
8266c3a903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts
  2. 1
      tests/playwright/pages/Dashboard/common/Toolbar/index.ts
  3. 4
      tests/playwright/tests/db/undo-redo.spec.ts

14
tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts

@ -118,7 +118,7 @@ export class SelectOptionCellPageObject extends BasePage {
index,
columnHeader,
option,
multiSelect,
multiSelect = false,
}: {
index: number;
columnHeader: string;
@ -134,10 +134,18 @@ export class SelectOptionCellPageObject extends BasePage {
await selectCell.locator('.ant-select-selection-search-input').type(option);
await selectCell.locator('.ant-select-selection-search-input').press('Enter');
// await selectCell.locator('.ant-select-selection-search-input').press('Enter');
// Wait for update api call
const saveRowAction = () => selectCell.locator('.ant-select-selection-search-input').press('Enter');
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['PATCH'],
responseJsonMatcher: resJson => String(resJson?.[columnHeader]).includes(String(option)),
});
if (multiSelect) await selectCell.locator('.ant-select-selection-search-input').press('Escape');
// todo: wait for update api call
}
async verifySelectedOptions({

1
tests/playwright/pages/Dashboard/common/Toolbar/index.ts

@ -66,6 +66,7 @@ export class ToolbarPage extends BasePage {
// Wait for the menu to close
if (menuOpen) await this.fields.get().waitFor({ state: 'hidden' });
else await this.fields.get().waitFor({ state: 'visible' });
}
async clickFindRowByScanButton() {

4
tests/playwright/tests/db/undo-redo.spec.ts

@ -178,6 +178,10 @@ test.describe('Undo Redo', () => {
await dashboard.closeTab({ title: 'Team & Auth' });
await dashboard.treeView.openTable({ title: 'numberBased' });
// hack: wait for grid to load
// https://github.com/nocodb/nocodb/actions/runs/5025773509/jobs/9013176970
await page.waitForTimeout(1000);
await verifyFieldsOrder(['Number', 'Decimal', 'Currency']);
// Hide Decimal

Loading…
Cancel
Save