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

UpdMethodsAndSelectorsInMEDR #128

Merged
merged 1 commit into from
Jun 20, 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
28 changes: 14 additions & 14 deletions pages/modelerElementDestinationRedirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ const abTesting = new ABTesting();

export class ModelerElementDestinationRedirect {
//Element Destination for TASKS
configureElementDestinationInTask(nameElement, iframeOption = 'a'){
configureElementDestinationInTask(nameElement,optionConfig, iframeOption = 'a'){
abTesting.clickOnTask(nameElement, iframeOption);
abTesting.clickOnInspectorBtn(iframeOption);
this.selectOptionInTask(option,iframeOption);
this.selectOptionInTask(optionConfig,iframeOption);
abTesting.publishNewVersion('withoutAB', iframeOption);
}

Expand All @@ -20,24 +20,25 @@ export class ModelerElementDestinationRedirect {
* @param iframe: (iframe A: 'a', iframe B: 'b')
*/

selectOptionInTask(option,iframeOption = 'a'){
selectOptionInTask(optionConfig,iframeOption = 'a'){
const { option, dashboardName, url } = optionConfig
let iframeSelector = iframeOption === 'a' ? selectorsAB.iframeA : selectorsAB.iframeB
cy.iframe(iframeSelector).xpath(selectors.labelElementDestination).should('be.visible');
switch (option) {
case 'Task Source':
this.selectElementDestination(iframe,'Task Source');
this.selectElementDestination('Task Source',iframeOption);
break;
case 'Task List':
this.selectElementDestination(iframe,'Task List');
this.selectElementDestination('Task List',iframeOption);
break;
case 'Process Launchpad':
this.selectElementDestination(iframe,'Process Launchpad');
this.selectElementDestination('Process Launchpad',iframeOption);
break;
case 'Welcome Screen':
this.selectElementDestination(iframe,'Welcome Screen');
this.selectElementDestination('Welcome Screen',iframeOption);
break;
case 'Custom Dashboard':
this.selectElementDestination(iframe,'Custom Dashboard');
this.selectElementDestination('Custom Dashboard');
this.selectDashboardInModeler(dashboardName,iframeOption);
break;
case 'External URL':
Expand All @@ -51,14 +52,13 @@ export class ModelerElementDestinationRedirect {

selectDashboardInModeler(dashboardName,iframeOption = 'a'){
let iframeSelector = iframeOption === 'a' ? selectorsAB.iframeA : selectorsAB.iframeB
//cy.iframe(iframeSelector).xpath(selectors.labelDashboard).should('be.visible');
cy.iframe(iframeSelector).find(selectors.dashboardInput).should('be.visible');
cy.iframe(iframeSelector).find(selectors.dashboardInput).click();
cy.iframe(iframeSelector).xpath(selectors.labelDashboard).should('be.visible');
cy.iframe(iframeSelector).find(selectors.dashboardInput).click({force:true});
cy.iframe(iframeSelector).find(selectors.dashboardInput).type(dashboardName,{delay:60}).should('have.value',dashboardName);
cy.iframe(iframeSelector).xpath(selectors.wrapperDashboard)
.should('have.attr', 'aria-label')
.and('contain', dashboardName+ '. ');
cy.iframe(iframeSelector).xpath(selectors.dashboardInput).type('{enter}');
cy.iframe(iframeSelector).find(selectors.dashboardInput).type('{enter}');
}

selectExternalURLInModeler(url,iframeOption = 'a'){
Expand Down Expand Up @@ -128,8 +128,8 @@ export class ModelerElementDestinationRedirect {
cy.iframe(iframeSelector).xpath(selectors.processInput).type('{enter}');
}

selectElementDestination(iframe,option){
switch (iframe) {
selectElementDestination(option,iframeOption = 'a'){
switch (iframeOption) {
case 'a':
this.selectOption(option,selectorsAB.iframeA)
break;
Expand Down
2 changes: 1 addition & 1 deletion selectors/modelerElementDestinationRedirect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default {
labelElementDestination:'//label[text()="Element Destination"]',
elementDestinationList:'[data-test="element-destination-type"]',
labelDashboard:'//label[text()="Dashboard"]',
dashboardInput:'[name="Dashboard"]',
dashboardInput:'input[name="Dashboard"]',
selectDashboard:'//label[text()="Dashboard"]/following-sibling::div//div[@class="multiselect__select"]',
wrapperDashboard:'//label[text()="Dashboard"]/following-sibling::div//div[@class="multiselect__content-wrapper"]//li[1]',
labelURL:'//label[text()="URL"]',
Expand Down
Loading