bigbluebutton-Github/bigbluebutton-tests/puppeteer/sharednotes.obj.js

39 lines
1.3 KiB
JavaScript
Raw Normal View History

const SharedNotes = require('./notes/sharednotes');
2020-10-09 03:25:35 +08:00
const { toMatchImageSnapshot } = require('jest-image-snapshot');
const { MAX_SHARED_NOTES_TEST_TIMEOUT } = require('./core/constants'); // core constants (Timeouts vars imported)
2020-10-09 03:25:35 +08:00
expect.extend({ toMatchImageSnapshot });
const sharedNotesTest = () => {
beforeEach(() => {
jest.setTimeout(MAX_SHARED_NOTES_TEST_TIMEOUT);
});
test('Open Shared notes', async () => {
const test = new SharedNotes();
let response;
2020-10-09 03:25:35 +08:00
let screenshot;
try {
const testName = 'openSharedNotes';
await test.page1.logger('begin of ', testName);
await test.init(undefined, testName);
await test.page1.startRecording(testName);
await test.page1.closeAudioModal();
await test.page2.startRecording(testName);
await test.page2.closeAudioModal();
response = await test.test();
await test.page1.logger('end of ', testName);
await test.page1.stopRecording();
await test.page2.stopRecording();
2020-10-09 03:25:35 +08:00
screenshot = await test.page1.page.screenshot();
} catch (e) {
await test.page1.logger(e);
} finally {
await test.close();
}
expect(response).toBe(true);
await Page.checkRegression(0.1, screenshot);
});
};
module.exports = exports = sharedNotesTest;