Browse Source

qrcode: playwright tests (WIP)

pull/4142/head
Daniel Spaude 2 years ago
parent
commit
991c79f03c
No known key found for this signature in database
GPG Key ID: 654A3D1FA4F35FFE
  1. 21
      tests/playwright/pages/Dashboard/common/Cell/index.ts
  2. 30
      tests/playwright/tests/columnQrCode.spec.ts

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

@ -92,27 +92,18 @@ export class CellPageObject extends BasePage {
expectedSrcValue: string;
}) {
console.log('FOOBAR!!!');
const _verify = async text => {
const _verify = async expectedQrCodeImgSrc => {
await expect
.poll(async () => {
const FOO = await this.get({
const qrCell = await this.get({
index,
columnHeader,
});
console.log('index: ', index);
console.log('columnHeader: ', columnHeader);
console.log('expectedSrcValue: ', expectedSrcValue);
const img = await FOO.getByRole('img');
console.log('img: ', img);
const src = await img.getAttribute('src');
console.log('src: ', src);
// const innerTexts = FOO.allInnerTexts();
// console.log('innerTexts', innerTexts);
console.log('--------------------------');
// return typeof innerTexts === 'string' ? [innerTexts] : innerTexts;
return src;
const qrImg = await qrCell.getByRole('img');
const qrImgSrc = await qrImg.getAttribute('src');
return qrImgSrc;
})
.toEqual(text);
.toEqual(expectedQrCodeImgSrc);
};
await _verify(expectedSrcValue);

30
tests/playwright/tests/columnQrCode.spec.ts

@ -72,15 +72,15 @@ test.describe('Virtual Columns', () => {
dashboard = new DashboardPage(page, context.project);
});
// async function qrCodeVerify(qrColumnTitle: string, expectedQrCodes: string[]) {
// for (let i = 0; i < expectedQrCodes.length; i++) {
// await dashboard.grid.cell.verifyQrCodeCell({
// index: i,
// columnHeader: qrColumnTitle,
// expectedSrcValue: expectedQrCodes[i],
// });
// }
// }
async function qrCodeVerify(qrColumnTitle: string, expectedQrCodes: string[]) {
for (let i = 0; i < expectedQrCodes.length; i++) {
await dashboard.grid.cell.verifyQrCodeCell({
index: i,
columnHeader: qrColumnTitle,
expectedSrcValue: expectedQrCodes[i],
});
}
}
test('QrCode', async () => {
// close 'Team & Auth' tab
@ -95,24 +95,22 @@ test.describe('Virtual Columns', () => {
qrCodeValueColumnTitle: 'City',
});
await dashboard.grid.cell.verifyQrCodeCell({
index: 0,
columnHeader: 'QrCode1',
expectedSrcValue: expectedQrCodeCellValues[0],
});
// expect
// .poll(async () => {
// const FOO = await this.get({
// index,
// columnHeader,
// });
// const FOO = await this.get({
// index,
// columnHeader,
// });
// for (let i = 1; i < expectedQrCodeCellValues.length; i++) {
// await qrCodeVerify('QrCode1', expectedQrCodeCellValues);
// await qrCodeVerify('QrCode1', expectedQrCodeCellValues);
// }
// verify different formula's

Loading…
Cancel
Save