Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MFTF] Added AdminStartupPageTest and AssertAdminPageTitleActionGroup #32771

Merged
merged 6 commits into from
Oct 23, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AssertAdminPageTitleActionGroup">
<annotations>
<description>Check Admin Page Title is present and correct.</description>
</annotations>
<arguments>
<argument name="value" type="string"/>
</arguments>

<see selector="{{AdminHeaderSection.pageTitle}}" userInput="{{value}}" stepKey="seePageTitle"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@

<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton">
<argument name="value" value="New Invoice"/>
</actionGroup>
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="$150.00" stepKey="seeCorrectGrandTotal"/>
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
<see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeSuccessInvoiceMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>
<waitForPageLoad stepKey="waitForPageLoadOnDashboard"/>
<see userInput="Dashboard" selector="{{AdminHeaderSection.pageTitle}}" stepKey="seeDashboardTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeDashboardTitle">
<argument name="value" value="Dashboard"/>
</actionGroup>
<actionGroup ref="AssertAdminSuccessLoginActionGroup" stepKey="loggedInSuccessfully"/>
<actionGroup ref="AssertAdminPageIsNot404ActionGroup" stepKey="dontSee404Page"/>
</test>
Expand Down
36 changes: 36 additions & 0 deletions app/code/Magento/Backend/Test/Mftf/Test/AdminStartupPageTest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminStartupPageTest">
<annotations>
<features value="Backend"/>
<stories value="Admin should see selected Startup Page after login."/>
<title value="Admin should see selected Startup Page after login."/>
<description value="Admin should see selected Startup Page after login."/>
<severity value="MINOR"/>
</annotations>
<before>
<magentoCLI command="config:set admin/startup/menu_item_id Magento_Sales::sales_order" stepKey="selectSalesOrderStartupPage"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin"/>
</before>
<after>
<magentoCLI command="config:set admin/startup/menu_item_id Magento_Backend::dashboard" stepKey="selectDashboardStartupPage"/>
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
</after>

<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanInvalidatedCaches">
<argument name="tags" value="config full_page"/>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Usik2203 are we required to clean the full_page cache to see the changes? Is cleaning the caches really needed here?
I'd probably even completely remove this test and preserve the title assertions only.

Thank you.

</actionGroup>

<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="checkPageTitle">
<argument name="value" value="Orders"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@
<comment userInput="Replacing reload action and preserve Backward Compatibility" stepKey="waitForReloadSecond"/>

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

<switchToNextTab stepKey="switchToFrontendTab"/>
<closeTab stepKey="closeFrontendTab"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
</actionGroup>

<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceAction"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seePageNameNewInvoicePage">
<argument name="value" value="New Invoice"/>
</actionGroup>
<actionGroup ref="AdminInvoiceClickSubmitActionGroup" stepKey="clickSubmitInvoice"/>
<click selector="{{AdminOrderDetailsMainActionsSection.ship}}" stepKey="clickShipAction"/>
<seeInCurrentUrl url="{{AdminShipmentNewPage.url}}" stepKey="seeOrderShipmentUrl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
<seeElement selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="seeCreditMemo"/>
<click selector="{{AdminOrderFormItemsSection.creditMemo}}" stepKey="clickCreditMemoItem"/>
<waitForPageLoad stepKey="waitForCreditMemoPageLoaded"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoPageTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewMemoPageTitle">
<argument name="value" value="New Memo"/>
</actionGroup>
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewMemoUrlOnPage"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@
<!--Create order via Admin-->
<comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/>
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToOrderIndexPage"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeIndexPageTitle">
<argument name="value" value="Orders"/>
</actionGroup>
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewOrderPageTitle">
<argument name="value" value="Create New Order"/>
</actionGroup>

<!--Check if order can be submitted without the required fields-->
<actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder" after="seeNewOrderPageTitle">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,14 @@
<comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/>
<!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>-->
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToOrderIndexPage"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeIndexPageTitle">
<argument name="value" value="Orders"/>
</actionGroup>
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewOrderPageTitle">
<argument name="value" value="Create New Order"/>
</actionGroup>

