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

updMethodsAndSelectorsToPublishAlternatives #90

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
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
12 changes: 8 additions & 4 deletions pages/abTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export class ABTesting {
//Publish New Version
publishNewVersion(option, iframeOption, alternative, version, description) {
this.clickOnPublishBtn(iframeOption);
this.load();
switch (option) {
case 'withoutAB':
break;
Expand All @@ -98,8 +99,7 @@ export class ABTesting {
default:
break;
}
this.load();
this.clickOnPublishBtnInModal();
this.clickOnPublishBtnInModal(iframeOption);
}

alert(iframeOption = 'a') {
Expand All @@ -124,21 +124,25 @@ export class ABTesting {

selectAlternativeA(iframeOption = 'a') {
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
cy.iframe(iframeSelector).find(selectors.alternativeA_Btn).should('be.visible');
cy.iframe(iframeSelector).find(selectors.alternativeA_Btn).click();
}

selectAlternativeB(iframeOption = 'a') {
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
cy.iframe(iframeSelector).find(selectors.alternativeB_Btn).should('be.visible');
cy.iframe(iframeSelector).find(selectors.alternativeB_Btn).click();
}

selectAlternativeAB(iframeOption = 'a') {
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
cy.iframe(iframeSelector).find(selectors.alternativeAB_Btn).should('be.visible');
cy.iframe(iframeSelector).find(selectors.alternativeAB_Btn).click();
}

clickOnPublishBtnInModal() {
cy.iframe(selectors.iframeA).find(selectors.publishBtnInModal).click({ force: true });
clickOnPublishBtnInModal(iframeOption) {
let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB
cy.iframe(iframeSelector).find(selectors.publishBtnInModal).click({ force: true });
}

clickOnSaveAndPublish(iframeOption = 'a') {
Expand Down
4 changes: 2 additions & 2 deletions selectors/abTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default {
publishBtn: '[data-cy="publish-btn"]',
modalPublishVersion: '[class="modal-dialog modal-lg modal-dialog-centered"]',
publishBtnInModal: '[data-test="btn-save-publish"]',
alternativeA_Btn: '[data-test="btn-alternative-a"]',
alternativeB_Btn: '[data-test="btn-alternative-b"]',
alternativeA_Btn: 'button[data-test="btn-alternative-a"]',
alternativeB_Btn: 'button[data-test="btn-alternative-b"]',
alternativeAB_Btn: '[data-test="btn-alternative-ab"]',
saveAndPublish: '[data-test="btn-save-publish"]',
version: 'input[name="version"]',
Expand Down
Loading