|
10 | 10 | xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
|
11 | 11 | <test name="SimpleProductTwoCustomOptions">
|
12 | 12 | <annotations>
|
13 |
| - <title value="Create simple product with two custom options"/> |
| 13 | + <features value="CustomOptions" /> |
| 14 | + <stories value="Create simple product with two custom options" /> |
| 15 | + <title value="Admin should be able to create simple product with two custom options"/> |
14 | 16 | <description value="Admin should be able to create simple product with two custom options"/>
|
15 | 17 | <severity value="AVERAGE"/>
|
16 | 18 | <testCaseId value="MC-248"/>
|
17 | 19 | <group value="Levi"/>
|
18 | 20 | </annotations>
|
19 | 21 | <before>
|
| 22 | + <!-- log in as admin --> |
20 | 23 | <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
|
| 24 | + |
| 25 | + <!--Create product--> |
| 26 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 27 | + <waitForPageLoad stepKey="waitForProductIndexPage"/> |
| 28 | + <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> |
| 29 | + <argument name="product" value="SimpleProduct3"/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> |
| 32 | + <argument name="product" value="SimpleProduct3"/> |
| 33 | + </actionGroup> |
21 | 34 | </before>
|
22 | 35 | <after>
|
| 36 | + <!-- Delete the created product --> |
| 37 | + <actionGroup ref="deleteProductUsingProductGrid" stepKey="deleteProduct"> |
| 38 | + <argument name="product" value="SimpleProduct3"/> |
| 39 | + </actionGroup> |
23 | 40 | <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
|
24 | 41 | </after>
|
25 | 42 | <!-- ADD TEST STEPS HERE -->
|
26 | 43 |
|
27 |
| - <!--Create product--> |
28 |
| - <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
29 |
| - <waitForPageLoad stepKey="waitForProductIndexPage"/> |
30 |
| - <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> |
31 |
| - <actionGroup ref="goToCreateProductPage" stepKey="goToCreateSimpleProduct"> |
32 |
| - <argument name="product" value="SimpleProduct3"/> |
| 44 | + <!-- Create a custom option with 2 values --> |
| 45 | + <actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption1"> |
| 46 | + <argument name="categoryName" value="ProductOptionRadiobutton.title"/> |
| 47 | + <argument name="productOption" value="ProductOptionField"/> |
| 48 | + <argument name="productOption2" value="ProductOptionField2"/> |
33 | 49 | </actionGroup>
|
34 |
| - <actionGroup ref="fillMainProductFormNoWeight" stepKey="fillSimpleProductMain"> |
35 |
| - <argument name="product" value="SimpleProduct3"/> |
| 50 | + |
| 51 | + <!-- Create another custom option with 2 values --> |
| 52 | + <actionGroup ref="CreateCustomRadioOptions" stepKey="createCustomOption2"> |
| 53 | + <argument name="categoryName" value="ProductOptionRadiobutton.title"/> |
| 54 | + <argument name="productOption" value="ProductOptionField"/> |
| 55 | + <argument name="productOption2" value="ProductOptionField2"/> |
36 | 56 | </actionGroup>
|
37 | 57 |
|
38 |
| - <click stepKey="clickCustomizableOptions" selector="{{AdminCustomOptionsSection.customizableOptions}}" /> |
| 58 | + <!-- Save the product --> |
| 59 | + <click stepKey="saveProduct" selector="{{AdminProductFormActionSection.saveButton}}" /> |
| 60 | + <waitForPageLoad stepKey="waitForProductSaved" /> |
| 61 | + <seeElement selector="{{AdminCategoryMessagesSection.SuccessMessage}}" stepKey="assertSuccess"/> |
| 62 | + |
| 63 | + <!-- navigate to the created product page --> |
| 64 | + <amOnPage url="/{{SimpleProduct3.name}}.html" stepKey="goToCreatedProduct" /> |
| 65 | + <waitForPageLoad stepKey="waitForProductPageLoad" /> |
| 66 | + |
| 67 | + <!-- Check to make sure all of the created names are there --> |
| 68 | + <see stepKey="assertNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.title}}" /> |
| 69 | + <see stepKey="assertNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.title}}" /> |
| 70 | + <see stepKey="assertSecondNameInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.title}}" /> |
| 71 | + <see stepKey="assertSecondNameInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.title}}" /> |
39 | 72 |
|
| 73 | + <!-- Check to see that all of the created prices are there --> |
| 74 | + <see stepKey="assertPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField.price}}" /> |
| 75 | + <see stepKey="assertPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField.price}}" /> |
| 76 | + <see stepKey="assertSecondPriceInFirstOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('1')}}" userInput="{{ProductOptionField2.price}}" /> |
| 77 | + <see stepKey="assertSecondPriceInSecondOption" selector="{{StorefrontProductInfoMainSection.nthCustomOption('2')}}" userInput="{{ProductOptionField2.price}}" /> |
40 | 78 |
|
| 79 | + <!-- select two of the radio buttons --> |
| 80 | + <click stepKey="selectFirstCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('1','2')}}" /> |
| 81 | + <click stepKey="selectSecondCustomOption" selector="{{StorefrontProductInfoMainSection.nthCustomOptionInput('2','1')}}" /> |
41 | 82 |
|
| 83 | + <!-- Check that the price has actually changed --> |
| 84 | + <see stepKey="assertPriceHasChanged" selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="{{ProductOptionField2.expected_value}}" /> |
42 | 85 | </test>
|
43 | 86 | </tests>
|
0 commit comments