Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AddMethodToAB #86

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}

}
Loading