Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit 7058877

Browse files
authored
Merge pull request #63 from magento-epam/MAGETWO-62891
Magetwo 62891
2 parents 9b01481 + e60965a commit 7058877

5 files changed

+332
-0
lines changed
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
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"
9+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/actionGroupSchema.xsd">
10+
11+
<!-- Go To Product Page -->
12+
<actionGroup name="GoToProductPage">
13+
<click selector="{{GoToProductPageSection.catalog}}" stepKey="clickOnCatalog" />
14+
<waitForPageLoad stepKey="waitForPage"/>
15+
<click selector="{{GoToProductPageSection.product}}" stepKey="clickToSelectProductsItem" />
16+
<waitForPageLoad stepKey="waitForPageProducts"/>
17+
</actionGroup>
18+
19+
<!-- Create Simple Product -->
20+
<actionGroup name="CreateSimpleProduct">
21+
<arguments>
22+
<argument name="product" defaultValue="SimpleProduct"/>
23+
</arguments>
24+
<click selector="{{GoToProductPageSection.add}}" stepKey="clickToAddProduct"/>
25+
<waitForPageLoad stepKey="WaitForProductPageIsLoaded"/>
26+
<fillField selector="{{AdminAddSimpleProductSection.productName}}" userInput="{{product.name}}" stepKey="setNameForProduct"/>
27+
<fillField selector="{{AdminAddSimpleProductSection.productSku}}" userInput="{{product.sku}}" stepKey="setSKUForProduct"/>
28+
<fillField selector="{{AdminAddSimpleProductSection.productPrice}}" userInput="{{product.price}}" stepKey="setPriceForProduct"/>
29+
<fillField selector="{{AdminAddSimpleProductSection.productQuantity}}" userInput="{{product.quantity}}" stepKey="setQuantityForProduct"/>
30+
<click selector="{{AdminAddSimpleProductSection.searchOptimization}}" stepKey="clickOnSearchEngineOptimization"/>
31+
<fillField selector="{{AdminAddSimpleProductSection.urlKey}}" userInput="{{product.urlKey}}" stepKey="setSearchUrlForProduct"/>
32+
<click selector="{{AdminAddSimpleProductSection.saveButton}}" stepKey="clickSaveProduct"/>
33+
<waitForPageLoad stepKey="WaitForProductSave"/>
34+
<see userInput="You saved the product." stepKey="seeSaveConfirmation"/>
35+
</actionGroup>
36+
37+
<!--Create Account -->
38+
<actionGroup name="StorefrontCreateAccountActionGroup">
39+
<click selector="{{StorefrontCreateAccountSection.createAccount}}" stepKey="ClickToCreateAccount"/>
40+
<waitForPageLoad stepKey="waitForAccountFormIsOpened"/>
41+
<fillField selector="{{StorefrontCreateAccountSection.firstName}}" userInput="{{CreateUserData.firstName}}" stepKey="TypeFirstName"/>
42+
<fillField selector="{{StorefrontCreateAccountSection.lastName}}" userInput="{{CreateUserData.lastName}}" stepKey="TypeLastName"/>
43+
<fillField selector="{{StorefrontCreateAccountSection.email}}" userInput="{{CreateUserData.firstName}}@magento.com" stepKey="TypeEmail"/>
44+
<fillField selector="{{StorefrontCreateAccountSection.password}}" userInput="{{CreateUserData.password}}" stepKey="TypePassword"/>
45+
<waitForPageLoad stepKey="waitToConfirmPassword"/>
46+
<fillField selector="{{StorefrontCreateAccountSection.confirmPass}}" userInput="{{CreateUserData.password}}" stepKey="confirmPassword"/>
47+
<click selector="{{StorefrontCreateAccountSection.create}}" stepKey="ClickToSaveAccount"/>
48+
<waitForPageLoad stepKey="waitForAccountPageLoaded"/>
49+
</actionGroup>
50+
51+
<!--Find and add product to cart-->
52+
<actionGroup name="FindAndAddProductToCardActionGroup">
53+
<!--Navigate to a category page -->
54+
<amOnPage url="/{{SimpleProduct.name}}.html" stepKey="goToCreatedProductPage"/>
55+
<waitForPageLoad stepKey="waitForProductPageLoaded"/>
56+
<click selector="{{StorefrontAddCreatedProductToCartSection.addToCartBtn}}" stepKey="addToCart"/>
57+
<waitForElementVisible selector="{{StorefrontAddCreatedProductToCartSection.successMessage}}" time="30" stepKey="waitForProductAdded"/>
58+
<click selector="{{StorefrontAddCreatedProductToCartSection.showCard}}" stepKey="clickToOpenCard"/>
59+
<waitForPageLoad stepKey="WaitForFormOpened"/>
60+
<click selector="{{StorefrontAddCreatedProductToCartSection.proceed}}" stepKey="clickToProceedToCheckout"/>
61+
<waitForPageLoad stepKey="waitForTheFormIsOpened"/>
62+
<see userInput="Shipping Address" stepKey="seeShippingAddress"/>
63+
</actionGroup>
64+
65+
<!--Fill shipment form-->
66+
<actionGroup name="FillShipmentFormActionGroup">
67+
<fillField selector="{{ShipmentFormSection.street}}" userInput="{{Account.street}}" stepKey="SetCustomerStreetAddress"/>
68+
<fillField selector="{{ShipmentFormSection.city}}" userInput="{{Account.city}}" stepKey="SetCustomerCity"/>
69+
<fillField selector="{{ShipmentFormSection.postcode}}" userInput="{{Account.postcode}}" stepKey="SetCustomerZipCode"/>
70+
<fillField selector="{{ShipmentFormSection.telephone}}" userInput="{{Account.telephone}}" stepKey="SetCustomerPhoneNumber"/>
71+
<click selector="{{ShipmentFormSection.region}}" stepKey="clickToSetState"/>
72+
<click selector="{{ShipmentFormSection.state}}" stepKey="clickToChooseState"/>
73+
<click selector="{{ShipmentFormSection.stateAlabama}}" stepKey="chooseStateAlabama"/>
74+
<click selector="{{ShipmentFormSection.next}}" stepKey="clickToSaveShippingInfo"/>
75+
<waitForPageLoad stepKey="waitForReviewAndPaymentsPageIsLoaded"/>
76+
</actionGroup>
77+
78+
<!--Mark "My billing and shipping address are the same"-->
79+
<actionGroup name="MarkMyBillingAndShippingAddressAreTheSame">
80+
<conditionalClick selector="{{ShipmentFormSection.billingShippingAddressTheSameCheckbox}}" dependentSelector="{{ShipmentFormSection.placeOrderButton}}" visible="0" stepKey="selectkMyBillingAndShippingAddressAreTheSameCheckbox"/>
81+
<click stepKey="clickPlaceOrderButton" selector="{{ShipmentFormSection.placeOrderButton}}"/>
82+
<waitForPageLoad stepKey="waitForCheckoutPageLoaded"/>
83+
<see stepKey="seeSuccessfulMessage" userInput="Thank you for your purchase!"/>
84+
</actionGroup>
85+
86+
<!--Go To My Account Page-->
87+
<actionGroup name="GoToMyAccountPage">
88+
<click stepKey="clickCustomerNameItem" selector="{{GoToMyAccountSection.customerName}}"/>
89+
<click stepKey="clickMyAccountItem" selector="{{GoToMyAccountSection.myAccountItem}}"/>
90+
<waitForPageLoad stepKey="waitForMyAccountPageLoaded"/>
91+
</actionGroup>
92+
93+
<!--Assert That Shipping And Billing Address are the same-->
94+
<actionGroup name="AssertThatShippingAndBillingAddressTheSame">
95+
<!--Get shipping and billing addresses-->
96+
<grabTextFrom selector="{{ShipmentFormSection.shippingAddress}}" stepKey="shippingAddr"/>
97+
<grabTextFrom selector="{{ShipmentFormSection.billingAddress}}" stepKey="billingAddr"/>
98+
<!--Make sure that shipping and billing addresses are different-->
99+
<see userInput="Shipping Address" stepKey="seeShippingAddress"/>
100+
<see userInput="Billing Address" stepKey="seeBillingAddress"/>
101+
<assertEquals stepKey="assert" actual="$billingAddr" expected="$shippingAddr"/>
102+
</actionGroup>
103+
104+
<!-- Delete Created Product -->
105+
<actionGroup name="DeleteCreatedProduct">
106+
<conditionalClick selector="{{DeleteCreatedProductSection.clearAll}}" dependentSelector="{{DeleteCreatedProductSection.clearAll}}" visible="1" stepKey="clickClearAllIfThereIsAnyValue"/>
107+
<click stepKey="clickFilterButton" selector="{{DeleteCreatedProductSection.filterButton}}"/>
108+
<waitForElementVisible selector="{{DeleteCreatedProductSection.filterSKUField}}" stepKey="waitForFilterDataLoaded"/>
109+
<fillField stepKey="searchProductUsingSKUField" selector="{{DeleteCreatedProductSection.filterSKUField}}" userInput="{{SimpleProduct.sku}}"/>
110+
<click stepKey="clickFiltersApplyButton" selector="{{DeleteCreatedProductSection.filtersApplyButton}}"/>
111+
<waitForElementNotVisible selector="{{DeleteCreatedProductSection.filterSKUField}}" stepKey="waitForFilterBecomeNotVisible"/>
112+
<click selector="{{DeleteCreatedProductSection.createdProductID}}" stepKey="selectCreatedProduct"/>
113+
<wait stepKey="waitSelectCreatedProduct" time="2"/>
114+
<waitForElementVisible selector="{{DeleteCreatedProductSection.actionSelectBox}}" stepKey="waitToSelectActionVisible"/>
115+
<click stepKey="clickToSelectAction" selector="{{DeleteCreatedProductSection.actionSelectBox}}"/>
116+
<waitForElementVisible selector="{{DeleteCreatedProductSection.deleteButton}}" stepKey="waitForDeleteButtonAppeared"/>
117+
<click selector="{{DeleteCreatedProductSection.deleteButton}}" stepKey="clickToDeleteProduct"/>
118+
<waitForElementVisible selector="{{DeleteCreatedProductSection.okButton}}" stepKey="waitForOkButtonAppeared"/>
119+
<click selector="{{DeleteCreatedProductSection.okButton}}" stepKey="clickToConfirm"/>
120+
<wait stepKey="waitForRecordIsDeleted" time="2"/>
121+
<see userInput="A total of 1 record(s) have been deleted." stepKey="productDeletedSuccessfully"/>
122+
<click stepKey="clickClearAllFilterButton" selector="{{DeleteCreatedProductSection.clearAll}}"/>
123+
<wait stepKey="waitToClearAllFilters" time="2"/>
124+
</actionGroup>
125+
126+
<!--Delete created Customer -->
127+
<actionGroup name="DeleteCreatedCustomerActionGroup">
128+
<click stepKey="clickCustomerItem" selector="{{DashboardSection.customer}}"/>
129+
<wait stepKey="WaitForCustomerViewOpened" time="2"/>
130+
<click stepKey="clickCustomerAllCustomerItem" selector="{{DashboardSection.customerAllCustomer}}"/>
131+
<waitForPageLoad stepKey="WaitForCustomerPageIsLoaded"/>
132+
<fillField stepKey="searchToKeyword" selector="{{AdminCustomerAccInformationSection.searchToKeyword}}" userInput="{{CreateUserData.firstName}}"/>
133+
<click stepKey="clickSearchButton" selector="{{AdminCustomerAccInformationSection.searchButton}}"/>
134+
<waitForElementVisible stepKey="waitForFiltering" selector="{{AdminCustomerAccInformationSection.selectCustomer}}"/>
135+
<click selector="{{AdminCustomerAccInformationSection.selectCustomer}}" stepKey="ClickOnCustomer"/>
136+
<click selector="{{AdminCustomerAccInformationSection.actions}}" stepKey="ClickOnActions"/>
137+
<waitForElementVisible selector="{{AdminCustomerAccInformationSection.delete}}" stepKey="waitForDeleteButtonAppeared"/>
138+
<click selector="{{AdminCustomerAccInformationSection.delete}}" stepKey="ClickOnDelete"/>
139+
<waitForElementVisible selector="{{AdminCustomerAccInformationSection.confirm}}" stepKey="waitForConfirmButtonAppeared"/>
140+
<click selector="{{AdminCustomerAccInformationSection.confirm}}" stepKey="ClickToConfirm"/>
141+
<waitForPageLoad stepKey="waitClickToConfirmButton"/>
142+
<click stepKey="clickClearAllFilterButton" selector="{{DeleteCreatedProductSection.clearAll}}"/>
143+
<wait stepKey="waitToClearAllFilters" time="2"/>
144+
</actionGroup>
145+
146+
</actionGroups>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/DataGenerator/etc/dataProfileSchema.xsd">
11+
<entity name="SimpleProduct" type="product">
12+
<data key="name" unique="suffix">testProduct</data>
13+
<data key="sku" unique="suffix">testSku</data>
14+
<data key="price">210</data>
15+
<data key="quantity">10</data>
16+
<data key="urlKey" unique="suffix">testProduct</data>
17+
</entity>
18+
19+
<entity name="Account" type="product">
20+
<data key="street">BirminghamStreet</data>
21+
<data key="city">Birmingham</data>
22+
<data key="postcode">35005</data>
23+
<data key="telephone">222222222</data>
24+
</entity>
25+
26+
</entities>
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Page/etc/SectionObject.xsd">
11+
<section name="GoToProductPageSection">
12+
<!--Go to Catalog/Products-->
13+
<element name="catalog" type="button" selector="#menu-magento-catalog-catalog"/>
14+
<element name="product" type="button" selector="//span[contains(text(), 'Products')]"/>
15+
<element name="add" type="button" selector="#add_new_product-button"/>
16+
</section>
17+
18+
<section name="AdminAddSimpleProductSection">
19+
<element name="productName" type="input" selector=".admin__field[data-index=name] input"/>
20+
<element name="productSku" type="input" selector=".admin__field[data-index=sku] input"/>
21+
<element name="productPrice" type="input" selector=".admin__field[data-index=price] input"/>
22+
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
23+
<element name="searchOptimization" type="button" selector="//*[contains(text(),'Search Engine Optimization')]"/>
24+
<element name="urlKey" type="input" selector="//input[contains(@name,'url_key')]"/>
25+
<element name="saveButton" type="button" selector="#save-button"/>
26+
</section>
27+
28+
<section name="StorefrontCreateAccountSection">
29+
<element name="createAccount" type="button" selector="//div[contains(@class, 'panel wrapper')]//a[text()='Create an Account']"/>
30+
<element name="firstName" type="input" selector="#firstname"/>
31+
<element name="lastName" type="input" selector="#lastname"/>
32+
<element name="email" type="input" selector="#email_address"/>
33+
<element name="password" type="input" selector="#password"/>
34+
<element name="confirmPass" type="input" selector="#password-confirmation"/>
35+
<element name="create" type="button" selector="//button[@type='submit' and @title='Create an Account']"/>
36+
</section>
37+
38+
<section name="StorefrontAddCreatedProductToCartSection">
39+
<element name="addToCartBtn" type="button" selector="button.action.tocart.primary"/>
40+
<element name="successMsg" type="button" selector="div.message-success"/>
41+
<element name="showCard" type="button" selector=".action.showcart"/>
42+
<element name="proceed" type="button" selector="#top-cart-btn-checkout"/>
43+
<element name="successMessage" type="button" selector="div.message-success"/>
44+
</section>
45+
46+
<section name="ShipmentFormSection">
47+
<element name="street" type="input" selector="//*[@name='street[0]']"/>
48+
<element name="city" type="input" selector="//*[@name='city']"/>
49+
<element name="postcode" type="input" selector="//*[@name='postcode']"/>
50+
<element name="telephone" type="input" selector="//*[@name='telephone']"/>
51+
<element name="region" type="input" selector="//*[@name='region_id']"/>
52+
<element name="state" type="input" selector="//*[@name='country_id']"/>
53+
<element name="stateAlabama" type="select" selector="//*[@name='region_id']/option[contains(text(),'Alabama')]"/>
54+
<element name="next" type="input" selector="//span[contains(text(), 'Next')]"/>
55+
56+
<element name="billingShippingAddressTheSameCheckbox" type="select" selector="#billing-address-same-as-shipping-checkmo"/>
57+
<element name="placeOrderButton" type="button" selector="//span[contains(text(),'Place Order')]"/>
58+
<element name="shippingAddress" type="textarea" selector="//*[@class='box box-billing-address']//address"/>
59+
<element name="billingAddress" type="textarea" selector="//*[@class='box box-shipping-address']//address"/>
60+
</section>
61+
62+
<section name="GoToMyAccountSection">
63+
<element name="customerName" type="input" selector="//*[@class='page-header']//*[@data-bind='text: customer().fullname']"/>
64+
<element name="myAccountItem" type="input" selector="//*[@class='page-header']//*[contains(text(),'My Account')]"/>
65+
</section>
66+
67+
<section name="DeleteCreatedProductSection">
68+
<element name="searchToKeyword" type="input" selector="//*[@class='admin__data-grid-outer-wrap']/*[@class='admin__data-grid-header']//*[@class='data-grid-search-control-wrap']/input"/>
69+
<element name="searchButton" type="button" selector="//*[@class='admin__data-grid-outer-wrap']/*[@class='admin__data-grid-header']//*[@class='data-grid-search-control-wrap']/button"/>
70+
<element name="createdProductID" type="select" selector="//*[@class='data-grid-checkbox-cell-inner']/input"/>
71+
<element name="actionSelectBox" type="button" selector="//*[@class='col-xs-2']//span[text()='Actions']"/>
72+
<element name="deleteButton" type="button" selector="//div[@class='col-xs-2']//*[text()='Delete']"/>
73+
<element name="okButton" type="button" selector=".action-primary.action-accept"/>
74+
<element name="clearAll" type="button" selector="//*[@class='admin__data-grid-outer-wrap']/*[@class='admin__data-grid-header']//*[contains(text(), 'Clear all')]"/>
75+
<element name="filterButton" type="button" selector="//*[@class='admin__data-grid-outer-wrap']/*[@class='admin__data-grid-header']//*[@class='data-grid-filters-action-wrap']/button"/>
76+
<element name="filterSKUField" type="input" selector="//*[@name='sku']"/>
77+
<element name="filtersApplyButton" type="button" selector="//*[contains(text(),'Apply Filters')]"/>
78+
</section>
79+
80+
<section name="DashboardSection">
81+
<element name="customerAllCustomer" type="button" selector="//*[@data-ui-id='menu-magento-customer-customer-manage']"/>
82+
<element name="customer" type="button" selector="#menu-magento-customer-customer"/>
83+
</section>
84+
85+
<section name="AdminCustomerAccInformationSection">
86+
<element name="searchToKeyword" type="input" selector="//*[@class='admin__data-grid-outer-wrap']/*[@class='admin__data-grid-header']//*[@class='data-grid-search-control-wrap']/input"/>
87+
<element name="searchButton" type="button" selector="//*[@class='admin__data-grid-outer-wrap']/*[@class='admin__data-grid-header']//*[@class='data-grid-search-control-wrap']/button"/>
88+
<element name="selectCustomer" type="checkbox" selector="//*[@class='admin__data-grid-wrap' and @data-role='grid-wrapper']//*[@class='data-grid-multicheck-cell']/div/label"/>
89+
<element name="actions" type="button" selector="//div[@class='admin__data-grid-header']//div[@class='col-xs-2']//span[text()='Actions']"/>
90+
<element name="delete" type="button" selector="//div[@class='col-xs-2']//span[text()='Delete']"/>
91+
<element name="confirm" type="button" selector=".action-primary.action-accept"/>
92+
</section>
93+
94+
</sections>

0 commit comments

Comments
 (0)