Skip to content

Commit

Permalink
Merge pull request #3693 from magento-tsg/2.2-develop-mftf-pr14
Browse files Browse the repository at this point in the history
[TSG] MFTF for 2.2 (pr14) (2.2-develop)
  • Loading branch information
Alexander Akimov authored Feb 5, 2019
2 parents a72e4d1 + bb6c56c commit 1548d5a
Show file tree
Hide file tree
Showing 38 changed files with 560 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminMainActionsSection">
<element name="save" type="button" selector="#save" timeout="30"/>
<element name="saveAndContinue" type="button" selector="button[id*=save_and_]" timeout="30"/>
<element name="delete" type="button" selector="#delete"/>
<element name="add" type="button" selector="#add" timeout="30"/>
<element name="back" type="button" selector="#back" timeout="30"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,35 @@
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSectionAssert"/>
<seeInField userInput="{{simpleProduct.urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="assertFieldUrlKey"/>
</actionGroup>

<!--Create a Simple Product-->
<actionGroup name="CreateSimpleProductAndAddToWebsite">
<arguments>
<argument name="product"/>
<argument name="website" type="string"/>
</arguments>
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToCatalogProductGrid"/>
<click selector="{{AdminProductGridActionSection.addProductToggle}}" stepKey="clickAddProductDropdown"/>
<click selector="{{AdminProductGridActionSection.addSimpleProduct}}" stepKey="clickAddSimpleProduct"/>
<fillField userInput="{{product.name}}" selector="{{AdminProductFormSection.productName}}" stepKey="fillProductName"/>
<fillField userInput="{{product.sku}}" selector="{{AdminProductFormSection.productSku}}" stepKey="fillProductSKU"/>
<fillField userInput="{{product.price}}" selector="{{AdminProductFormSection.productPrice}}" stepKey="fillProductPrice"/>
<fillField userInput="{{product.quantity}}" selector="{{AdminProductFormSection.productQuantity}}" stepKey="fillProductQuantity"/>
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openProductInWebsites"/>
<click selector="{{ProductInWebsitesSection.website(website)}}" stepKey="selectWebsite"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSave"/>
<waitForPageLoad stepKey="waitForProductPageSave"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
</actionGroup>

<actionGroup name="AdminAssignProductToCategory">
<arguments>
<argument name="productId" type="string"/>
<argument name="categoryName" type="string"/>
</arguments>
<amOnPage url="{{AdminProductEditPage.url(productId)}}" stepKey="amOnPage"/>
<searchAndMultiSelectOption selector="{{AdminProductFormSection.categoriesDropdown}}" parameterArray="[{{categoryName}}]" stepKey="selectCategory"/>
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
<see selector="{{AdminMessagesSection.success}}" userInput="You saved the product." stepKey="seeSaveProductMessage"/>
</actionGroup>
</actionGroups>
13 changes: 13 additions & 0 deletions app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,19 @@
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
</entity>
<entity name="ApiSimpleTwoHidden" type="product2">
<data key="sku" unique="suffix">api-simple-product-two</data>
<data key="type_id">simple</data>
<data key="attribute_set_id">4</data>
<data key="visibility">1</data>
<data key="name" unique="suffix">Api Simple Product Two</data>
<data key="price">234.00</data>
<data key="urlKey" unique="suffix">api-simple-product-two</data>
<data key="status">1</data>
<data key="quantity">100</data>
<requiredEntity type="product_extension_attribute">EavStockItem</requiredEntity>
<requiredEntity type="custom_attribute">CustomAttributeProductAttribute</requiredEntity>
</entity>
<entity name="ProductWithOptions2" type="product">
<var key="sku" entityType="product" entityKey="sku" />
<requiredEntity type="product_option">ProductOptionDropDownWithLongValuesTitle</requiredEntity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
<actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite">
<argument name="websiteName" value="{{SecondWebsite.name}}"/>
</actionGroup>
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearWebsitesFilters"/>
<!--Clear products filter-->
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearProductsFilters"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
<!-- Logged in user checkout filling shipping section -->
<actionGroup name="LoggedInUserCheckoutFillingShippingSectionActionGroup">
<arguments>
<argument name="customerVar"/>
<argument name="customerAddressVar"/>
<argument name="customerVar" defaultValue="CustomerEntityOne"/>
<argument name="customerAddressVar" defaultValue="CustomerAddressSimple"/>
</arguments>
<waitForElementVisible selector="{{CheckoutShippingSection.firstName}}" stepKey="waitForFirstNameFieldAppears" time="30"/>
<fillField selector="{{CheckoutShippingSection.firstName}}" userInput="{{customerVar.firstname}}" stepKey="enterFirstName"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
<element name="blockSummary" type="button" selector="#block-summary"/>
<element name="discountAmount" type="text" selector="td[data-th='Discount']"/>
<element name="totalsElementByPosition" type="text" selector=".data.table.totals > tbody tr:nth-of-type({{value}}) > th" parameterized="true"/>
<element name="tableTotals" type="text" selector="#cart-totals .data.table.totals"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
<element name="itemQuantity" type="input" selector="//a[text()='{{productName}}']/../..//input[contains(@class,'cart-item-qty')]" parameterized="true"/>
<element name="itemQuantityUpdate" type="button" selector="//a[text()='{{productName}}']/../..//span[text()='Update']" parameterized="true"/>
<element name="emptyCart" type="text" selector=".counter.qty.empty"/>
<element name="minicartContent" type="block" selector="#minicart-content-wrapper"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="AdminCmsBlockEditPage" url="/cms/block/edit/id/{{var1}}" area="admin" module="Magento_Cms" parameterized="true">
<section name="AdminCmsBlockContentSection" />
<section name="AdminMediaGallerySection" />
</page>
</pages>
3 changes: 2 additions & 1 deletion app/code/Magento/Cms/Test/Mftf/Page/StorefrontHomePage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
-->

