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

methods and selectors ABtesting #34

Merged
merged 1 commit into from
May 3, 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
13 changes: 7 additions & 6 deletions pages/abTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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') {
Expand Down
4 changes: 2 additions & 2 deletions selectors/abTesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"]',
Expand All @@ -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"]',
Expand Down
Loading