@@ -8,6 +8,9 @@ const contentBuilder = require("../../libs/content.builder");
8
8
const SiteFormPanel = require ( '../../page_objects/wizardpanel/site.form.panel' ) ;
9
9
const SiteConfiguratorWithOptionSetDialog = require ( '../../page_objects/wizardpanel/site_configurator/site.config.with.optionset.dialog' ) ;
10
10
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' ) ;
11
14
12
15
describe ( 'Tests for site configurator modal dialog with multi-selection Option Set' , function ( ) {
13
16
this . timeout ( appConst . SUITE_TIMEOUT ) ;
@@ -19,34 +22,67 @@ describe('Tests for site configurator modal dialog with multi-selection Option S
19
22
it ( `Precondition: new site should be added` ,
20
23
async ( ) => {
21
24
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 ) ;
24
27
} ) ;
25
28
26
29
// 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` ,
28
32
async ( ) => {
29
33
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:
32
36
await studioUtils . selectContentAndOpenWizard ( SITE . displayName ) ;
33
37
// 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 ) ;
35
39
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' ) ;
38
42
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 ( ) ;
43
47
await siteFormPanel . pause ( 500 ) ;
44
48
// 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 ) ;
46
50
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'" ) ;
50
86
} ) ;
51
87
52
88
beforeEach ( ( ) => studioUtils . navigateToContentStudioApp ( ) ) ;
@@ -57,4 +93,4 @@ describe('Tests for site configurator modal dialog with multi-selection Option S
57
93
}
58
94
return console . log ( 'specification starting: ' + this . title ) ;
59
95
} ) ;
60
- } ) ;
96
+ } ) ;
0 commit comments