From 29ddaf923eb8e2c5ae9b0a9c2022c561231e9893 Mon Sep 17 00:00:00 2001 From: Oleh Usik Date: Fri, 16 Apr 2021 13:55:47 +0300 Subject: [PATCH 1/2] Added AdminStartupPageTest and AssertAdminPageTitleActionGroup --- .../AssertAdminPageTitleActionGroup.xml | 21 +++++++++++ .../Test/AdminDashboardWithChartsTest.xml | 4 ++- .../AdminLoginAfterJSMinificationTest.xml | 4 ++- .../Test/Mftf/Test/AdminStartupPageTest.xml | 36 +++++++++++++++++++ ...dAreaSessionMustNotAffectAdminAreaTest.xml | 4 ++- .../CancelOrdersInOrderSalesReportTest.xml | 4 ++- ...vailabilityCreditMemoWithNoPaymentTest.xml | 4 ++- ...ubmitsOrderPaymentMethodValidationTest.xml | 8 +++-- ...minSubmitsOrderWithAndWithoutEmailTest.xml | 8 +++-- ...rderWithAndWithoutFieldsValidationTest.xml | 8 +++-- ...editMemoTotalAfterShippingDiscountTest.xml | 8 +++-- .../Test/Mftf/Test/EndToEndB2CAdminTest.xml | 8 +++-- 12 files changed, 102 insertions(+), 15 deletions(-) create mode 100644 app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminPageTitleActionGroup.xml create mode 100644 app/code/Magento/Backend/Test/Mftf/Test/AdminStartupPageTest.xml diff --git a/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminPageTitleActionGroup.xml b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminPageTitleActionGroup.xml new file mode 100644 index 0000000000000..4154f57d3ce85 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/ActionGroup/AssertAdminPageTitleActionGroup.xml @@ -0,0 +1,21 @@ + + + + + + + Check Admin Page Title is present and correct. + + + + + + + + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml index bfb3d0b23b064..2248b6f21265e 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminDashboardWithChartsTest.xml @@ -87,7 +87,9 @@ - + + + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml index af0a5751a7488..097a7064f0185 100644 --- a/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminLoginAfterJSMinificationTest.xml @@ -32,7 +32,9 @@ - + + + diff --git a/app/code/Magento/Backend/Test/Mftf/Test/AdminStartupPageTest.xml b/app/code/Magento/Backend/Test/Mftf/Test/AdminStartupPageTest.xml new file mode 100644 index 0000000000000..cd79edbd15864 --- /dev/null +++ b/app/code/Magento/Backend/Test/Mftf/Test/AdminStartupPageTest.xml @@ -0,0 +1,36 @@ + + + + + + + + + + <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"/> + </actionGroup> + + <actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="checkPageTitle"> + <argument name="value" value="Orders"/> + </actionGroup> + </test> +</tests> diff --git a/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml b/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml index e026bee87dcd4..eeac1c2fe1124 100644 --- a/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml +++ b/app/code/Magento/PageCache/Test/Mftf/Test/AdminFrontendAreaSessionMustNotAffectAdminAreaTest.xml @@ -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"/> diff --git a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml index 54d3059f24532..8457cc34f7983 100644 --- a/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml +++ b/app/code/Magento/Reports/Test/Mftf/Test/CancelOrdersInOrderSalesReportTest.xml @@ -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"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml index 140a54b4b6e15..5964c656aa99d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminAvailabilityCreditMemoWithNoPaymentTest.xml @@ -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> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml index addf978235af4..86049d248dd0c 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderPaymentMethodValidationTest.xml @@ -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"> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml index 7c2309eeb7be3..d1067ba39c6c9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutEmailTest.xml @@ -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"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml index db779a7340b07..159c9728abca9 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/AdminSubmitsOrderWithAndWithoutFieldsValidationTest.xml @@ -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"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml index 3ee973ff2b03f..fd4a93775950f 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/CreditMemoTotalAfterShippingDiscountTest.xml @@ -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"/> @@ -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"/> diff --git a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 2a3284e7e8e35..88e5332d3b10d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -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"> + <argument name="value" value="New Invoice"/> + </actionGroup> <!--Check Invoice Data--> <see selector="{{AdminInvoiceOrderInformationSection.orderStatus}}" userInput="Pending" stepKey="seeOrderPendingInvoice" after="seePageNameNewInvoicePage"/> @@ -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"/> From 3cb57d8e8c2c1eb235fab883a66324b37960214b Mon Sep 17 00:00:00 2001 From: Oleh Usik <o.usik@atwix.com> Date: Tue, 22 Jun 2021 15:43:09 +0300 Subject: [PATCH 2/2] apply additional changes --- .../Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml index 88e5332d3b10d..5e05e6b8a456d 100644 --- a/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml +++ b/app/code/Magento/Sales/Test/Mftf/Test/EndToEndB2CAdminTest.xml @@ -110,7 +110,9 @@ <!--Invoice created successfully--> <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPageInvoice" after="clickSubmitInvoice"/> <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="The invoice has been created." stepKey="seeInvoiceCreateSuccess" after="seeViewOrderPageInvoice"/> - <see selector="{{AdminHeaderSection.pageTitle}}" userInput="$getOrderId" stepKey="seePageNameMatchesOrderIdAfterInvoice" after="seeInvoiceCreateSuccess"/> + <actionGroup ref="AssertAdminPageTitleActionGroup" stepKey="seePageNameMatchesOrderIdAfterInvoice" after="seeInvoiceCreateSuccess"> + <argument name="value" value="{$getOrderId}"/> + </actionGroup> <click selector="{{AdminOrderDetailsOrderViewSection.invoices}}" stepKey="clickOrderInvoicesTab" after="seePageNameMatchesOrderIdAfterInvoice"/> <waitForLoadingMaskToDisappear stepKey="waitForInvoiceGridLoadingMask" after="clickOrderInvoicesTab"/>