Skip to content

Commit

Permalink
Merge remote-tracking branch 'github-magento/MAGETWO-91617' into EPAM…
Browse files Browse the repository at this point in the history
…-PR-16
  • Loading branch information
nikshostko committed Nov 9, 2018
2 parents 99b1094 + 6310621 commit 33c2552
Show file tree
Hide file tree
Showing 17 changed files with 240 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,20 @@
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptStoreSwitchingMessage"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>

<actionGroup name="CreatedProductConnectToWebsite">
<arguments>
<argument name="website"/>
<argument name="product"/>
</arguments>
<amOnPage url="{{AdminCatalogProductPage.url}}" stepKey="navigateToProductPage"/>
<waitForPageLoad stepKey="waitForProductsList"/>
<click stepKey="openProduct" selector="{{AdminProductGridActionSection.productName(product.name)}}"/>
<waitForPageLoad stepKey="waitForProductPage"/>
<scrollTo selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="ScrollToWebsites"/>
<click selector="{{ProductInWebsitesSection.sectionHeader}}" stepKey="openWebsitesList"/>
<waitForPageLoad stepKey="waitForWebsitesList"/>
<click selector="{{ProductInWebsitesSection.website(website.name)}}" stepKey="SelectWebsite"/>
<click selector="{{AdminProductFormAdvancedPricingSection.save}}" stepKey="clickSaveProduct"/>
<waitForPageLoad stepKey="waitForSave"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?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="AdminCreateCustomerWithWebsiteAndStoreViewActionGroup">
<arguments>
<argument name="customerData"/>
<argument name="address"/>
<argument name="website" type="string"/>
<argument name="storeView" type="string"/>
</arguments>
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="goToCustomersPage"/>
<click stepKey="addNewCustomer" selector="{{AdminCustomerGridMainActionsSection.addNewCustomer}}"/>
<selectOption stepKey="selectWebSite" selector="{{AdminCustomerAccountInformationSection.associateToWebsite}}" userInput="{{website}}"/>
<fillField stepKey="FillFirstName" selector="{{AdminCustomerAccountInformationSection.firstName}}" userInput="{{customerData.firstname}}"/>
<fillField stepKey="FillLastName" selector="{{AdminCustomerAccountInformationSection.lastName}}" userInput="{{customerData.lastname}}"/>
<fillField stepKey="FillEmail" selector="{{AdminCustomerAccountInformationSection.email}}" userInput="{{customerData.email}}"/>
<selectOption stepKey="selectStoreView" selector="{{AdminCustomerAccountInformationSection.storeView}}" userInput="{{storeView}}"/>
<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
<click stepKey="goToAddresses" selector="{{AdminCustomerAccountInformationSection.addressesButton}}"/>
<waitForPageLoad stepKey="waitForAddresses"/>
<click stepKey="clickOnAddNewAddress" selector="{{AdminCustomerAddressesSection.addNewAddress}}"/>
<waitForPageLoad stepKey="waitForAddressFields"/>
<click stepKey="thickBillingAddress" selector="{{AdminCustomerAddressesSection.defaultBillingAddress}}"/>
<click stepKey="thickShippingAddress" selector="{{AdminCustomerAddressesSection.defaultShippingAddress}}"/>
<fillField stepKey="fillFirstNameForAddress" selector="{{AdminCustomerAddressesSection.firstNameForAddress}}" userInput="{{address.firstname}}"/>
<fillField stepKey="fillLastNameForAddress" selector="{{AdminCustomerAddressesSection.lastNameForAddress}}" userInput="{{address.lastname}}"/>
<fillField stepKey="fillStreetAddress" selector="{{AdminCustomerAddressesSection.streetAddress}}" userInput="{{address.street[0]}}"/>
<fillField stepKey="fillCity" selector="{{AdminCustomerAddressesSection.city}}" userInput="{{address.city}}"/>
<selectOption stepKey="selectCountry" selector="{{AdminCustomerAddressesSection.country}}" userInput="{{address.country}}"/>
<selectOption stepKey="selectState" selector="{{AdminCustomerAddressesSection.state}}" userInput="{{address.state}}"/>
<fillField stepKey="fillZip" selector="{{AdminCustomerAddressesSection.zip}}" userInput="{{address.postcode}}"/>
<fillField stepKey="fillPhoneNumber" selector="{{AdminCustomerAddressesSection.phoneNumber}}" userInput="{{address.telephone}}"/>
<click stepKey="save" selector="{{AdminCustomerAccountInformationSection.saveCustomer}}"/>
<waitForPageLoad stepKey="waitForCustomersPage"/>
<see stepKey="seeSuccessMessage" userInput="You saved the customer."/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?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="AdminDeleteCustomerActionGroup">
<arguments>
<argument name="customerEmail"/>
</arguments>
<amOnPage url="{{AdminCustomerPage.url}}" stepKey="navigateToCustomersPage"/>
<click stepKey="chooseCustomer" selector="{{AdminCustomerGridMainActionsSection.customerCheckbox(customerEmail)}}"/>
<click stepKey="openActions" selector="{{AdminCustomerGridMainActionsSection.actions}}"/>
<waitForPageLoad stepKey="waitActions"/>
<click stepKey="delete" selector="{{AdminCustomerGridMainActionsSection.delete}}"/>
<waitForPageLoad stepKey="waitForConfirmationAlert"/>
<click stepKey="accept" selector="{{AdminCustomerGridMainActionsSection.ok}}"/>
<see stepKey="seeSuccessMessage" userInput="were deleted."/>
</actionGroup>
</actionGroups>
1 change: 1 addition & 0 deletions app/code/Magento/Customer/Test/Mftf/Data/AddressData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<data key="default_billing">Yes</data>
<data key="default_shipping">Yes</data>
<requiredEntity type="region">RegionNY</requiredEntity>
<data key="country">United States</data>
</entity>
<entity name="US_Address_CA" type="address">
<data key="firstname">John</data>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<element name="statusInactive" type="button" selector=".admin__actions-switch-label"/>
<element name="accountInformationTitle" type="text" selector=".admin__page-nav-title"/>
<element name="accountInformationButton" type="text" selector="//a/span[text()='Account Information']"/>
<element name="addressesButton" type="select" selector="//a//span[contains(text(), 'Addresses')]"/>
<element name="firstName" type="input" selector="input[name='customer[firstname]']"/>
<element name="lastName" type="input" selector="input[name='customer[lastname]']"/>
<element name="email" type="input" selector="input[name='customer[email]']"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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="AdminCustomerAddressesSection">
<element name="addNewAddress" type="button" selector="//span[text()='Add New Addresses']"/>
<element name="defaultBillingAddress" type="button" selector="//label[text()='Default Billing Address']"/>
<element name="defaultShippingAddress" type="button" selector="//label[text()='Default Shipping Address']"/>
<element name="firstNameForAddress" type="button" selector="//input[contains(@name, 'address')][contains(@name, 'firstname')]"/>
<element name="lastNameForAddress" type="button" selector="//input[contains(@name, 'address')][contains(@name, 'lastname')]"/>
<element name="streetAddress" type="button" selector="//input[contains(@name, 'street')]"/>
<element name="city" type="input" selector="//input[contains(@name, 'city')]"/>
<element name="country" type="select" selector="//select[contains(@name, 'country_id')]"/>
<element name="state" type="select" selector="//select[contains(@name, 'address[new_0][region_id]')]"/>
<element name="zip" type="input" selector="//input[contains(@name, 'postcode')]"/>
<element name="phoneNumber" type="input" selector="//input[contains(@name, 'telephone')]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
<element name="multicheck" type="checkbox" selector="#container>div>div.admin__data-grid-wrap>table>thead>tr>th.data-grid-multicheck-cell>div>label"/>
<element name="delete" type="button" selector="//*[contains(@class, 'admin__data-grid-header')]//span[contains(@class,'action-menu-item') and text()='Delete']"/>
<element name="actions" type="text" selector=".action-select"/>
<element name="customerCheckbox" type="button" selector="//*[contains(text(),'{{arg}}')]/parent::td/preceding-sibling::td/label[@class='data-grid-checkbox-cell-inner']//input" parameterized="true"/>
<element name="ok" type="button" selector="//button[@data-role='action']//span[text()='OK']"/>
</section>
</sections>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?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="AdminReviewOrderActionGroup">
<arguments>
<argument name="productName" type="string"/>
</arguments>
<click stepKey="openReports" selector="{{OrderedProductsSection.reports}}"/>
<waitForPageLoad stepKey="waitForReports" time="5"/>
<click stepKey="openOrdered" selector="{{OrderedProductsSection.ordered}}"/>
<waitForPageLoad stepKey="waitForOrdersPage" time="5"/>
<click stepKey="refresh" selector="{{OrderedProductsSection.refresh}}"/>
<waitForPageLoad stepKey="waitForOrderList" time="5"/>
<scrollTo stepKey="scrollTo" selector="{{OrderedProductsSection.total}}"/>
<see stepKey="seeOrder" userInput="{{productName}}"/>
</actionGroup>
</actionGroups>
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="OrderedProductsSection">
<element name="reports" type="button" selector="//li[@data-ui-id='menu-magento-reports-report']"/>
<element name="ordered" type="button" selector="//li[@data-ui-id='menu-magento-reports-report-products-sold']"/>
<element name="refresh" type="button" selector="//button[@title='Refresh']" timeout="30"/>
<element name="total" type="text" selector="//tfoot//th[contains(text(), 'Total')]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,30 @@
<see selector="{{AdminOrderItemsOrderedSection.productSkuColumn}}" userInput="{{product.sku}}" stepKey="seeSkuInItemsOrdered"/>
</actionGroup>

