Skip to content

Commit 4184f63

Browse files
authored
Merge pull request #4537 from magento-tsg/2.3-develop-mftf-pr19
[TSG] MFTF for 2.3 (pr19) (2.3-develop)
2 parents 794977a + c483819 commit 4184f63

14 files changed

+293
-6
lines changed

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,14 @@
392392
<waitForPageLoad stepKey="waitForSave"/>
393393
</actionGroup>
394394

395+
<!-- Action group assign to one website and unassign from another -->
396+
<actionGroup name="AdminProcessProductWebsitesActionGroup" extends="CreatedProductConnectToWebsite">
397+
<arguments>
398+
<argument name="websiteToUnassign"/>
399+
</arguments>
400+
<uncheckOption selector="{{ProductInWebsitesSection.website(websiteToUnassign.name)}}" after="SelectWebsite" stepKey="uncheckWebsite"/>
401+
</actionGroup>
402+
395403
<!--Check tier price with a discount percentage on product-->
396404
<actionGroup name="AssertDiscountsPercentageOfProducts">
397405
<arguments>
@@ -542,4 +550,11 @@
542550
<remove keyForRemoval="seeCheckboxForWebsite"/>
543551
<seeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsChecked"/>
544552
</actionGroup>
553+
554+
<!-- You are on product Edit Page -->
555+
<!-- Assert checkbox is not checked for website in Product In Websites -->
556+
<actionGroup name="AssertProductIsNotAssignedToWebsite" extends="AssertWebsiteIsAvailableInProductWebsites">
557+
<remove keyForRemoval="seeCheckboxForWebsite"/>
558+
<dontSeeCheckboxIsChecked selector="{{ProductInWebsitesSection.website(website)}}" after="expandProductWebsitesSection" stepKey="seeCustomWebsiteIsNotChecked"/>
559+
</actionGroup>
545560
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<!-- Assert 404 Page Not Found on product detail page -->
11+
<actionGroup name="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup">
12+
<arguments>
13+
<argument name="product"/>
14+
</arguments>
15+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="Whoops, our bad..." stepKey="assert404Page"/>
16+
<dontSee selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product.name}}" stepKey="dontSeeProductName"/>
17+
<seeInCurrentUrl url="/{{product.custom_attributes[url_key]}}.html" stepKey="checkProductUrl"/>
18+
</actionGroup>
19+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
9+
<!-- Action group opens product detail page from second website using Store code in URL option -->
10+
<actionGroup name="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup">
11+
<arguments>
12+
<argument name="product"/>
13+
<argument name="storeView"/>
14+
</arguments>
15+
<amOnPage url="/{{storeView.code}}/{{product.custom_attributes[url_key]}}.html" stepKey="openProductPageUsingStoreCodeInUrl"/>
16+
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="{{product.name}}" stepKey="assertProductName"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
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="AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Edit products"/>
15+
<title value="Admin should be able to associate simple product to websites"/>
16+
<description value="Admin should be able to associate simple product to websites"/>
17+
<testCaseId value="MC-3483"/>
18+
<group value="catalog"/>
19+
<severity value="AVERAGE"/>
20+
</annotations>
21+
22+
<before>
23+
<magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/>
24+
<createData entity="secondCustomWebsite" stepKey="createCustomWebsite"/>
25+
<createData entity="SimpleProduct2" stepKey="createSimpleProduct"/>
26+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
27+
<actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore">
28+
<argument name="Website" value="secondCustomWebsite"/>
29+
<argument name="storeGroup" value="customStoreGroup"/>
30+
</actionGroup>
31+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView">
32+
<argument name="StoreGroup" value="customStoreGroup"/>
33+
<argument name="customStore" value="customStoreEN"/>
34+
</actionGroup>
35+
</before>
36+
37+
<after>
38+
<magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToNo"/>
39+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
40+
<!-- Delete second website -->
41+
<actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteCustomWeWebsite">
42+
<argument name="websiteName" value="$createCustomWebsite.website[name]$"/>
43+
</actionGroup>
44+
<actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetFiltersOnStoresIndexPage"/>
45+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToResetFilters"/>
46+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/>
47+
<actionGroup ref="logout" stepKey="logout"/>
48+
</after>
49+
50+
<!-- 1. Go to product page in admin panel to edit -->
51+
<actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToAssociateToSecondWebsite"/>
52+
<actionGroup ref="filterProductGridByName2" stepKey="filterProductInGrid">
53+
<argument name="name" value="$$createSimpleProduct.name$$"/>
54+
</actionGroup>
55+
56+
<!-- 2. Go to Product in Websites tab, unassign product from Main website and assign it to Second website -->
57+
<actionGroup ref="AdminProcessProductWebsitesActionGroup" stepKey="processProductWebsites">
58+
<argument name="website" value="secondCustomWebsite"/>
59+
<argument name="websiteToUnassign" value="_defaultWebsite"/>
60+
<argument name="product" value="$$createSimpleProduct$$"/>
61+
</actionGroup>
62+
<actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked">
63+
<argument name="website" value="$createCustomWebsite.website[name]$"/>
64+
</actionGroup>
65+
<actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked">
66+
<argument name="website" value="{{_defaultWebsite.name}}"/>
67+
</actionGroup>
68+
69+
<!-- 3. Go to frontend and open Simple product on Main website and assert 404 page-->
70+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
71+
<argument name="productUrl" value="$createSimpleProduct.custom_attributes[url_key]$"/>
72+
</actionGroup>
73+
<actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="assertPageNotFoundErrorOnProductDetailPage">
74+
<argument name="product" value="$$createSimpleProduct$$"/>
75+
</actionGroup>
76+
77+
<!-- 4. Open Simple product on Second website and assert its name -->
78+
<actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl">
79+
<argument name="product" value="$$createSimpleProduct$$"/>
80+
<argument name="storeView" value="customStoreEN"/>
81+
</actionGroup>
82+
</test>
83+
</tests>

