Browse Source

refactor: path correction

pull/6644/head
Pranav C 1 year ago
parent
commit
4b64d3d2fd
  1. 2
      tests/playwright/pages/Dashboard/BulkUpdate/index.ts
  2. 4
      tests/playwright/pages/Dashboard/ExpandedForm/index.ts
  3. 2
      tests/playwright/pages/Dashboard/Grid/Column/index.ts
  4. 4
      tests/playwright/pages/Dashboard/Grid/index.ts
  5. 2
      tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts
  6. 2
      tests/playwright/pages/Dashboard/common/Cell/SelectOptionCell.ts

2
tests/playwright/pages/Dashboard/BulkUpdate/index.ts

@ -181,7 +181,7 @@ export class BulkUpdatePage extends BasePage {
} else {
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'],
});

4
tests/playwright/pages/Dashboard/ExpandedForm/index.ts

@ -113,14 +113,14 @@ export class ExpandedFormPage extends BasePage {
if (waitForRowsData) {
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'],
});
} else {
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['POST'],
});
}

2
tests/playwright/pages/Dashboard/Grid/Column/index.ts

@ -347,7 +347,7 @@ export class ColumnPageObject extends BasePage {
async save({ isUpdated }: { isUpdated?: boolean } = {}) {
await this.waitForResponse({
uiAction: async () => await this.get().locator('button:has-text("Save")').click(),
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['GET'],
responseJsonMatcher: json => json['pageInfo'],
});

4
tests/playwright/pages/Dashboard/Grid/index.ts

@ -134,7 +134,7 @@ export class GridPage extends BasePage {
if (networkValidation) {
await this.waitForResponse({
uiAction: clickOnColumnHeaderToSave,
requestUrlPathToMatch: 'api/v1/data/noco',
requestUrlPathToMatch: 'api/v1/db/data/noco',
httpMethodsToMatch: ['POST'],
// numerical types are returned in number format from the server
responseJsonMatcher: resJson => String(resJson?.[columnHeader]) === String(rowValue),
@ -166,7 +166,7 @@ export class GridPage extends BasePage {
if (networkValidation) {
await this.waitForResponse({
uiAction: clickOnColumnHeaderToSave,
requestUrlPathToMatch: 'api/v1/data/noco',
requestUrlPathToMatch: 'api/v1/db/data/noco',
httpMethodsToMatch: [
'PATCH',
// since edit row on an empty row will emit POST request

2
tests/playwright/pages/Dashboard/common/Cell/RatingCell.ts

@ -19,7 +19,7 @@ export class RatingCellPageObject extends BasePage {
await this.waitForResponse({
uiAction: async () => await this.get({ index, columnHeader }).locator('.ant-rate-star > div').nth(rating).click(),
httpMethodsToMatch: ['POST', 'PATCH'],
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
});
}

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

@ -159,7 +159,7 @@ export class SelectOptionCellPageObject extends BasePage {
const saveRowAction = () => selectCell.locator('.ant-select-selection-search-input').press('Enter');
await this.waitForResponse({
uiAction: saveRowAction,
requestUrlPathToMatch: 'api/v1/data/noco/',
requestUrlPathToMatch: 'api/v1/db/data/noco/',
httpMethodsToMatch: ['PATCH'],
responseJsonMatcher: resJson => String(resJson?.[columnHeader]).includes(String(option)),
});

Loading…
Cancel
Save