<actionGroup name="CreateOrderInStoreActionGroup">
<arguments>
<argument name="product"/>
<argument name="customer"/>
<argument name="storeView"/>
</arguments>
<amOnPage stepKey="navigateToNewOrderPage" url="{{AdminOrderCreatePage.url}}"/>
<click stepKey="chooseCustomer" selector="{{AdminOrdersGridSection.customerInOrdersSection(customer.firstname)}}"/>
<waitForPageLoad stepKey="waitForStoresPageOpened"/>
<click stepKey="chooseStore" selector="{{AdminOrderStoreScopeTreeSection.storeForOrder(storeView.name)}}"/>
<scrollToTopOfPage stepKey="scrollToTop"/>
<click selector="{{OrdersGridSection.addProducts}}" stepKey="clickOnAddProducts"/>
<waitForPageLoad stepKey="waitForProductsListForOrder"/>
<click selector="{{AdminOrdersGridSection.productForOrder(product.sku)}}" stepKey="chooseTheProduct"/>
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="addSelectedProductToOrder"/>
<waitForPageLoad stepKey="waitForProductAddedInOrder"/>
<click selector="{{AdminInvoicePaymentShippingSection.getShippingMethodAndRates}}" stepKey="openShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethods"/>
<click selector="{{AdminInvoicePaymentShippingSection.shippingMethod}}" stepKey="chooseShippingMethod"/>
<waitForPageLoad stepKey="waitForShippingMethodsThickened"/>
<click selector="{{OrdersGridSection.submitOrder}}" stepKey="submitOrder"/>
<see stepKey="seeSuccessMessageForOrder" userInput="You created the order."/>
</actionGroup>

