Skip to content

Commit

Permalink
Merge pull request #86 from ProcessMaker/AddMethodToAB
Browse files Browse the repository at this point in the history
AddMethodToAB
  • Loading branch information
WendyFPM authored May 29, 2024
2 parents 5882734 + 99066b9 commit 6340c7d
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pages/abTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,12 @@ export class ABTesting {
cy.iframe(iframeSelector).find(elementLocator.replace('nameElem', nameElement)).first().should('be.visible').click({ force: true });
}

clickOnTask(nameElement, iframeOption = 'a'){
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
const elementLocator = '[data-type="processmaker.components.nodes.task.Shape"]'
cy.iframe(iframeSelector).find(elementLocator.replace('nameElem', nameElement)).first().should('be.visible').click({ force: true });
}

clickOnEndEvent(nameElement, iframeOption = 'a') {
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
const elementLocator = '[data-type="processmaker.components.nodes.endEvent.Shape"]'
Expand Down Expand Up @@ -335,5 +341,24 @@ export class ABTesting {
this.clickOnStartEvent(nameElement, iframeOption);
cy.iframe(iframeSelector).xpath('//div[@id="collapse-inspector-accordion-start-event"]//input[@name="name"]').clear().type(newName);
}

remaneTaskName(nameElement,newName,taskType,iframeOption = 'a'){
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
let formTask = '//div[@id="collapse-inspector-accordion-task"]//input[@name="name"]'
let manualTask = '//div[@id="collapse-inspector-accordion-manual-task"]//input[@name="name"]'
this.clickOnTask(nameElement, iframeOption);
switch (taskType) {
case 'Form':
cy.iframe(iframeSelector).xpath(formTask).clear();
cy.iframe(iframeSelector).xpath(formTask).type(newName);
break;
case 'Manual':
cy.iframe(iframeSelector).xpath(manualTask).clear();
cy.iframe(iframeSelector).xpath(manualTask).type(newName);
break;
default:
break;
}
}

}

0 comments on commit 6340c7d

Please sign in to comment.