add Polling test: Poll results in whiteboard

This commit is contained in:
Anton 2021-10-20 14:39:36 -03:00
parent 9d0b07b3b2
commit 22ecd395eb
2 changed files with 39 additions and 0 deletions

View File

@ -52,6 +52,22 @@ class Polling {
}
}
async pollResultsOnWhiteboard(testName) {
try {
await this.modPage.waitForSelector(e.whiteboard);
await this.modPage.screenshot(testName, '01-before-start-poll');
await util.startPoll(this.modPage, true);
// Check poll result on whiteboard
const resp = await this.modPage.hasElement(e.pollResults);
return resp === true;
} catch (err) {
await this.modPage.logger(err);
return false;
}
}
async randomPoll(testName) {
try {
await this.modPage.startRecording(testName);

View File

@ -57,6 +57,29 @@ const pollingTest = () => {
Page.checkRegression(0.9, screenshot);
}, TEST_DURATION_TIME);
// Check for Poll Results in whiteboard and return true when it appears
test('Poll results in whiteboard', async () => {
const test = new Poll();
let response;
let screenshot;
try {
const testName = 'pollResultsInWhiteboard';
await test.modPage.logger('begin of ', testName);
await test.initModPage(true, testName);
await test.modPage.startRecording(testName);
response = await test.pollResultsOnWhiteboard(testName);
await test.modPage.logger('end of ', testName);
await test.modPage.stopRecording();
screenshot = await test.modPage.page.screenshot();
} catch (err) {
await test.modPage.logger(err);
} finally {
await test.modPage.close();
}
expect(response).toBe(true);
Page.checkRegression(0.9, screenshot);
}, TEST_DURATION_TIME);
// This Test chooses randomly a polling case, runs it
// and expects having it answered by the other user
test('Random Poll', async () => {