Skip to content

Commit d577a65

Browse files
authored
ENGCOM-9263: [MFTF] Added AdminStartupPageTest and AssertAdminPageTitleActionGroup #32771
2 parents 9820686 + 787b1c4 commit d577a65

12 files changed

+105
-16
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminPageTitleActionGroup">
12+
<annotations>
13+
<description>Check Admin Page Title is present and correct.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="value" type="string"/>
17+
</arguments>
18+
19+
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="{{value}}" stepKey="seePageTitle"/>
20+
</actionGroup>
21+
</actionGroups>

app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@
8787

8888
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
8989
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
90-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
90+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton">
91+
<argument name="value" value="New Invoice"/>
92+
</actionGroup>
9193
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
9294
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
9395
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessInvoiceMessage"/>

app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
3333
</after>
3434
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
35-
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
35+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeDashboardTitle">
36+
<argument name="value" value="Dashboard"/>
37+
</actionGroup>
3638
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
3739
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
3840
</test>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminStartupPageTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Admin should see selected Startup Page after login."/>
15+
<title value="Admin should see selected Startup Page after login."/>
16+
<description value="Admin should see selected Startup Page after login."/>
17+
<severity value="MINOR"/>
18+
</annotations>
19+
<before>
20+
<magentoCLI command="config:set admin/startup/menu_item_id Magento_Sales::sales_order" stepKey="selectSalesOrderStartupPage"/>
21+
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
22+
</before>
23+
<after>
24+
<magentoCLI command="config:set admin/startup/menu_item_id Magento_Backend::dashboard" stepKey="selectDashboardStartupPage"/>
25+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
26+
</after>
27+
28+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
29+
<argument name="tags" value="config full_page"/>
30+
</actionGroup>
31+
32+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="checkPageTitle">
33+
<argument name="value" value="Orders"/>
34+
</actionGroup>
35+
</test>
36+
</tests>

app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@
8282
<comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitForReloadSecond"/>
8383

8484
<seeInTitle userInput="Products / Inventory / Catalog / Magento Admin" stepKey="seeAdminProductsPageTitle"/>
85-
<see userInput="Products" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeAdminProductsPageHeader"/>
85+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeAdminProductsPageHeader">
86+
<argument name="value" value="Products"/>
87+
</actionGroup>
8688

8789
<switchToNextTab stepKey="switchToFrontendTab"/>
8890
<closeTab stepKey="closeFrontendTab"/>

app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@
5151
</actionGroup>
5252

5353
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceAction"/>
54-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/>
54+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seePageNameNewInvoicePage">
55+
<argument name="value" value="New Invoice"/>
56+
</actionGroup>
5557
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
5658
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
5759
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>

app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@
8080
<seeElement selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="seeCreditMemo"/>
8181
<click selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="clickCreditMemoItem"/>
8282
<waitForPageLoad stepKey="waitForCreditMemoPageLoaded"/>
83-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/>
83+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewMemoPageTitle">
84+
<argument name="value" value="New Memo"/>
85+
</actionGroup>
8486
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewMemoUrlOnPage"/>
8587
</test>
8688
</tests>

app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,14 @@
3434
<!--Create order via Admin-->
3535
<comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/>
3636
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToOrderIndexPage"/>
37-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
37+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeIndexPageTitle">
38+
<argument name="value" value="Orders"/>
39+
</actionGroup>
3840
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
3941
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
40-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
42+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewOrderPageTitle">
43+
<argument name="value" value="Create New Order"/>
44+
</actionGroup>
4145

4246
<!--Check if order can be submitted without the required fields-->
4347
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="seeNewOrderPageTitle">

app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@
3333
<comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/>
3434
<!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>-->
3535
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToOrderIndexPage"/>
36-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
36+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeIndexPageTitle">
37+
<argument name="value" value="Orders"/>
38+
</actionGroup>
3739
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
3840
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
39-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
41+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewOrderPageTitle">
42+
<argument name="value" value="Create New Order"/>
43+
</actionGroup>
4044

4145
<!--Check if order can be submitted without the required fields including email address-->
4246
<actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/>

app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@
3232
<comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/>
3333
<!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>-->
3434
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToOrderIndexPage"/>
35-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
35+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeIndexPageTitle">
36+
<argument name="value" value="Orders"/>
37+
</actionGroup>
3638
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
3739
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
38-
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
40+
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewOrderPageTitle">
41+
<argument name="value" value="Create New Order"/>
42+
</actionGroup>
3943

4044
<!--Check if order can be submitted without the required fields including email address-->
4145
<actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/>

0 commit comments

Comments
 (0)