Skip to content

Commit

Permalink
ui-tests issue #1390
Browse files Browse the repository at this point in the history
  • Loading branch information
sgauruseu authored and alansemenov committed Oct 21, 2024
1 parent 07555aa commit e53c10a
Show file tree
Hide file tree
Showing 65 changed files with 2,186 additions and 1,553 deletions.
6 changes: 3 additions & 3 deletions testing/libs/WebDriverHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ WebDriverHelper.prototype.setupBrowser = function setupBrowser(w, h) {
console.log('browser name ##################### ' + browser_name);
console.log('browser width ##################### ' + width);
let options = {
logLevel: "error",
automationProtocol: "webdriver",
"wdio:enforceWebDriverClassic": true,
logLevel: 'error',
automationProtocol: 'webdriver',
capabilities: {
"wdio:enforceWebDriverClassic": true,
browserName: browser_name,
browserVersion: browser_version,
"wdio:enforceWebDriverClassic": true,
'goog:chromeOptions': makeChromeOptions(isHeadless, width, height)
}
};
Expand Down
16 changes: 16 additions & 0 deletions testing/libs/app_const.js
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,20 @@ module.exports = Object.freeze({
ARCHIVED: 'Archived',
ARCHIVED_BY: 'Archived by',
},
WIDGET_SELECTOR_OPTIONS: {
VERSION_HISTORY: 'Version history',
DEPENDENCIES: 'Dependencies',
LAYERS: 'Layers',
EMULATOR: 'Emulator',
DETAILS: 'Details'
},
BROWSER_TITLES: {
CONTENT_STUDIO: 'Content Studio - Enonic XP Admin',
XP_HOME: 'Enonic XP Home',
},
ACCESSIBILITY_ATTRIBUTES: {
ROLE: 'role',
ARIA_LABEL: 'aria-label',
ARIA_HAS_POPUP: 'aria-haspopup',
},
});
338 changes: 196 additions & 142 deletions testing/libs/elements.js

Large diffs are not rendered by default.

34 changes: 28 additions & 6 deletions testing/libs/project.utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ProjectWizardDialogPermissionsStep = require('../page_objects/project/proj
const ProjectWizardDialogApplicationsStep = require('../page_objects/project/project-wizard-dialog/project.wizard.applications.step');
const ProjectWizardDialogNameAndIdStep = require('../page_objects/project/project-wizard-dialog/project.wizard.name.id.step');
const ProjectWizardDialogSummaryStep = require('../page_objects/project/project-wizard-dialog/project.wizard.summary.step');
const appConst = require('./app_const');
const appConst = require("./app_const");
const path = require('path');
const fs = require('fs');
const webDriverHelper = require('./WebDriverHelper');
Expand All @@ -36,16 +36,15 @@ module.exports = {
await summaryStep.waitForDialogClosed();
return await settingsBrowsePanel.pause(500);
},
async fillParentNameStep(parents) {
async selectParentProjectsByName(parents) {
try {
let parentProjectStep = new ProjectWizardDialogParentProjectStep();
parents = [].concat(parents);
let selectedItems = await parentProjectStep.getSelectedProjects();
for (let name of parents) {
if (selectedItems.length === 0 || this.isProjectSelected(selectedItems, name)) {
// TODO slickgrid - uncomment this string
await parentProjectStep.selectParentProject(name);
//await parentProjectStep.selectParentProjectById(name);
// select a project and click on Apply button
await parentProjectStep.selectParentProjectMulti(name);
}
}
await parentProjectStep.clickOnNextButton();
Expand All @@ -55,6 +54,23 @@ module.exports = {
throw new Error(`Error occurred in parent project step, screenshot:${screenshot} ` + err);
}
},
async selectSingleParentProjectsByName(parent) {
try {
let parentProjectStep = new ProjectWizardDialogParentProjectStep();
let selectedItems = await parentProjectStep.getSelectedProjects();

let isSelected = selectedItems.length > 0 && selectedItems[0].includes(parent);
if (!isSelected) {
await parentProjectStep.selectParentProject(parent);
}

await parentProjectStep.clickOnNextButton();
return new ProjectWizardDialogLanguageStep();
} catch (err) {
let screenshot = await this.saveScreenshotUniqueName('err_parent_proj_step');
throw new Error(`Error occurred in parent project step, screenshot:${screenshot} ` + err);
}
},
isProjectSelected(arr, text) {
arr.find((item) => {
if (item.includes(text)) {
Expand Down Expand Up @@ -133,7 +149,13 @@ module.exports = {
let parentProjectStep = new ProjectWizardDialogParentProjectStep();
await parentProjectStep.clickOnSkipButton();
} else {
let languageStep = await this.fillParentNameStep(project.parents);
let languageStep;
if (Array.isArray(project.parents)) {
languageStep = await this.selectParentProjectsByName(project.parents);
} else {
languageStep = await this.selectSingleParentProjectsByName(project.parents);
}

await languageStep.waitForLoaded();
}
let accessModeStep = await this.fillLanguageStep(project.language);
Expand Down
Loading

0 comments on commit e53c10a

Please sign in to comment.