From 54cc572b3b71e3ab844e318cef00455efe01f240 Mon Sep 17 00:00:00 2001 From: mayramelisa Date: Thu, 26 Sep 2024 17:02:06 -0400 Subject: [PATCH] funtion --- pages/execution.js | 8 ++++---- pages/process.js | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 4 deletions(-) diff --git a/pages/execution.js b/pages/execution.js index f5e195a..3e153ee 100644 --- a/pages/execution.js +++ b/pages/execution.js @@ -8680,9 +8680,7 @@ async actionsAndAssertionsOfTCP42332_4(taskName, process_id, subprocess_id, subp }) //Step 3: Export Process navHelper.navigateToProcessPage(); - var exportType = "basic"; - var passwordOption = "no"; - process.searchProcessAndSelectOptions(processName,"export", exportType, passwordOption); + process.exportProcessById(processName,"basic","no",[],IdProcess); navHelper.navigateToAdminPage(); //Step 4: Verify that the process was exported @@ -8728,11 +8726,13 @@ async actionsAndAssertionsOfTCP42332_4(taskName, process_id, subprocess_id, subp //Step 2: Export Process navHelper.navigateToProcessPage(); + var exportType = "basic"; var passwordOption = "yes"; var password = "12345678"; cy.reload(); - process.searchProcessAndSelectOptions(processName,"export", exportType, passwordOption, password); + process.searchProcessAndSelectOptions(processName,exportType, passwordOption, password); + navHelper.navigateToAdminPage(); //Step 3: Verify that the process was exported diff --git a/pages/process.js b/pages/process.js index c42984e..80f4af6 100644 --- a/pages/process.js +++ b/pages/process.js @@ -2312,4 +2312,46 @@ export class Process { } }); } + exportProcessById( + processName, + exportType = "basic", + passwordOption = "no", + password, + IdProcess + ) { + //this.selectMenuOptionRow("Export"); + cy.visit('processes/'+IdProcess+'/export'); + cy.xpath(selectors.menuSidebarXpath).should("be.visible"); + var process = processName + "."; + cy.xpath(selectors.exportTitleProcessXpath).should( + "have.text", + process + ); + if (exportType === "basic") { + //basic export + cy.xpath(selectors.downloadBtn).click(); + cy.xpath(selectors.exportTitleSetPasswordXpath).should( + "be.visible" + ); + if (passwordOption === "no") { + cy.xpath(selectors.passwordProtectFieldXpath).uncheck({ + force: true, + }); + } else { + cy.xpath(selectors.setPasswordFieldXpath).type(password, { + delay: 50, + }); + cy.xpath(selectors.confirmPasswordFieldXpath).type(password, { + delay: 50, + }); + } + cy.xpath(selectors.exportBtnXpath).click(); + cy.xpath(selectors.messageExportSuccessfulXpath).should( + "be.visible" + ); + cy.xpath(selectors.exportCloseBtnXpath).click(); + } else { + //custom export + } + } }