Skip to content

Commit

Permalink
Merge pull request #121 from ProcessMaker/AddselectUserOrGroupToAB
Browse files Browse the repository at this point in the history
AddselectUserOrGroupToAB
  • Loading branch information
WendyFPM authored Jun 18, 2024
2 parents 8564041 + e4baf66 commit f4acbb9
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pages/abTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,25 @@ export class ABTesting {
.click({ force: true })
.type("{meta+downarrow}",{force:true});
}

selectUserOrGroup(label,userGroup,iframeOption = 'a'){
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
const userGroupSelected = `//label[text()="${label}"]/parent::div//div[@class='multiselect__tags']//span`;
cy.iframe(iframeSelector).xpath(userGroupSelected).invoke('text')
.then(text => {
if (text !== userGroup) {
cy.iframe(iframeSelector).xpath(`//label[text()="${label}"]/parent::div//div[@class="multiselect__tags"]`).click();
this.load();
cy.iframe(iframeSelector).xpath(`//label[text()="${label}"]/parent::div//input`).clear();
let len = (userGroup.length)-1;
cy.iframe(iframeSelector).xpath(`//label[text()="${label}"]/parent::div//input`).type(userGroup.substring(0,len)).should('have.value', userGroup.substring(0,len));
this.load();
cy.iframe(iframeSelector).xpath(`//label[text()="${label}"]/parent::div//input`).type(userGroup.charAt(len)).should('have.value', userGroup);
this.load();
cy.iframe(iframeSelector).xpath(`(//span[contains(text(),"userGroup")]/ancestor::div[@class="multiselect__content-wrapper"])[1]`.replace("userGroup",userGroup)).click();
}
});
}

fillProcessVariable(variableName,value,iframeOption = 'a'){
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
Expand Down

0 comments on commit f4acbb9

Please sign in to comment.