Browse Source

test: response validation corrections for numerical types

Signed-off-by: Raju Udava <86527202+dstala@users.noreply.github.com>
pull/5332/head
Raju Udava 2 years ago committed by mertmit
parent
commit
81d52056c3
  1. 6
      tests/playwright/pages/Dashboard/Grid/index.ts

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

@ -87,7 +87,8 @@ export class GridPage extends BasePage {
uiAction: clickOnColumnHeaderToSave, uiAction: clickOnColumnHeaderToSave,
requestUrlPathToMatch: 'api/v1/db/data/noco', requestUrlPathToMatch: 'api/v1/db/data/noco',
httpMethodsToMatch: ['POST'], httpMethodsToMatch: ['POST'],
responseJsonMatcher: resJson => resJson?.[columnHeader] === rowValue, // numerical types are returned in number format from the server
responseJsonMatcher: resJson => String(resJson?.[columnHeader]) === String(rowValue),
}); });
} else { } else {
await clickOnColumnHeaderToSave(); await clickOnColumnHeaderToSave();
@ -122,7 +123,8 @@ export class GridPage extends BasePage {
// since edit row on an empty row will emit POST request // since edit row on an empty row will emit POST request
'POST', 'POST',
], ],
responseJsonMatcher: resJson => resJson?.[columnHeader] === value, // numerical types are returned in number format from the server
responseJsonMatcher: resJson => String(resJson?.[columnHeader]) === String(value),
}); });
} else { } else {
await clickOnColumnHeaderToSave(); await clickOnColumnHeaderToSave();

Loading…
Cancel
Save