Skip to content

Commit

Permalink
MethodsAndSelectorsProcessTesting
Browse files Browse the repository at this point in the history
  • Loading branch information
WendyFPM committed May 2, 2024
1 parent 7d4ba96 commit 1e98180
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
24 changes: 12 additions & 12 deletions pages/processTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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();
}

Expand Down Expand Up @@ -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;
}
})
}

Expand Down
52 changes: 26 additions & 26 deletions selectors/processTesting.js
Original file line number Diff line number Diff line change
@@ -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"]',
Expand All @@ -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
Expand All @@ -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"]',
Expand Down

0 comments on commit 1e98180

Please sign in to comment.