<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/PageObject.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="StorefrontHomePage" url="/" module="Magento_Cms" area="storefront">
<section name="StorefrontHeaderSection"/>
<section name="StorefrontQuickSearchSection"/>
<section name="StorefrontHeaderCurrencySwitcherSection"/>
<section name="StorefrontCmsPageSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminMediaGallerySection">
<element name="imageSelected" type="text" selector="//small[text()='{{imageName}}']/parent::*[@class='filecnt selected']" parameterized="true"/>
<element name="uploadImage" type="file" selector="input.fileupload" />
<element name="insertFile" type="text" selector="#insert_files"/>
<element name="imageBlockByName" type="block" selector="//div[@data-row='file'][contains(., '{{imageName}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontCmsPageSection">
<element name="imageSource" type="text" selector="img[src*='{{imageName}}']" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminSalesConfigSection">
<element name="enableMAPUseSystemValue" type="checkbox" selector="#sales_msrp_enabled_inherit"/>
<element name="enableMAPSelect" type="select" selector="#sales_msrp_enabled"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,17 @@
<requiredEntity createDataKey="getConfigAttributeOption1"/>
</createData>
</actionGroup>

<!-- Create the configurable product, children are not visible individually -->
<actionGroup name="AdminCreateApiConfigurableProductWithHiddenChildActionGroup" extends="AdminCreateApiConfigurableProductActionGroup">
<!-- Create the 2 children that will be a part of the configurable product -->
<createData entity="ApiSimpleOneHidden" stepKey="createConfigChildProduct1">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption1"/>
</createData>
<createData entity="ApiSimpleTwoHidden" stepKey="createConfigChildProduct2">
<requiredEntity createDataKey="createConfigProductAttribute"/>
<requiredEntity createDataKey="getConfigAttributeOption2"/>
</createData>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="OpenEditCustomerFromAdminActionGroup" extends="clearFiltersAdminDataGrid">
<arguments>
<argument name="customer"/>
<argument name="customer" defaultValue="CustomerEntityOne"/>
</arguments>
<amOnPage url="{{AdminCustomerPage.url}}" before="waitForPageLoad" stepKey="navigateToCustomers"/>
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="openFilter"/>
<fillField userInput="{{customer.email}}" selector="{{AdminCustomerFiltersSection.emailInput}}" stepKey="filterEmail"/>
<click selector="{{AdminCustomerFiltersSection.apply}}" stepKey="applyFilter"/>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
<click selector="{{AdminCustomerGridSection.firstRowEditLink}}" stepKey="clickEdit"/>
<waitForPageLoad stepKey="waitForPageLoad2" />
<waitForPageLoad stepKey="waitForPageLoad" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
<!--Delete a customer by Email by filtering grid and using delete action-->
<actionGroup name="RemoveCustomerFromAdminActionGroup">
<arguments>
<argument name="customer"/>
<argument name="customer" defaultValue="CustomerEntityOne"/>
</arguments>
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomers"/>
<waitForPageLoad stepKey="waitForPageLoad1" />
<conditionalClick selector="{{AdminCustomerFiltersSection.clearFilters}}" dependentSelector="{{AdminCustomerFiltersSection.clearFilters}}" visible="true" stepKey="clickClearFiltersInitial"/>
<click selector="{{AdminCustomerFiltersSection.filtersButton}}" stepKey="openFilter"/>
<fillField userInput="{{customer.email}}" selector="{{AdminCustomerFiltersSection.emailInput}}" stepKey="filterEmail"/>
Expand All @@ -28,6 +27,6 @@
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="confirmProductDelete"/>
<see selector="{{AdminCustomerMessagesSection.successMessage}}" userInput="A total of 1 record(s) were deleted." stepKey="seeSuccessMessage"/>
<conditionalClick selector="{{AdminCustomerFiltersSection.clearFilters}}" dependentSelector="{{AdminCustomerFiltersSection.clearFilters}}" visible="true" stepKey="clickClearFilters"/>
<waitForPageLoad stepKey="waitForPageLoad2"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
<actionGroup name="SignUpNewUserFromStorefrontActionGroup">
<arguments>
<argument name="Customer"/>
<argument name="Customer" defaultValue="CustomerEntityOne"/>
</arguments>
<amOnPage url="{{StorefrontHomePage.url}}" stepKey="amOnStorefrontPage"/>
<waitForPageLoad stepKey="waitForStorefrontPage"/>
<click selector="{{StorefrontPanelHeaderSection.createAnAccountLink}}" stepKey="clickOnCreateAccountLink"/>
<fillField userInput="{{Customer.firstname}}" selector="{{StorefrontCustomerCreateFormSection.firstnameField}}" stepKey="fillFirstName"/>
<fillField userInput="{{Customer.lastname}}" selector="{{StorefrontCustomerCreateFormSection.lastnameField}}" stepKey="fillLastName"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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">