app/code/Magento/Checkout/Test/Mftf/Section/StorefrontProductInfoMainSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontProductInfoMainSection">
1212
<element name="AddToCart" type="button" selector="#product-addtocart-button"/>
13+
<element name="updateCart" type="button" selector="#product-updatecart-button" timeout="30"/>
1314
</section>
1415
</sections>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
<!-- Set base currency -->
12+
<actionGroup name="AdminSetBaseCurrencyActionGroup" extends="AdminSaveConfigActionGroup">
13+
<arguments>
14+
<argument name="currency" type="string"/>
15+
</arguments>
16+
<uncheckOption selector="{{CurrencySetupSection.baseCurrencyUseDefault}}" before="clickSaveConfigBtn" stepKey="uncheckUseDefaultOption"/>
17+
<selectOption selector="{{CurrencySetupSection.baseCurrency}}" userInput="{{currency}}" after="uncheckUseDefaultOption" stepKey="setBaseCurrencyField"/>
18+
</actionGroup>
19+
</actionGroups>

app/code/Magento/CurrencySymbol/Test/Mftf/Section/CurrencySetupSection.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="CurrencySetupSection">
1212
<element name="allowCurrencies" type="select" selector="#currency_options_allow"/>
13+
<element name="baseCurrency" type="select" selector="#currency_options_base"/>
14+
<element name="baseCurrencyUseDefault" type="checkbox" selector="#currency_options_base_inherit"/>
1315
<element name="currencyOptions" type="select" selector="#currency_options-head"/>
1416
</section>
15-
</sections>
17+
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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="AdminCreateCustomerWithDefaultAddressWithoutPhoneActionGroup">
12+
<arguments>
13+
<argument name="customer" defaultValue="Simple_US_Customer"/>
14+
<argument name="address" defaultValue="US_Address_NY"/>
15+
</arguments>
16+
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
17+
<click selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}" stepKey="addNewCustomer"/>
18+
<fillField selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customer.firstname}}" stepKey="fillFirstName"/>
19+
<fillField selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customer.lastname}}" stepKey="fillLastName"/>
20+
<fillField selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customer.email}}" stepKey="fillEmail"/>
21+
<click selector="{{AdminMainActionsSection.saveAndContinue}}" stepKey="clickSaveAndContinue"/>
22+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
23+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the customer." stepKey="seeSuccessMessage"/>
24+
<click selector="{{AdminCustomerAccountInformationSection.addressesButton}}" stepKey="goToAddresses"/>
25+
<waitForPageLoad stepKey="waitForAddresses"/>
26+
<click selector="{{AdminCustomerAddressesSection.addNewAddress}}" stepKey="clickOnAddNewAddress"/>
27+
<waitForPageLoad stepKey="waitForAddressFieldsLoad"/>
28+
<click selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}" stepKey="defaultBillingAddressSetYes"/>
29+
<click selector="{{AdminCustomerAddressesSection.defaultShippingAddress}}" stepKey="defaultShippingAddressSetYes"/>
30+
<fillField selector="{{AdminCustomerAddressesSection.firstNameForAddress}}" userInput="{{address.firstname}}" stepKey="fillFirstNameForAddress"/>
31+
<fillField selector="{{AdminCustomerAddressesSection.lastNameForAddress}}" userInput="{{address.lastname}}" stepKey="fillLastNameForAddress"/>
32+
<fillField selector="{{AdminCustomerAddressesSection.streetAddress}}" userInput="{{address.street[0]}}" stepKey="fillStreetAddress"/>
33+
<fillField selector="{{AdminCustomerAddressesSection.city}}" userInput="{{address.city}}" stepKey="fillCity"/>
34+
<selectOption selector="{{AdminCustomerAddressesSection.country}}" userInput="{{address.country}}" stepKey="selectCountry"/>
35+
<selectOption selector="{{AdminCustomerAddressesSection.state}}" userInput="{{address.state}}" stepKey="selectState"/>
36+
<fillField selector="{{AdminCustomerAddressesSection.zip}}" userInput="{{address.postcode}}" stepKey="fillZip"/>
37+
<click selector="{{AdminSlideOutDialogSection.saveButton}}" stepKey="saveAddress"/>
38+
<dontSee selector="{{AdminCustomerAddressesSection.phoneNumberRequiredMessage}}" stepKey="dontSeePhoneErrorMessage"/>
39+
<click selector="{{AdminMainActionsSection.save}}" stepKey="save"/>
40+
<waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessfullyCreatedMessage"/>
41+
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the customer." stepKey="seeSuccessMessageAgain"/>
42+
</actionGroup>
43+
</actionGroups>

