Skip to content

Commit 0bbba8e

Browse files
author
sgauruseu
committed
ui-tests - update app names issue #8821
1 parent c6eed34 commit 0bbba8e

10 files changed

+93
-118
lines changed

testing/libs/app_const.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ module.exports = Object.freeze({
6363
TEST_FOLDER_NAME: 'all-content-types-images',
6464
APP_CONTENT_TYPES: 'All Content Types App',
6565
MY_FIRST_APP: 'My First App',
66-
APP_WITH_CONFIGURATOR: 'Second Selenium App',
6766
THIS_FIELD_IS_REQUIRED: 'This field is required',
6867
PROJECT_UNSAVED_CHANGES_MESSAGE: "There are unsaved changes, do you want to save them before closing?",
6968
TAB_TITLE_PART: "/ Content",
@@ -109,9 +108,10 @@ module.exports = Object.freeze({
109108
TEST_APPS_NAME: {
110109
APP_CONTENT_TYPES: 'All Content Types App',
111110
SIMPLE_SITE_APP: 'Simple Site App',
112-
APP_WITH_CONFIG_OPTION_SET: 'Simple Test Selenium App',
113-
APP_WITH_METADATA_MIXIN: 'Third Selenium App',
111+
TEST_APP_WITH_METADATA_MIXIN: 'Test Selenium App',
114112
MY_FIRST_APP: 'My First App',
113+
TEST_SELENIUM_APP: 'Test Selenium App',
114+
TEST_ADFS_PROVIDER_APP: 'Test ADFS ID Provider',
115115
},
116116

117117
VERSIONS_ITEM_HEADER: {
@@ -224,6 +224,7 @@ module.exports = Object.freeze({
224224
CITY_CREATION: 'City Creation',
225225
CONTENT_TYPES_CITIES_DISTANCE_FACET: 'Cities Distance Facet',
226226
PART_WITH_ERROR: 'part-with-error',
227+
MY_FIRST_APP_CITY_LIST: 'City list',
227228
},
228229
PCV_MENU_ITEM: {
229230
INSERT: 'Insert',

testing/page_objects/wizardpanel/site_configurator/second.app.site.configurator.js renamed to testing/page_objects/wizardpanel/site_configurator/site.configurator.req.input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const XPATH = {
55
trackingIdTextInput: `//input[contains(@name,'trackingId')]`,
66
};
77

8-
class SecondAppSiteConfiguratorDialog extends BaseSiteConfiguratorDialog {
8+
class SiteConfiguratorReqInputDialog extends BaseSiteConfiguratorDialog {
99

1010
get trackingIdTextInput() {
1111
return XPATH.container + `${XPATH.trackingIdTextInput}`;
@@ -22,4 +22,4 @@ class SecondAppSiteConfiguratorDialog extends BaseSiteConfiguratorDialog {
2222
}
2323
}
2424

25-
module.exports = SecondAppSiteConfiguratorDialog;
25+
module.exports = SiteConfiguratorReqInputDialog;

testing/specs/content-types-2/content.selector.partinspection.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('my.first.site.country.spec - Create a site with country content', func
4444
await pageComponentView.openMenu('main');
4545
await pageComponentView.selectMenuItem(['Insert', 'Part']);
4646
// 4. Select the part with a config
47-
await liveFormPanel.selectPartByDisplayName('City list');
47+
await liveFormPanel.selectPartByDisplayName(appConst.PART_NAME.MY_FIRST_APP_CITY_LIST);
4848
await contentWizard.switchToMainFrame();
4949
await cityListPartInspectionPanel.waitForLoaded();
5050
// 5. 'Apply' button should be disabled after selecting a part-option in the part-dropdown:
@@ -110,11 +110,11 @@ describe('my.first.site.country.spec - Create a site with country content', func
110110
await pageComponentView.openMenu('main');
111111
await pageComponentView.selectMenuItem(['Insert', 'Part']);
112112
// 4. Select the part with image-selector in config
113-
await liveFormPanel.selectPartByDisplayName('City Creation');
113+
await liveFormPanel.selectPartByDisplayName(appConst.PART_NAME.CITY_CREATION);
114114
await contentWizard.switchToMainFrame();
115115
// 5. Verify that Inspect Panel is loaded
116116
await cityCreationPartInspectionPanel.waitForLoaded();
117-
// 6. Click on mode-toggler and switch to flat mode:
117+
// 6. Click on mode-toggle and switch the image-selector to tree mode:
118118
await cityCreationPartInspectionPanel.clickOnImageSelectorModeTogglerButton();
119119
// 7. Verify that expected options are displayed in tree mode:
120120
let items = await cityCreationPartInspectionPanel.getTreeModeOptionsImagesDisplayName();

testing/specs/modal-dialog/site.config.modal.dialog.with.optionset.spec.js

Lines changed: 53 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ const contentBuilder = require("../../libs/content.builder");
88
const SiteFormPanel = require('../../page_objects/wizardpanel/site.form.panel');
99
const SiteConfiguratorWithOptionSetDialog = require('../../page_objects/wizardpanel/site_configurator/site.config.with.optionset.dialog');
1010
const appConst = require('../../libs/app_const');
11+
const ContentWizard = require('../../page_objects/wizardpanel/content.wizard.panel');
12+
const SiteConfiguratorDialog = require('../../page_objects/wizardpanel/site_configurator/site.config.with.optionset.dialog');
13+
const ContentPublishDialog = require('../../page_objects/content.publish.dialog');
1114

1215
describe('Tests for site configurator modal dialog with multi-selection Option Set', function () {
1316
this.timeout(appConst.SUITE_TIMEOUT);
@@ -19,34 +22,67 @@ describe('Tests for site configurator modal dialog with multi-selection Option S
1922
it(`Precondition: new site should be added`,
2023
async () => {
2124
let displayName = contentBuilder.generateRandomName('site');
22-
SITE = contentBuilder.buildSite(displayName, 'description', [appConst.TEST_APPS_NAME.APP_WITH_CONFIG_OPTION_SET]);
23-
await studioUtils.doAddSite(SITE, true);
25+
SITE = contentBuilder.buildSite(displayName, 'description', [appConst.TEST_APPS_NAME.MY_FIRST_APP]);
26+
await studioUtils.doAddSite(SITE);
2427
});
2528

2629
// Verifies: Default options in option-set don't get selected in site configurator #4629
27-
it(`GIVEN site configurator dialog is opened WHEN the default selected option has been clicked and Apply button has been pressed THEN all options are unselected after reopening the dialog`,
30+
// https://github.com/enonic/app-contentstudio/issues/4629
31+
it(`GIVEN site configurator dialog is opened WHEN the checkbox(Option 2) that is checked by default has been unchecked and Apply button has been pressed THEN all options should be unchecked after reopening the dialog`,
2832
async () => {
2933
let siteFormPanel = new SiteFormPanel();
30-
let siteConfiguratorDialog = new SiteConfiguratorWithOptionSetDialog();
31-
// 1. Open existing site:
34+
let siteConfigOptionSet = new SiteConfiguratorWithOptionSetDialog();
35+
// 1. Open the existing site:
3236
await studioUtils.selectContentAndOpenWizard(SITE.displayName);
3337
// 2. Open Site Configurator:
34-
await siteFormPanel.openSiteConfiguratorDialog(appConst.TEST_APPS_NAME.APP_WITH_CONFIG_OPTION_SET);
38+
await siteFormPanel.openSiteConfiguratorDialog(appConst.TEST_APPS_NAME.MY_FIRST_APP);
3539
await studioUtils.saveScreenshot('site_cfg_option2_selected_default');
36-
// 3. Verify that 'Option 2' is selected by default:
37-
let result = await siteConfiguratorDialog.isCheckboxSelected('Option 2');
40+
// 3. Verify that checkbox 'Option 2' is checked by default:
41+
let result = await siteConfigOptionSet.isCheckboxSelected('Option 2');
3842
assert.ok(result, 'Option 2 option should be selected');
39-
// 4. Unselect the 'Option 2' then Apply it:
40-
await siteConfiguratorDialog.clickOnOption('Option 2');
41-
await siteConfiguratorDialog.clickOnApplyButton();
42-
await siteConfiguratorDialog.waitForDialogClosed();
43+
// 4. Uncheck the 'Option 2' then Apply it:
44+
await siteConfigOptionSet.clickOnOption('Option 2');
45+
await siteConfigOptionSet.clickOnApplyButton();
46+
await siteConfigOptionSet.waitForDialogClosed();
4347
await siteFormPanel.pause(500);
4448
// 5. Reopen the site configurator modal dialog:
45-
await siteFormPanel.openSiteConfiguratorDialog(appConst.TEST_APPS_NAME.APP_WITH_CONFIG_OPTION_SET);
49+
await siteFormPanel.openSiteConfiguratorDialog(appConst.TEST_APPS_NAME.MY_FIRST_APP);
4650
await studioUtils.saveScreenshot('site_cfg_option2_unselected_reopened');
47-
// 6. Verify that 'Option 2' is unselected:
48-
result = await siteConfiguratorDialog.isCheckboxSelected('Option 2');
49-
assert.ok(result === false, 'Option 2 option should be not selected');
51+
// 6. Verify that 'Option 2' is unchecked:
52+
result = await siteConfigOptionSet.isCheckboxSelected('Option 2');
53+
assert.ok(result === false, 'Option 2 option should not be checked');
54+
});
55+
56+
// Verifies: https://github.com/enonic/app-contentstudio/issues/5710
57+
// Content is not reset from Ready to In progress when controller is selected
58+
it("GIVEN site is ready for publishing WHEN site config has been updated THEN the site's status gets 'Work in progress'",
59+
async () => {
60+
let siteFormPanel = new SiteFormPanel();
61+
let contentWizard = new ContentWizard();
62+
let siteConfiguratorDialog = new SiteConfiguratorDialog();
63+
// 1. Open existing site:
64+
await studioUtils.selectContentAndOpenWizard(SITE.displayName);
65+
await contentWizard.clickOnMarkAsReadyButton();
66+
let contentPublishDialog = new ContentPublishDialog();
67+
await contentPublishDialog.waitForDialogOpened();
68+
await contentPublishDialog.clickOnCancelTopButton();
69+
await contentPublishDialog.waitForDialogClosed();
70+
// 2. Open Site Configurator:
71+
await siteFormPanel.openSiteConfiguratorDialog(appConst.TEST_APPS_NAME.MY_FIRST_APP);
72+
// 3. select the 'Option 3' then Apply it:
73+
await siteConfiguratorDialog.clickOnOption('Option 3');
74+
await siteConfiguratorDialog.clickOnApplyButton();
75+
await siteConfiguratorDialog.waitForDialogClosed();
76+
// 4. Verify that Notification message appears:
77+
await contentWizard.waitForNotificationMessage();
78+
// 5. Verify that 'MARK AS READY' button gets visible in the wizard-toolbar
79+
await contentWizard.waitForMarkAsReadyButtonVisible();
80+
// 6. Verify that 'Save' button is disabled:
81+
await contentWizard.waitForSaveButtonDisabled();
82+
await studioUtils.saveScreenshot('site_cfg_updated_workflow');
83+
// 7. Workflow status should be 'Work in progress':
84+
let workflow = await contentWizard.getContentWorkflowState();
85+
assert.equal(workflow, appConst.WORKFLOW_STATE.WORK_IN_PROGRESS, "the site's status should be 'Work in progress'");
5086
});
5187

5288
beforeEach(() => studioUtils.navigateToContentStudioApp());
@@ -57,4 +93,4 @@ describe('Tests for site configurator modal dialog with multi-selection Option S
5793
}
5894
return console.log('specification starting: ' + this.title);
5995
});
60-
});
96+
});

testing/specs/modal-dialog/site.config.workflow.spec.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

testing/specs/page-editor/layout.config.inspect.panel.spec.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ describe('layout.config.inspect.panel.spec: tests for layout with config', funct
3131
let layoutConfigInspectPanel = new LayoutConfigInspectPanel();
3232
let layoutInspectionPanel = new LayoutInspectionPanel();
3333
let name = contentBuilder.generateRandomName('site');
34-
SITE = contentBuilder.buildSite(name, ' ', [appConst.TEST_APPS_NAME.APP_WITH_METADATA_MIXIN]);
34+
SITE = contentBuilder.buildSite(name, ' ', [appConst.TEST_APPS_NAME.APP_CONTENT_TYPES]);
3535
// 1. Open site-wizard and save:
3636
await studioUtils.openContentWizard(appConst.contentTypes.SITE);
3737
await contentWizard.typeData(SITE);
3838
await contentWizard.waitForNotificationMessage();
3939
await contentWizard.pause(500);
4040
// 2. Verify that the site should be saved automatically after selecting a controller
41-
await contentWizard.selectPageDescriptor(appConst.CONTROLLER_NAME.DEFAULT);
41+
await contentWizard.selectPageDescriptor(appConst.CONTROLLER_NAME.MAIN_REGION);
4242
await contentWizard.waitForSaveButtonDisabled();
4343
// 3. Click on minimize-toggler, expand 'Live Edit' and open Page Component modal dialog:
4444
await contentWizard.clickOnMinimizeLiveEditToggler();
@@ -57,7 +57,7 @@ describe('layout.config.inspect.panel.spec: tests for layout with config', funct
5757
// 11. Verify that there are no duplicated items in PCV:(4 items should be displayed in PCV);
5858
let result = await pageComponentView.getPageComponentsDisplayName();
5959
await studioUtils.saveScreenshot('layout_config_inspect_panel');
60-
assert.ok(result.includes('default'), 'main region item should be displayed in the modal dialog');
60+
assert.ok(result.includes('main region'), 'main region item should be displayed in the modal dialog');
6161
assert.ok(result.includes('Main'), 'main item should be displayed in the modal dialog');
6262
assert.ok(result.includes('Centered'), 'text component should be displayed in the modal dialog');
6363
assert.ok(result.includes('Center'), 'the second text component should be displayed in the modal dialog');
@@ -71,16 +71,16 @@ describe('layout.config.inspect.panel.spec: tests for layout with config', funct
7171
let layoutConfigInspectPanel = new LayoutConfigInspectPanel();
7272
let layoutInspectionPanel = new LayoutInspectionPanel();
7373
let name = contentBuilder.generateRandomName('site');
74-
SITE = contentBuilder.buildSite(name, ' ', [appConst.TEST_APPS_NAME.APP_WITH_METADATA_MIXIN]);
74+
SITE = contentBuilder.buildSite(name, ' ', [appConst.TEST_APPS_NAME.APP_CONTENT_TYPES]);
7575
// 1. Open site-wizard and save:
7676
await studioUtils.openContentWizard(appConst.contentTypes.SITE);
7777
await contentWizard.typeData(SITE);
7878
await contentWizard.waitForNotificationMessage();
7979
await contentWizard.pause(500);
8080
// 2. Verify that the site should be saved automatically after selecting a controller
81-
await contentWizard.selectPageDescriptor(appConst.CONTROLLER_NAME.DEFAULT);
81+
await contentWizard.selectPageDescriptor(appConst.CONTROLLER_NAME.APP_CONTENT_TYPES_PAGE);
8282
await contentWizard.waitForSaveButtonDisabled();
83-
// 3. Click on minimize-toggler, expand 'Live Edit' and open Page Component modal dialog:
83+
// 3. Click on minimize-toggle, expand 'Live Edit' and open Page Component modal dialog:
8484
await contentWizard.clickOnMinimizeLiveEditToggler();
8585
await pageComponentView.openMenu(MAIN_REGION);
8686
// 4. Insert the layout:
@@ -136,7 +136,7 @@ describe('layout.config.inspect.panel.spec: tests for layout with config', funct
136136
let layoutInspectionPanel = new LayoutInspectionPanel();
137137
// 1. Open the existing site:
138138
await studioUtils.selectAndOpenContentInWizard(SITE.displayName);
139-
// 2. Click on minimize-toggler, expand 'Live Edit' and open Page Component modal dialog:
139+
// 2. Click on minimize-toggle, expand 'Live Edit' and open Page Component modal dialog:
140140
await contentWizard.clickOnMinimizeLiveEditToggler();
141141
// 3. Click on the Centered item in PCV:
142142
await pageComponentView.clickOnComponent('Centered');

testing/specs/page-editor/page.template.insert.layout.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('page.template.insert.layout.spec: tests for inserting a layout in page
2020
const SUPPORT_SITE = 'Site';
2121
const CONTROLLER_NAME = appConst.CONTROLLER_NAME.MAIN_REGION;
2222
const LAYOUT_NAME = appConst.LAYOUT_NAME.COL_3;
23-
const TEST_TEXT = "test text";
23+
const TEST_TEXT = 'test text';
2424

2525
it(`Preconditions: new site should be created`,
2626
async () => {

testing/specs/project-2/project.wizard.two.apps.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('project.wizard.two.apps.spec - Select 2 applications in project wizard
2626
const PROJECT_DISPLAY_NAME = studioUtils.generateRandomName('project');
2727
const LAYER_DISPLAY_NAME = studioUtils.generateRandomName('layer');
2828
const LAYER_DISPLAY_NAME_2 = studioUtils.generateRandomName('layer');
29-
const PARENT_APPS = [appConst.TEST_APPS_NAME.APP_CONTENT_TYPES, appConst.TEST_APPS_NAME.APP_WITH_METADATA_MIXIN];
29+
const PARENT_APPS = [appConst.TEST_APPS_NAME.APP_CONTENT_TYPES, appConst.TEST_APPS_NAME.TEST_APP_WITH_METADATA_MIXIN];
3030

3131
it(`GIVEN project with two selected apps is opened THEN expected application should be present in the wizard page`,
3232
async () => {

0 commit comments

Comments
 (0)