<!--Create an Account. Check Sign Up for Newsletter checkbox -->
<actionGroup name="StorefrontCreateNewAccountNewsletterChecked" extends="SignUpNewUserFromStorefrontActionGroup">
<checkOption selector="{{StorefrontCustomerCreateFormSection.signUpForNewsletter}}" stepKey="selectSignUpForNewsletterCheckbox" after="fillLastName"/>
<see stepKey="seenewsletterDescription" userInput='You are subscribed to "General Subscription".' selector="{{StorefrontCustomerDashboardAccountInformationSection.newsletterDescription}}" />
</actionGroup>

<!--Check Subscribed Newsletter via StoreFront-->
<actionGroup name="CheckSubscribedNewsletterActionGroup">
<amOnPage url="{{StorefrontNewsletterManagePage.url}}" stepKey="goToNewsletterManage"/>
<seeCheckboxIsChecked selector="{{StorefrontNewsletterManageSection.subscriptionCheckbox}}" stepKey="checkSubscribedNewsletter"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="StorefrontNewsletterManagePage" url="newsletter/manage/" area="storefront" module="Magento_Newsletter">
<section name="StorefrontNewsletterManageSection"/>
</page>
</pages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontCustomerCreateFormSection">
<element name="signUpForNewsletter" type="checkbox" selector="#is_subscribed"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontCustomerDashboardAccountInformationSection">
<element name="newsletterDescription" type="text" selector=".box-newsletter p"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="StorefrontNewsletterManageSection">
<element name="subscriptionCheckbox" type="checkbox" selector="#subscription" />
</section>
</sections>
Loading

0 comments on commit 1548d5a

Please sign in to comment.