bigbluebutton-Github/bigbluebutton-html5/tests/puppeteer/virtualizedlist.obj.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

const VirtualizedList = require('./virtualizedlist/virtualize');
const { TEST_DURATION_TIME } = require('./core/constants');
2020-10-09 03:25:35 +08:00
const { toMatchImageSnapshot } = require('jest-image-snapshot');
expect.extend({ toMatchImageSnapshot });
const virtualizedListTest = () => {
test('Virtualized Users List', async () => {
const test = new VirtualizedList();
let response;
2020-10-09 03:25:35 +08:00
let screenshot;
try {
const testName = 'virtualizedUserList';
await test.page1.logger('begin of ', testName);
await test.init();
response = await test.test();
2020-10-09 03:25:35 +08:00
screenshot = await test.page1.page.screenshot();
await test.page1.logger('end of ', testName);
} catch (e) {
await test.page1.logger(e);
} finally {
await test.close();
}
expect(response).toBe(true);
2020-10-09 03:25:35 +08:00
if (process.env.REGRESSION_TESTING === 'true') {
expect(screenshot).toMatchImageSnapshot({
failureThreshold: 0.005,
failureThresholdType: 'percent',
});
}
}, parseInt(TEST_DURATION_TIME));
};
module.exports = exports = virtualizedListTest;