Skip to content

Commit

Permalink
addMethodToABT
Browse files Browse the repository at this point in the history
  • Loading branch information
WendyFPM committed Jun 5, 2024
1 parent 4566316 commit ee8619e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pages/abTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@ export class ABTesting {

replaceAlternativeBWithDataOfAlternativeA(iframeOption) {
this.clickOnAlternativeB(iframeOption);
this.clickOnReplaceAlternative();
this.clickOnReplaceAlternative(iframeOption);
}

confirmReplaceAlternative(iframeOption = 'a'){
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
cy.iframe(iframeSelector).find(selectors.confirmReplaceAlt).click();
}

clickOnAlternativeA(iframeOption = 'a') {
Expand All @@ -59,8 +64,10 @@ export class ABTesting {
cy.iframe(iframeSelector).find(selectors.alternativeB_Tab).click();
}

clickOnReplaceAlternative() {
cy.iframe(selectors.iframeA).find(selectors.replaceAlternativeBtn).first().click();
clickOnReplaceAlternative(iframeOption = 'a') {
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
cy.iframe(iframeSelector).find(selectors.replaceAlternativeBtn).first().click();
this.confirmReplaceAlternative(iframeOption);
}

deleteAlternativeB() {
Expand Down

0 comments on commit ee8619e

Please sign in to comment.