improving smart slides test

This commit is contained in:
Gabriel Porfirio 2023-05-25 12:58:44 -03:00
parent ad4521eae7
commit 5cf186f28b
3 changed files with 33 additions and 1 deletions

View File

@ -256,6 +256,10 @@ exports.firstPollAnswerOptionBtn = `${pollAnswersOption}>>nth=0`;
exports.secondPollAnswerOptionBtn = `${pollAnswersOption}>>nth=1`;
exports.firstCheckboxInput = `${pollAnswersOption}`;
exports.closePollingBtn = 'button[data-test="closePolling"]';
exports.yesNoOption = 'button[data-test="yesNoQuickPoll"]';
exports.yesNoAbstentionOption = 'li[role="menuitem"]>>nth=1';
exports.pollAnswerOptionE = 'button[data-test="pollAnswerOption"]>>nth=4';
exports.answerE = 'div[data-test="numberOfVotes"]>>nth=4';
// Presentation
exports.currentSlideImg = 'img[id="slide-background-shape_image"]';
exports.uploadPresentationFileName = 'uploadTest.png';

View File

@ -184,6 +184,7 @@ class Polling extends MultiUsers {
await utilPresentation.uploadSinglePresentation(this.modPage, e.smartSlides1, ELEMENT_WAIT_LONGER_TIME);
await this.userPage.hasElement(e.currentUser);
// Type Response
await this.modPage.waitAndClick(e.quickPoll);
await this.userPage.hasElement(e.responsePollQuestion);
await this.userPage.type(e.pollAnswerOptionInput, 'test');
@ -195,19 +196,46 @@ class Polling extends MultiUsers {
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
// Multiple Choices
await this.modPage.waitAndClick(e.nextSlide);
await this.modPage.waitAndClick(e.quickPoll);
await this.userPage.waitAndClick(e.firstPollAnswerDescOption);
await this.userPage.waitAndClick(e.secondPollAnswerDescOption);
await this.userPage.waitAndClick(e.submitAnswersMultiple);
await this.modPage.hasText(e.answer1, '1');
await this.modPage.hasText(e.answer2, '1');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
// One option answer
await this.modPage.waitAndClick(e.nextSlide);
await this.modPage.waitAndClick(e.quickPoll);
await this.userPage.waitAndClick(e.pollAnswerOptionE);
await this.modPage.hasText(e.answerE, '1');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
// Yes/No/Abstention
await this.modPage.waitAndClick(e.nextSlide);
await this.modPage.waitAndClick(e.yesNoOption);
await this.modPage.waitAndClick(e.yesNoAbstentionOption)
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.hasText(e.answer1, '1');
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.waitAndClick(e.closePollingBtn);
await this.modPage.wasRemoved(e.closePollingBtn);
// True/False
await this.modPage.waitAndClick(e.nextSlide);
await this.modPage.waitAndClick(e.quickPoll);
await this.userPage.waitAndClick(e.pollAnswerOptionBtn);
await this.modPage.waitAndClick(e.publishPollingLabel);
await this.modPage.hasText(e.answer1, '1');
await this.modPage.hasElementDisabled(e.nextSlide);
await this.modPage.waitAndClick(e.closePollingBtn);