<!--Cancel order that is in pending status-->
<actionGroup name="cancelPendingOrder">
<click selector="{{AdminOrderDetailsMainActionsSection.cancel}}" stepKey="clickCancelOrder"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@
<element name="ShippingMethod" type="text" selector=".order-shipping-address .shipping-description-title"/>
<element name="ShippingPrice" type="text" selector=".order-shipping-address .shipping-description-content .price"/>
<element name="CreateShipment" type="checkbox" selector=".order-shipping-address input[name='invoice[do_shipment]']"/>
<element name="getShippingMethodAndRates" type="button" selector="//span[text()='Get shipping methods and rates']"/>
<element name="shippingMethod" type="button" selector="//label[contains(text(), 'Fixed')]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
<section name="AdminOrderStoreScopeTreeSection">
<element name="storeTree" type="text" selector="div.tree-store-scope"/>
<element name="storeOption" type="radio" selector="//div[contains(@class, 'tree-store-scope')]//label[contains(text(), '{{name}}')]/preceding-sibling::input" parameterized="true" timeout="30"/>
<element name="storeForOrder" type="radio" selector="//div[contains(@class, 'tree-store-scope')]//label[contains(text(), '{{arg}}')]" parameterized="true" timeout="30"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@
<element name="viewBookmark" type="button" selector="//div[contains(@class, 'admin__data-grid-action-bookmarks')]/ul/li/div/a[text() = '{{label}}']" parameterized="true" timeout="30"/>
<element name="columnsDropdown" type="button" selector="div.admin__data-grid-action-columns button" timeout="30"/>
<element name="viewColumnCheckbox" type="checkbox" selector="//div[contains(@class,'admin__data-grid-action-columns')]//div[contains(@class, 'admin__field-option')]//label[text() = '{{column}}']/preceding-sibling::input" parameterized="true"/>
<element name="customerInOrdersSection" type="button" selector="(//td[contains(text(),'{{customer}}')])[1]" parameterized="true"/>
<element name="productForOrder" type="button" selector="//td[contains(text(),'{{var}}')]" parameterized="true"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<element name="createNewOrder" type="button" selector="button[title='Create New Order'"/>

