From 1e98180fa971d70420e198d8e287421950fa08d8 Mon Sep 17 00:00:00 2001 From: WendyFPM Date: Thu, 2 May 2024 09:49:47 -0400 Subject: [PATCH] MethodsAndSelectorsProcessTesting --- pages/processTesting.js | 24 ++++++++--------- selectors/processTesting.js | 52 ++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/pages/processTesting.js b/pages/processTesting.js index 2027bae..7c529c2 100644 --- a/pages/processTesting.js +++ b/pages/processTesting.js @@ -58,10 +58,10 @@ export class ProcessTesting { cy.wait(1000); cy.iframe(iframeSelector).xpath(selectors.labelScenario).should('be.visible'); cy.iframe(iframeSelector).xpath(selectors.containerScenario).click(); - cy.iframe(iframeSelector).xpath(selectors.inputScenario).should('be.visible'); - cy.iframe(iframeSelector).xpath(selectors.inputScenario).click().type(scenario, { force: true, delay: 70 }); + cy.iframe(iframeSelector).find(selectors.inputScenario).should('be.visible'); + cy.iframe(iframeSelector).find(selectors.inputScenario).click().type(scenario, { force: true, delay: 70 }); cy.wait(1000) - cy.iframe(iframeSelector).xpath(selectors.inputScenario).type('{enter}'); + cy.iframe(iframeSelector).find(selectors.inputScenario).type('{enter}'); } //Additional Data from Modeler @@ -478,15 +478,15 @@ export class ProcessTesting { cy.wait(1000); cy.xpath(selectors.labelScenario).should('be.visible'); cy.xpath(selectors.containerScenario).click(); - cy.xpath(selectors.inputScenario).should('be.visible'); - cy.xpath(selectors.inputScenario).click().type(scenario, { force: true, delay: 70 }); + cy.get(selectors.inputScenario).should('be.visible'); + cy.get(selectors.inputScenario).click().type(scenario, { force: true, delay: 70 }); cy.wait(1000) - cy.xpath(selectors.inputScenario).type('{enter}'); + cy.get(selectors.inputScenario).type('{enter}'); } selectAllScenarios(nameToFilter) { cy.xpath(selectors.containerScenario).click(); - cy.xpath(selectors.inputScenario).click().type(nameToFilter).should('have.value', nameToFilter); + cy.get(selectors.inputScenario).click().type(nameToFilter).should('have.value', nameToFilter); cy.get('[aria-label="-- Select All --. "]').click(); } @@ -584,12 +584,12 @@ export class ProcessTesting { cy.wait(2000); cy.xpath(selectors.rowTestsRun).find('td').invoke('text').then(($element) => { if ($element !== 'No Data Available') { - this.clickOnclearBtn(); - this.clickOnConfirmClearTests(); - } + this.clickOnclearBtn(); + this.clickOnConfirmClearTests(); + } else { - return; - } + return; + } }) } diff --git a/selectors/processTesting.js b/selectors/processTesting.js index da1c113..ed71253 100644 --- a/selectors/processTesting.js +++ b/selectors/processTesting.js @@ -1,35 +1,35 @@ -export default{ +export default { iframeA: '[id="alternative_a"]', iframeB: '[id="alternative_b"]', //FROM MODELER ellipsisMenuIcon: '//div[@data-cy="ellipsis-menu"]//button[@aria-haspopup="menu"]', - runTestBtnInModeler:'//div[@data-cy="ellipsis-menu"]//ul//li//*[contains(text(),"Run Test")]', + runTestBtnInModeler: '//div[@data-cy="ellipsis-menu"]//ul//li//*[contains(text(),"Run Test")]', //Alternative labelAlternative: '//label[text()="Alternative *"]', alternativeField: '[id="select-alternative"]', expressionInput: '[id="expression"]', typeOfRun: '[id="select-type-run"]', //Starting Point - labelSP:'//label[text()="Starting Point *"]', - containerSP:'//label[text()="Starting Point *"]/parent::div/div//div[@class="multiselect__tags"]', + labelSP: '//label[text()="Starting Point *"]', + containerSP: '//label[text()="Starting Point *"]/parent::div/div//div[@class="multiselect__tags"]', inputSP: '[id="select-step"]', - itemSP:'//label[text()="Starting Point *"]/parent::div//div[@class="multiselect__content-wrapper"]//li[1]', + itemSP: '//label[text()="Starting Point *"]/parent::div//div[@class="multiselect__content-wrapper"]//li[1]', //Manual Resume Point - labelMRP:'//label[text()="Manual Resume Point"]', - containerMRP:'//label[text()="Manual Resume Point"]/parent::div/div//div[@class="multiselect__tags"]', - inputMRP:'//label[text()="Manual Resume Point"]/parent::div//div//div[@class="multiselect__tags"]//input', - itemMRP:'//label[text()="Manual Resume Point"]/parent::div//div[@class="multiselect__content-wrapper"]//li[1]', + labelMRP: '//label[text()="Manual Resume Point"]', + containerMRP: '//label[text()="Manual Resume Point"]/parent::div/div//div[@class="multiselect__tags"]', + inputMRP: '//label[text()="Manual Resume Point"]/parent::div//div//div[@class="multiselect__tags"]//input', + itemMRP: '//label[text()="Manual Resume Point"]/parent::div//div[@class="multiselect__content-wrapper"]//li[1]', //Scenario - labelScenario:'//label[text()="Scenario"]', + labelScenario: '//label[text()="Scenario"]', containerScenario: '//label[contains(text(),"Scenario")]//parent::div//div[@class="multiselect__select"]', - inputScenario:'//label[text()="Scenario"]/parent::div//div//div[@class="multiselect__tags"]//input', + inputScenario: 'input[id="scenario-select"]', itemScenario: '//label[text()="Scenario"]/parent::div//div[@class="multiselect__content-wrapper"]//li[2]', //Additional data additionalData: '.view-lines', runTestBtn: '//button[contains(text(),"Run")]', cancelBtn: '//footer//button[text()="Cancel"]', //Check to bypass Script tasks and Data Connectors - bypassCheckbox:'//input[@type="checkbox"]', + bypassCheckbox: '//input[@type="checkbox"]', //FROM PROCESS CONFIGURE testRun_ScenariosTab: '[id="test_runs-tab"]', @@ -38,7 +38,7 @@ export default{ //Scenario created by process BP:by process (process configure) //scenariosTab:'a[id="scenarios-tab"]', scenariosTab: '[data-test="scenarios-tab"]', - createScenarioBtnBP:'[aria-label="Create Scenario"]', + createScenarioBtnBP: '[aria-label="Create Scenario"]', searchScenario: '#scenarios-edit-tab > :nth-child(1) > #search-bar > :nth-child(1) > .flex-grow-1 > #search > .input-group > .form-control', //Manual or Advanced @@ -58,34 +58,34 @@ export default{ uploadBtn: '[for="input-file-dt"]', fileAttachedfield: '.upload-file-uploaded-name', saveScenarioBPBtn: '.w-100 > .btn-secondary', - alertMessage:'[class="alert d-none d-lg-block alertBox alert-dismissible alert-success"]', + alertMessage: '[class="alert d-none d-lg-block alertBox alert-dismissible alert-success"]', //CRUD scenario menuScenario: '//div[@data-test="scenario-ellipsis"]//button[@aria-haspopup="menu"]', - editScenarioBtn:'//ul//li//*[contains(text(),"Edit Scenario")]//parent::div//i', + editScenarioBtn: '//ul//li//*[contains(text(),"Edit Scenario")]//parent::div//i', deleteScenarioBtn: '//a[@data-test="delete-scenario-btn"]', - confirmDeleteScenario:'//button[text()="Confirm"]', - editDescription:'//legend[text()="Description *"]/following-sibling::div//textarea', + confirmDeleteScenario: '//button[text()="Confirm"]', + editDescription: '//legend[text()="Description *"]/following-sibling::div//textarea', //TESTS RUN //testRunTab:'a[id="test_runs-tab"]', testRunTab: '[data-test="test-runs-tab"]', plusScenarioBtn: '[aria-label="Create Scenario"]', - testBtnInConfigProcess:'button[aria-label="Test"]', - clearBtnInRunTab:'button[aria-label="Clear"]', + testBtnInConfigProcess: 'button[aria-label="Test"]', + clearBtnInRunTab: 'button[aria-label="Clear"]', searchTestRun: ':nth-child(1) > :nth-child(1) > #search-bar > :nth-child(1) > .flex-grow-1 > #search > .input-group > .form-control', - confirmDeleteAllTests:'//button[contains(text(),"Confirm")]', - rowTestsRun:'//div[@id="test-runs-edit-tab"]//div[@class="card card-body menu-table-card"]//table//tbody//tr', + confirmDeleteAllTests: '//button[contains(text(),"Confirm")]', + rowTestsRun: '//div[@id="test-runs-edit-tab"]//div[@class="card card-body menu-table-card"]//table//tbody//tr', runBtn: '//footer//button[contains(text(),"Run")]', //Scenario created by request BR:by request - dataTab:'//a[contains(text(),"Data")]', - createScenarioBtnBR:'//button[text()[normalize-space()="Create Scenario"]]', - nameInCreateScenarioBR:'input[id="name"]', - descriptionInCreateScenarioBR:'textarea[id="description"]', - dataInCreateScenarioBR:'//label[text()="Data"]/following-sibling::div//textarea', + dataTab: '//a[contains(text(),"Data")]', + createScenarioBtnBR: '//button[text()[normalize-space()="Create Scenario"]]', + nameInCreateScenarioBR: 'input[id="name"]', + descriptionInCreateScenarioBR: 'textarea[id="description"]', + dataInCreateScenarioBR: '//label[text()="Data"]/following-sibling::div//textarea', saveBtnInCreateScenarioBR: '(//button[contains(text(),"Save")])[2]', emailTab: '//a[contains(text(),"Emails")]', submitBtn: 'button[aria-label="New Submit"]',