created selectSlide function

This commit is contained in:
Gabriel Porfirio 2023-04-24 13:33:00 -03:00
parent a6b374e285
commit 84c2a6173c
2 changed files with 7 additions and 3 deletions

View File

@ -345,6 +345,10 @@ class Page {
async reloadPage() {
await this.page.reload();
}
async selectSlide(slideOption, timeout = ELEMENT_WAIT_TIME) {
await this.page.locator(e.skipSlide).selectOption({ label: slideOption }, { timeout });
}
}
module.exports = exports = Page;

View File

@ -277,13 +277,13 @@ class Presentation extends MultiUsers {
maxDiffPixelRatio: 0.05,
};
await this.modPage.getLocator(e.skipSlide).selectOption('Slide 10');
await this.modPage.selectSlide('Slide 10');
await expect(wbBox).toHaveScreenshot('moderator1-select-slide10.png', screenshotOptions);
await this.modPage.getLocator(e.skipSlide).selectOption('Slide 5');
await this.modPage.selectSlide('Slide 5');
await expect(wbBox).toHaveScreenshot('moderator1-select-slide5.png', screenshotOptions);
await this.modPage.getLocator(e.skipSlide).selectOption('Slide 13');
await this.modPage.selectSlide('Slide 13');
await expect(wbBox).toHaveScreenshot('moderator1-select-slide13.png', screenshotOptions);
}
}