diff --git a/pages/abTesting.js b/pages/abTesting.js index 53a99ba..3a622bd 100644 --- a/pages/abTesting.js +++ b/pages/abTesting.js @@ -70,7 +70,6 @@ export class ABTesting { deleteAlternativeB_ifExist() { cy.iframe(selectors.iframeA).find(selectors.menuAB).invoke('text').then($text => { - cy.log($text) if ($text.includes('Alternative B')) { this.deleteAlternativeB(); } @@ -109,11 +108,13 @@ export class ABTesting { cy.iframe(iframeSelector).find('[class="modal-dialog modal-lg modal-dialog-centered"]').should('be.visible'); } - saveLaunchPadModal() { - cy.iframe(selectors.iframeA).find(selectors.modalLaunchpad).should('be.visible'); - cy.iframe(selectors.iframeA).find(selectors.labelLaunchpad).should('contain', 'Launchpad Settings') - cy.iframe(selectors.iframeA).find(selectors.saveBtnInLaunchpadSettingModal).should('be.visible'); - cy.iframe(selectors.iframeA).find(selectors.saveBtnInLaunchpadSettingModal).click({ force: true }); + saveLaunchPadModal(iframeOption = 'a') { + let iframeSelector = iframeOption === 'a' ? selectors.iframeA : selectors.iframeB + cy.iframe(iframeSelector).find(selectors.modalLaunchpad).should('be.visible'); + cy.iframe(iframeSelector).find(selectors.labelLaunchpad).should('contain', 'Launchpad Settings') + cy.iframe(iframeSelector).find(selectors.saveBtnInLaunchpadSettingModal).should('be.visible'); + cy.wait(3000); + cy.iframe(iframeSelector).find(selectors.saveBtnInLaunchpadSettingModal).click({ force: true }); } selectAlternativeA(iframeOption = 'a') { diff --git a/selectors/abTesting.js b/selectors/abTesting.js index cdaa74a..b8a3864 100644 --- a/selectors/abTesting.js +++ b/selectors/abTesting.js @@ -4,7 +4,7 @@ export default { //AB alternatives menuAB: '[id="myTab"]', - alternativeA_Tab: '[id="tab-A"]', + alternativeA_Tab: '[data-test="tab-A"]', alternativeB_Tab: '[data-test="tab-B"]', plusTab: '[data-test="tab-plus"]', deleteAltB_Btn: '[id="tab-B-remove"]', @@ -25,7 +25,7 @@ export default { saveAndPublish: '[data-test="btn-save-publish"]', version: 'input[name="version"]', description: '[name="description"]', - saveBtnInLaunchpadSettingModal: '[class="btn btn-secondary"]', + saveBtnInLaunchpadSettingModal: '[data-test="launchpad-modal-btn-ok"]', modalLaunchpad: '[id="launchpadSettingsModal___BV_modal_content_"]', labelLaunchpad: '[id="launchpadSettingsModal___BV_modal_title_"]', closeModalPublish: '[aria-label="Close"]',