1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+ <!--
3
+ /**
4
+ * Copyright © Magento, Inc. All rights reserved.
5
+ * See COPYING.txt for license details.
6
+ */
7
+ -->
8
+ <tests xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
+ xsi : noNamespaceSchemaLocation =" urn:magento:mftf:Test/etc/testSchema.xsd" >
10
+ <test name =" AdminCreateCmsPageEntityTest" >
11
+ <annotations >
12
+ <features value =" Cms" />
13
+ <title value =" Create CMS Page via the Admin" />
14
+ <description value =" Admin should be able to create a CMS Page" />
15
+ <group value =" backend" />
16
+ <group value =" cMSContent" />
17
+ <group value =" mtf_migrated" />
18
+ </annotations >
19
+ <before >
20
+ <actionGroup ref =" LoginAsAdmin" stepKey =" loginAsAdmin" />
21
+ </before >
22
+ <after >
23
+ <!-- Disable single store mode-->
24
+ <magentoCLI command =" config:set general/single_store_mode/enabled 0" stepKey =" disableSingleStoreMode" />
25
+ <actionGroup ref =" logout" stepKey =" logout" />
26
+ </after >
27
+
28
+ <!-- Create CMS Content Page-->
29
+ <!-- Go to New CMS Page page-->
30
+ <amOnPage url =" {{CmsNewPagePage.url}}" stepKey =" navigateToCreateNewPage" />
31
+ <waitForPageLoad stepKey =" waitForNewPagePageLoad" />
32
+ <actionGroup ref =" FillOutCMSPageContent" stepKey =" fillBasicPageData" />
33
+ <!-- verify successfully saved-->
34
+ <actionGroup ref =" saveCmsPage" stepKey =" saveNewPage" />
35
+ <!-- verify page on frontend-->
36
+ <amOnPage url =" {{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey =" amOnPageTestPage" />
37
+ <actionGroup ref =" AssertStoreFrontCMSPage" stepKey =" verifyPageDataOnFrontend" >
38
+ <argument name =" cmsTitle" value =" {{_duplicatedCMSPage.title}}" />
39
+ <argument name =" cmsContent" value =" {{_duplicatedCMSPage.content}}" />
40
+ <argument name =" cmsContentHeading" value =" {{_duplicatedCMSPage.content_heading}}" />
41
+ </actionGroup >
42
+ <!-- verify page in grid-->
43
+ <actionGroup ref =" navigateToCreatedCMSPage" stepKey =" verifyPageInGrid" >
44
+ <argument name =" CMSPage" value =" _duplicatedCMSPage" />
45
+ </actionGroup >
46
+ <actionGroup ref =" DeletePageByUrlKeyActionGroup" stepKey =" deletePage" >
47
+ <argument name =" UrlKey" value =" {{_duplicatedCMSPage.identifier}}" />
48
+ </actionGroup >
49
+
50
+ <!-- Create page for default store view-->
51
+ <!-- Go to New CMS Page page-->
52
+ <amOnPage url =" {{CmsNewPagePage.url}}" stepKey =" navigateToCreateNewPage2" />
53
+ <waitForPageLoad stepKey =" waitForNewPagePageLoad2" />
54
+ <!-- Fill the CMS page form-->
55
+ <actionGroup ref =" FillOutCMSPageContent" stepKey =" fillBasicPageDataForPageWithDefaultStore" />
56
+ <actionGroup ref =" SelectCMSPageStoreView" stepKey =" selectCMSPageStoreView" >
57
+ <argument name =" storeViewName" value =" Default Store View" />
58
+ </actionGroup >
59
+ <!-- Verify successfully saved-->
60
+ <actionGroup ref =" saveCmsPage" stepKey =" savePageWithDefaultStore" />
61
+ <!-- Navigate to page in Admin-->
62
+ <actionGroup ref =" navigateToCreatedCMSPage" stepKey =" navigateToCMSPageWithDefaultStoreInAdmin" >
63
+ <argument name =" CMSPage" value =" _duplicatedCMSPage" />
64
+ </actionGroup >
65
+ <!-- Verify Page Data in Admin-->
66
+ <actionGroup ref =" AssertCMSPageContent" stepKey =" verifyPageWithDefaultStoreDataInAdmin" />
67
+ <!-- Verify Store ID-->
68
+ <actionGroup ref =" AssertCMSPageStoreId" stepKey =" verifyStoreId" >
69
+ <argument name =" storeId" value =" 1" />
70
+ </actionGroup >
71
+ <!-- Delete page-->
72
+ <actionGroup ref =" DeletePageByUrlKeyActionGroup" stepKey =" deletePageWithDefaultStore" >
73
+ <argument name =" UrlKey" value =" {{_duplicatedCMSPage.identifier}}" />
74
+ </actionGroup >
75
+
76
+ <!-- Block Cache Exploit-->
77
+ <!-- Go to New CMS Page page-->
78
+ <amOnPage url =" {{CmsNewPagePage.url}}" stepKey =" navigateToCreateNewPage3" />
79
+ <waitForPageLoad stepKey =" waitForNewPagePageLoad3" />
80
+ <!-- Fill the CMS page form-->
81
+ <actionGroup ref =" FillOutCMSPageContent" stepKey =" fillBasicPageDataForPageWithBlock" />
82
+ <fillField selector =" {{CmsNewPagePageContentSection.content}}" userInput =" {{block class=' Magento\Framework\View\Element\Text' text=' bla bla bla' cache_key=' BACKEND_ACL_RESOURCES' cache_lifetime=999}}" stepKey =" fillFieldContent" />
83
+ <actionGroup ref =" SelectCMSPageStoreView" stepKey =" selectCMSPageStoreViewForPageWithBlock" >
84
+ <argument name =" storeViewName" value =" Default Store View" />
85
+ </actionGroup >
86
+ <!-- Verify successfully saved-->
87
+ <actionGroup ref =" saveCmsPage" stepKey =" savePageWithBlock" />
88
+ <!-- verify page on frontend-->
89
+ <amOnPage url =" {{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey =" amOnPageWithBlock" />
90
+ <actionGroup ref =" AssertStoreFrontCMSPage" stepKey =" verifyPageWithBlockDataOnFrontend" >
91
+ <argument name =" cmsTitle" value =" {{_duplicatedCMSPage.title}}" />
92
+ <argument name =" cmsContent" value =" bla bla bla" />
93
+ <argument name =" cmsContentHeading" value =" {{_duplicatedCMSPage.content_heading}}" />
94
+ </actionGroup >
95
+ <!-- Delete page with block-->
96
+ <actionGroup ref =" DeletePageByUrlKeyActionGroup" stepKey =" deletePageWithBlock" >
97
+ <argument name =" UrlKey" value =" {{_duplicatedCMSPage.identifier}}" />
98
+ </actionGroup >
99
+
100
+ <!-- Create CMS page with single store mode-->
101
+ <!-- Enable single store mode-->
102
+ <magentoCLI command =" config:set general/single_store_mode/enabled 1" stepKey =" enableSingleStoreMode" />
103
+ <!-- Go to New CMS Page page-->
104
+ <amOnPage url =" {{CmsNewPagePage.url}}" stepKey =" navigateToCreateNewPage4" />
105
+ <waitForPageLoad stepKey =" waitForNewPagePageLoad4" />
106
+ <!-- Fill the CMS page form-->
107
+ <actionGroup ref =" FillOutCMSPageContent" stepKey =" fillBasicPageDataInSingleStoreMode" />
108
+ <!-- Verify successfully saved-->
109
+ <actionGroup ref =" saveCmsPage" stepKey =" savePageInSingleStoreMode" />
110
+ <!-- verify page on frontend-->
111
+ <amOnPage url =" {{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey =" amOnPageTestPageInSingleStoreMode" />
112
+ <actionGroup ref =" AssertStoreFrontCMSPage" stepKey =" verifyPageDataOnFrontendInSingleStoreMode" >
113
+ <argument name =" cmsTitle" value =" {{_duplicatedCMSPage.title}}" />
114
+ <argument name =" cmsContent" value =" {{_duplicatedCMSPage.content}}" />
115
+ <argument name =" cmsContentHeading" value =" {{_duplicatedCMSPage.content_heading}}" />
116
+ </actionGroup >
117
+ <!-- Navigate to page in Admin-->
118
+ <actionGroup ref =" navigateToCreatedCMSPage" stepKey =" navigateToCMSPageInAdminInSingleStoreMode" >
119
+ <argument name =" CMSPage" value =" _duplicatedCMSPage" />
120
+ </actionGroup >
121
+ <!-- Verify Page Data in Admin-->
122
+ <actionGroup ref =" AssertCMSPageContent" stepKey =" verifyPageDataInAdminInSingleStoreMode" />
123
+ <!-- Delete page-->
124
+ <actionGroup ref =" DeletePageByUrlKeyActionGroup" stepKey =" deletePageInSingleStoreMode" >
125
+ <argument name =" UrlKey" value =" {{_duplicatedCMSPage.identifier}}" />
126
+ </actionGroup >
127
+
128
+ <!-- Create disabled page-->
129
+ <!-- Go to New CMS Page page-->
130
+ <amOnPage url =" {{CmsNewPagePage.url}}" stepKey =" navigateToCreateNewPage5" />
131
+ <waitForPageLoad stepKey =" waitForNewPagePageLoad5" />
132
+ <!-- Fill the CMS page form-->
133
+ <actionGroup ref =" FillOutCMSPageContent" stepKey =" fillBasicPageDataForDisabledPage" />
134
+ <actionGroup ref =" SetCMSPageDisabled" stepKey =" setCMSPageDisabled" />
135
+ <!-- Verify successfully saved-->
136
+ <actionGroup ref =" saveCmsPage" stepKey =" saveDisabledPage" />
137
+ <!-- Check that page is disabled on frontend-->
138
+ <amOnPage url =" {{StorefrontHomePage.url}}/{{_duplicatedCMSPage.identifier}}" stepKey =" amOnDeactivatedPageOnFrontend" />
139
+ <waitForPageLoad stepKey =" waitForDeactivatedPageLoadOnFrontend" />
140
+ <see userInput =" Whoops, our bad..." stepKey =" seePageError" />
141
+ <!-- Delete page-->
142
+ <actionGroup ref =" DeletePageByUrlKeyActionGroup" stepKey =" deleteDisabledPage" >
143
+ <argument name =" UrlKey" value =" {{_duplicatedCMSPage.identifier}}" />
144
+ </actionGroup >
145
+ </test >
146
+ </tests >
0 commit comments