new learning dashboard tests

This commit is contained in:
Gabriel Porfirio 2023-03-23 13:43:29 -03:00
parent 2dee62d5e3
commit e3e8f24c50
4 changed files with 56 additions and 6 deletions

View File

@ -452,7 +452,7 @@ exports.cameraDock = 'video[data-test="videoContainer"]';
// Font size
exports.increaseFontSize = 'button[data-test="increaseFontSize"]';
exports.descreaseFontSize = 'button[data-test="decreaseFontSize"]';
exports.decreaseFontSize = 'button[data-test="decreaseFontSize"]';
// Learning dashboard
exports.learningDashboard = 'li[data-test="learningDashboard"]';
@ -470,4 +470,11 @@ exports.pollYesNoQuestion = 'div[role="rowgroup"] div:nth-child(5) div';
exports.pollYesNoAnswer = 'div[role="cell"]:nth-child(5)';
exports.pollUserResponseQuestion = 'div[role="rowgroup"] div:nth-child(6) div';
exports.pollUserResponseAnswer = 'div[role="cell"]:nth-child(6)';
exports.pollTotal = 'div[role="cell"]:nth-child(2)';
exports.pollTotal = 'div[role="cell"]:nth-child(2)';
exports.meetingStatusActiveDashboard = 'span[data-test="meetingStatusActiveDashboard"]';
exports.meetingDurationTimeDashboard = 'p[data-test="meetingDurationTimeDashboard"]';
exports.userNameDashboard = 'tr:nth-child(2) td[data-test="userLabelDashboard"] button';
exports.userWebcamTimeDashboard = 'tr:nth-child(2) td[data-test="userWebcamTimeDashboard"]';
exports.userRaiseHandDashboard = 'tr:nth-child(2) td[data-test="userRaiseHandDashboard"]';
exports.userStatusDashboard = 'tr:nth-child(2) td[data-test="userStatusDashboard"]';
exports.activityScorePanelDashboard = 'button[data-test="activityScorePanelDashboard"]';

View File

@ -112,6 +112,41 @@ class LearningDashboard extends MultiUsers {
await this.dashboardPage.hasText(e.pollUserResponseQuestion, 'User response?');
await this.dashboardPage.hasText(e.pollUserResponseAnswer, e.answerMessage);
}
async basicInfos() {
// Meeting Status check
await this.dashboardPage.hasText(e.meetingStatusActiveDashboard, 'Active');
await this.dashboardPage.reloadPage();
// Meeting Time Duration check
const timeLocator = this.dashboardPage.getLocator(e.meetingDurationTimeDashboard);
const timeContent = await (timeLocator).textContent();
const array = timeContent.split(':').map(Number);
const firstTime = array[1] * 3600 + array[2] * 60 + array[3];
await sleep(5000);
await this.dashboardPage.reloadPage();
const timeContentGreater = await (timeLocator).textContent();
const arrayGreater = timeContentGreater.split(':').map(Number);
const secondTime = arrayGreater[1] * 3600 + arrayGreater[2] * 60 + arrayGreater[3];
await expect(secondTime).toBeGreaterThan(firstTime);
}
async overview() {
await this.modPage.waitAndClick(e.joinVideo);
await this.modPage.waitAndClick(e.startSharingWebcam);
await this.modPage.waitAndClick(e.raiseHandBtn);
// User Name check
await this.dashboardPage.hasText(e.userNameDashboard, /Moderator/);
// Webcam Time check
await this.dashboardPage.hasText(e.userWebcamTimeDashboard, /00/, ELEMENT_WAIT_EXTRA_LONG_TIME);
// Raise Hand check
await this.dashboardPage.hasText(e.userRaiseHandDashboard, '1');
// Activity Score check
await this.dashboardPage.hasText(e.activityScorePanelDashboard, /2/);
// Current Status check
await this.dashboardPage.hasText(e.userStatusDashboard, 'Online');
}
}
exports.LearningDashboard = LearningDashboard;

View File

@ -15,12 +15,20 @@ test.describe.serial('Learning Dashboard', async () => {
await learningDashboard.writeOnPublicChat();
});
test('Meeting Duration Time', async() => {
test('User Time On Meeting', async() => {
await learningDashboard.userTimeOnMeeting();
});
test('Polls', async ({ context })=> {
test('Polls', async ({ context }) => {
await learningDashboard.initUserPage(true, context);
await learningDashboard.polls();
});
test('Basic Infos', async () => {
await learningDashboard.basicInfos();
});
test('Overview', async () => {
await learningDashboard.overview();
});
});

View File

@ -135,8 +135,8 @@ class Options extends Page {
// Decreasing font size
await openSettings(this);
await this.waitAndClick(e.descreaseFontSize);
await this.waitAndClick(e.descreaseFontSize);
await this.waitAndClick(e.decreaseFontSize);
await this.waitAndClick(e.decreaseFontSize);
await this.waitAndClick(e.modalConfirmButton);
await this.fontSizeCheck(e.chatButton, '12px');