From 582fa592e471a2df3d997f869c9775b9a3450efc Mon Sep 17 00:00:00 2001 From: PaolaPellegrini <51709910+PaolaPellegrini@users.noreply.github.com> Date: Fri, 3 May 2024 12:55:55 -0400 Subject: [PATCH] new method for screen template --- pages/screenTemplate.js | 13 ++++++++++--- selectors/screenTemplate.js | 5 +++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/pages/screenTemplate.js b/pages/screenTemplate.js index 5937517..4d68792 100644 --- a/pages/screenTemplate.js +++ b/pages/screenTemplate.js @@ -92,6 +92,7 @@ export class ScreenTemplate { clickOnSave() { cy.xpath(selectors.saveCreateScreenTemplate).should("be.visible").click(); + } searchScreenTemplate(nameScreenTemplate) { @@ -370,9 +371,8 @@ createScreenFromTemplate(name, description, type, typeScreenTemplate, nameTempla this.selectTypeScreen(type); this.selectTypeTemplate(typeScreenTemplate); this.selectTemplate(nameTemplate); - this.clickOnSave(); - cy.get(Selectors.savePublishVersionsBtn).should('be.visible'); - + this.previewTemplate(nameTemplate); + } clickOnAddScreen() { @@ -450,6 +450,13 @@ selectTemplate(nameTemplate) { cy.get(selectors.selectScreenTemplate.replace('CustomCard',nameTemplate+'-card')).click({force:true}); } +previewTemplate(nameTemplate) { + + cy.get(selectors.previewTemplate.replace('CustomCard',nameTemplate+'-card')).click({force:true}); + cy.get(selectors.buttonViewCSS).should('be.visible').click(); + +} + clickOnSave() { diff --git a/selectors/screenTemplate.js b/selectors/screenTemplate.js index 32d604e..30029f6 100644 --- a/selectors/screenTemplate.js +++ b/selectors/screenTemplate.js @@ -49,6 +49,7 @@ export default { sharedTemplateType: '[data-cy="type-container-Shared Templates"]', myTemplateType: '[data-cy="type-container-My Templates"]', selectScreenTemplate:'[data-cy="CustomCard"] input', - - + previewTemplate: '[data-cy="CustomCard"] a', + buttonViewCSS:'[class="btn text-uppercase btn-outline-secondary"]', + } \ No newline at end of file