|
47 | 47 | <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/>
|
48 | 48 | <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/>
|
49 | 49 | <click selector="{{AdminProductCustomizableOptionsSection.optionType('File')}}" stepKey="selectTypeFile"/>
|
50 |
| - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPrice('0')}}" stepKey="waitForElements"/> |
51 |
| - <fillField selector="{{AdminProductCustomizableOptionsSection.optionPrice('0')}}" userInput="{{option.price}}" stepKey="fillPrice"/> |
52 |
| - <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType('0')}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> |
53 |
| - <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensions('0')}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> |
| 50 | + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> |
| 51 | + <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> |
| 52 | + <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> |
| 53 | + <fillField selector="{{AdminProductCustomizableOptionsSection.optionFileExtensionByTitle(option.title)}}" userInput="{{option.file_extension}}" stepKey="fillCompatibleExtensions"/> |
54 | 54 | </actionGroup>
|
55 | 55 | <actionGroup name="AddProductCustomOptionField">
|
56 | 56 | <arguments>
|
57 | 57 | <argument name="option" defaultValue="ProductOptionField"/>
|
58 |
| - <argument name="optionIndex" type="string"/> |
59 | 58 | </arguments>
|
| 59 | + <scrollTo selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="scrollToAddButtonOption"/> |
60 | 60 | <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" visible="false" stepKey="openCustomOptionSection"/>
|
61 | 61 | <click selector="{{AdminProductCustomizableOptionsSection.addOptionBtn}}" stepKey="clickAddOption"/>
|
62 | 62 | <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" stepKey="waitForOption"/>
|
63 | 63 | <fillField selector="{{AdminProductCustomizableOptionsSection.lastOptionTitle}}" userInput="{{option.title}}" stepKey="fillTitle"/>
|
64 | 64 | <click selector="{{AdminProductCustomizableOptionsSection.lastOptionTypeParent}}" stepKey="openTypeSelect"/>
|
65 | 65 | <click selector="{{AdminProductCustomizableOptionsSection.optionType('Field')}}" stepKey="selectTypeFile"/>
|
66 |
| - <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" stepKey="waitForElements"/> |
67 |
| - <fillField selector="{{AdminProductCustomizableOptionsSection.optionPrice(optionIndex)}}" userInput="{{option.price}}" stepKey="fillPrice"/> |
68 |
| - <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceType(optionIndex)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> |
69 |
| - <fillField selector="{{AdminProductCustomizableOptionsSection.optionSku(optionIndex)}}" userInput="{{option.title}}" stepKey="fillSku"/> |
| 66 | + <waitForElementVisible selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" stepKey="waitForElements"/> |
| 67 | + <fillField selector="{{AdminProductCustomizableOptionsSection.optionPriceByTitle(option.title)}}" userInput="{{option.price}}" stepKey="fillPrice"/> |
| 68 | + <selectOption selector="{{AdminProductCustomizableOptionsSection.optionPriceTypeByTitle(option.title)}}" userInput="{{option.price_type}}" stepKey="selectPriceType"/> |
| 69 | + <fillField selector="{{AdminProductCustomizableOptionsSection.optionSkuByTitle(option.title)}}" userInput="{{option.title}}" stepKey="fillSku"/> |
70 | 70 | </actionGroup>
|
71 | 71 | <actionGroup name="importProductCustomizableOptions">
|
72 | 72 | <arguments>
|
|
99 | 99 | <assertEquals expected="{{option.price}}" expectedType="string" actual="$grabOptionPrice" stepKey="assertOptionPrice"/>
|
100 | 100 | <assertEquals expected="{{option.title}}" expectedType="string" actual="$grabOptionSku" stepKey="assertOptionSku"/>
|
101 | 101 | </actionGroup>
|
| 102 | + <!-- Assumes we are on product edit page --> |
| 103 | + <actionGroup name="AdminDeleteAllProductCustomOptions"> |
| 104 | + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> |
| 105 | + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> |
| 106 | + <executeInSelenium function="function($webdriver) use ($I) { |
| 107 | + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); |
| 108 | + while(!empty($buttons)) { |
| 109 | + $button = reset($buttons); |
| 110 | + $I->executeJS('arguments[0].scrollIntoView(false)', [$button]); |
| 111 | + $button->click(); |
| 112 | + $webdriver->wait()->until(\Facebook\WebDriver\WebDriverExpectedCondition::stalenessOf($button)); |
| 113 | + $buttons = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('[data-index=\'options\'] [data-index=\'delete_button\']')); |
| 114 | + } |
| 115 | + }" stepKey="deleteCustomOptions"/> |
| 116 | + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOptionButtonDelete}}" stepKey="assertNoCustomOptions"/> |
| 117 | + </actionGroup> |
| 118 | + <!-- Assumes we are on product edit page --> |
| 119 | + <actionGroup name="AdminAssertProductHasNoCustomOptions"> |
| 120 | + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> |
| 121 | + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> |
| 122 | + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.customOption}}" stepKey="assertNoCustomOptions"/> |
| 123 | + </actionGroup> |
| 124 | + <!-- Assumes we are on product edit page --> |
| 125 | + <actionGroup name="AdminAssertProductHasNoCustomOption" extends="AdminAssertProductCustomOptionVisible"> |
| 126 | + <remove keyForRemoval="assertCustomOptionVisible"/> |
| 127 | + <dontSeeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="assertNoCustomOption"/> |
| 128 | + </actionGroup> |
| 129 | + <!-- Assumes we are on product edit page --> |
| 130 | + <actionGroup name="AdminAssertProductCustomOptionVisible"> |
| 131 | + <arguments> |
| 132 | + <argument name="option" defaultValue="ProductOptionField"/> |
| 133 | + </arguments> |
| 134 | + <conditionalClick selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" dependentSelector="{{AdminProductCustomizableOptionsSection.checkIfCustomizableOptionsTabOpen}}" visible="true" stepKey="expandContentTab"/> |
| 135 | + <waitForPageLoad time="10" stepKey="waitCustomizableOptionsTabOpened"/> |
| 136 | + <seeElement selector="{{AdminProductCustomizableOptionsSection.fillOptionTitle(option.title)}}" stepKey="assertCustomOptionVisible"/> |
| 137 | + </actionGroup> |
| 138 | + <!-- Assumes we are on product edit page --> |
| 139 | + <actionGroup name="AdminDeleteProductCustomOption" extends="AdminAssertProductCustomOptionVisible"> |
| 140 | + <remove keyForRemoval="assertCustomOptionVisible"/> |
| 141 | + <click selector="{{AdminProductCustomizableOptionsSection.deleteCustomOptions(option.title)}}" after="waitCustomizableOptionsTabOpened" stepKey="clickDeleteCustomOption"/> |
| 142 | + </actionGroup> |
102 | 143 | </actionGroups>
|
0 commit comments