<!--Check if order can be submitted without the required fields including email address-->
<actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,14 @@
<comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/>
<!--<actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPage"/>-->
<actionGroup ref="AdminOrdersPageOpenActionGroup" stepKey="navigateToOrderIndexPage"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeIndexPageTitle">
<argument name="value" value="Orders"/>
</actionGroup>
<click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/>
<click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewOrderPageTitle">
<argument name="value" value="Create New Order"/>
</actionGroup>

<!--Check if order can be submitted without the required fields including email address-->
<actionGroup ref="CheckRequiredFieldsNewOrderFormActionGroup" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@
<!-- Create invoice -->
<actionGroup ref="AdminOrderGridClickFirstRowActionGroup" stepKey="clickOrderRow"/>
<actionGroup ref="AdminClickInvoiceButtonOrderViewActionGroup" stepKey="clickInvoiceButton"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewInvoiceInPageTitle" after="clickInvoiceButton">
<argument name="value" value="New Invoice"/>
</actionGroup>

<!-- Verify Invoice Totals including subTotal Shipping Discount and GrandTotal -->
<see selector="{{AdminInvoiceTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeInvoiceSubTotal"/>
Expand Down Expand Up @@ -134,7 +136,9 @@
<comment userInput="Admin creates credit memo" stepKey="createCreditMemoComment"/>
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo" after="createCreditMemoComment"/>
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage" after="clickCreateCreditMemo"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle" after="seeNewCreditMemoPage"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewMemoInPageTitle" after="seeNewCreditMemoPage">
<argument name="value" value="New Memo"/>
</actionGroup>

<!-- Verify Refund Totals -->
<see selector="{{AdminCreditMemoTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeRefundSubTotal"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@
<closeAdminNotification stepKey="closeAdminNotificationInvoice" after="seeConfigurableProductInItemsOrdered"/>
<click selector="{{AdminOrderDetailsMainActionsSection.invoice}}" stepKey="clickInvoiceAction" after="closeAdminNotificationInvoice"/>
<seeInCurrentUrl url="{{AdminInvoiceNewPage.url}}" stepKey="seeOrderInvoiceUrl" after="clickInvoiceAction"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Invoice" stepKey="seePageNameNewInvoicePage" after="seeOrderInvoiceUrl"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seePageNameNewInvoicePage" after="seeOrderInvoiceUrl">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we do the same for the seePageNameMatchesOrderIdAfterInvoice stepKey, since we're checking the page title there as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

<argument name="value" value="New Invoice"/>
</actionGroup>

<!--Check Invoice Data-->
<see selector="{{AdminInvoiceOrderInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingInvoice" after="seePageNameNewInvoicePage"/>
Expand Down Expand Up @@ -132,7 +134,9 @@
<comment userInput="Admin creates credit memo" stepKey="createCreditMemoComment" after="clickOrderIdOnShipment"/>
<click selector="{{AdminOrderDetailsMainActionsSection.creditMemo}}" stepKey="clickCreateCreditMemo" after="createCreditMemoComment"/>
<seeInCurrentUrl url="{{AdminCreditMemoNewPage.url}}" stepKey="seeNewCreditMemoPage" after="clickCreateCreditMemo"/>
<see selector="{{AdminHeaderSection.pageTitle}}" userInput="New Memo" stepKey="seeNewMemoInPageTitle" after="seeNewCreditMemoPage"/>
<actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seeNewMemoInPageTitle" after="seeNewCreditMemoPage">
<argument name="value" value="New Memo"/>
</actionGroup>
<!--Check Credit Memo Order Data-->
<actionGroup ref="VerifyBasicCreditMemoInformationActionGroup" stepKey="verifyOrderCreditMemoInformation" after="seeNewMemoInPageTitle">
<argument name="customer" value="Simple_US_Customer"/>
Expand Down