app/code/Magento/Customer/Test/Mftf/Test/VerifyDisabledCustomerGroupFieldTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@
2626

2727
<!-- 2. Navigate to Customers > Customer Groups -->
2828
<amOnPage url="{{AdminCustomerGroupPage.url}}" stepKey="amOnCustomerGroupPage" />
29-
<waitForPageLoad stepKey="waitForCustomerGroupsPageLoad" />
30-
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/>
29+
<conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFiltersIfTheySet"/>
3130

3231
<!-- 3. Select system Customer Group specified in data set from grid -->
3332
<click selector="{{AdminCustomerGroupMainSection.editButtonByCustomerGroupCode(NotLoggedInCustomerGroup.code)}}" stepKey="clickOnEditCustomerGroup" />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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+
<!-- Add Configurable Product with Swatch attribute to the cart -->
12+
<actionGroup name="StorefrontAddProductWithSwatchesToTheCartActionGroup" extends="StorefrontAddProductToCartWithQtyActionGroup">
13+
<arguments>
14+
<argument name="product"/>
15+
<argument name="productOption" type="string"/>
16+
</arguments>
17+
<remove keyForRemoval="seeSuccessSaveMessage"/>
18+
<click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" after="waitForStorefrontProductPageLoad" stepKey="clickSelectOption"/>
19+
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added {{product.name}} to your shopping cart." after="waitForSuccessMessage" stepKey="seeAddToCartSuccessMessage"/>
20+
</actionGroup>
21+
22+
<!-- Update Configurable Product with Swatch attribute in the cart -->
23+
<actionGroup name="StorefrontUpdateCartConfigurableProductWithSwatches">
24+
<arguments>
25+
<argument name="product"/>
26+
<argument name="productOption" type="string"/>
27+
</arguments>
28+
<click selector="{{CheckoutCartProductSection.nthEditButton('1')}}" stepKey="clickEditConfigurableProductButton"/>
29+
<waitForPageLoad stepKey="waitForStorefrontProductPageLoad"/>
30+
<click selector="{{StorefrontProductInfoMainSection.visualSwatchOption(productOption)}}" stepKey="changeSwatchAttributeOption"/>
31+
<click selector="{{StorefrontProductInfoMainSection.updateCart}}" stepKey="clickUpdateCartButton"/>
32+
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
33+
<see selector="{{StorefrontMessagesSection.success}}" userInput="{{product.name}} was updated in your shopping cart." stepKey="assertSuccessMessage"/>
34+
</actionGroup>
35+
</actionGroups>

0 commit comments

Comments
 (0)