<element name="website" type="radio" selector="//label[contains(text(), '{{arg}}')]" parameterized="true"/>
<element name="addProducts" type="button" selector="//span[text()='Add Products']"/>
<element name="addProducts" type="button" selector="#add_products"/>
<element name="selectProduct" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-select col-in_products')]" parameterized="true"/>
<element name="setQuantity" type="checkbox" selector="//td[contains(text(), '{{arg}}')]/following-sibling::td[contains(@class, 'col-qty')]/input" parameterized="true"/>
<element name="addProductsToOrder" type="button" selector="//span[text()='Add Selected Product(s) to Order']"/>
Expand All @@ -29,5 +29,6 @@
<element name="productPrice" type="text" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td[@class='col-price col-row-subtotal']/span" parameterized="true"/>
<element name="removeItems" type="select" selector="//span[text()='{{arg}}']/parent::td/following-sibling::td/select[@class='admin__control-select']" parameterized="true"/>
<element name="applyCoupon" type="input" selector="#coupons:code"/>
<element name="submitOrder" type="button" selector="#submit_order_top_button"/>
</section>
</sections>
12 changes: 12 additions & 0 deletions app/code/Magento/Store/Test/Mftf/Data/StoreData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,16 @@
<data key="name">Store View</data>
<data key="code">store2</data>
</entity>
<entity name="NewStoreData" type="store">
<data key="name" unique="suffix">Store</data>
<data key="code" unique="suffix">StoreCode</data>
</entity>
<entity name="NewWebSiteData" type="webSite">
<data key="name" unique="suffix">WebSite</data>
<data key="code" unique="suffix">WebSiteCode</data>
</entity>
<entity name="NewStoreViewData">
<data key="name" unique="suffix">StoreView</data>
<data key="code" unique="suffix">StoreViewCode</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,27 @@
<waitForPageLoad stepKey="waitForPageLoad2" />
<see userInput="You saved the user." stepKey="seeSuccessMessage" />
</actionGroup>

<!--Create new user with role-->
<actionGroup name="AdminCreateUserWithRoleActionGroup">
<arguments>
<argument name="role"/>
<argument name="user" defaultValue="newAdmin"/>
</arguments>
<amOnPage url="{{AdminEditUserPage.url}}" stepKey="navigateToNewUser"/>
<waitForPageLoad stepKey="waitForUsersPage" />
<fillField selector="{{AdminCreateUserSection.usernameTextField}}" userInput="{{user.username}}" stepKey="enterUserName" />
<fillField selector="{{AdminCreateUserSection.firstNameTextField}}" userInput="{{user.firstName}}" stepKey="enterFirstName" />
<fillField selector="{{AdminCreateUserSection.lastNameTextField}}" userInput="{{user.lastName}}" stepKey="enterLastName" />
<fillField selector="{{AdminCreateUserSection.emailTextField}}" userInput="{{user.username}}@magento.com" stepKey="enterEmail" />
<fillField selector="{{AdminCreateUserSection.passwordTextField}}" userInput="{{user.password}}" stepKey="enterPassword" />
<fillField selector="{{AdminCreateUserSection.pwConfirmationTextField}}" userInput="{{user.password}}" stepKey="confirmPassword" />
<fillField selector="{{AdminCreateUserSection.currentPasswordField}}" userInput="{{_ENV.MAGENTO_ADMIN_PASSWORD}}" stepKey="enterCurrentPassword" />
<scrollToTopOfPage stepKey="scrollToTopOfPage" />
<click stepKey="clickUserRole" selector="{{AdminCreateUserSection.userRoleTab}}"/>
<click stepKey="chooseRole" selector="{{AdminStoreSection.createdRoleInUserPage(role.name)}}"/>
<click selector="{{AdminCreateUserSection.saveButton}}" stepKey="clickSaveUser" />
<waitForPageLoad stepKey="waitForSaveTheUser" />
<see userInput="You saved the user." stepKey="seeSuccessMessage" />
</actionGroup>
</actionGroups>
Loading

0 comments on commit 33c2552

Please sign in to comment.