|
| 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 | +<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 10 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> |
| 11 | + <actionGroup name="DeleteDefaultCategoryChildrenActionGroup"> |
| 12 | + <annotations> |
| 13 | + <description>Deletes all children categories of Default Root Category.</description> |
| 14 | + </annotations> |
| 15 | + |
| 16 | + <amOnPage url="{{AdminCategoryPage.url}}" stepKey="navigateToAdminCategoryPage"/> |
| 17 | + <executeInSelenium function="function ($webdriver) use ($I) { |
| 18 | + $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., |
| 19 | + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); |
| 20 | + while (!empty($children)) { |
| 21 | + $I->click('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., |
| 22 | + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a'); |
| 23 | + $I->waitForPageLoad(30); |
| 24 | + $I->click('#delete'); |
| 25 | + $I->waitForElementVisible('aside.confirm .modal-footer button.action-accept'); |
| 26 | + $I->click('aside.confirm .modal-footer button.action-accept'); |
| 27 | + $I->waitForPageLoad(30); |
| 28 | + $I->waitForElementVisible('#messages div.message-success', 30); |
| 29 | + $I->see('You deleted the category.', '#messages div.message-success'); |
| 30 | + $children = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::xpath('//ul[contains(@class, \'x-tree-node-ct\')]/li[@class=\'x-tree-node\' and contains(., |
| 31 | + \'{{DefaultCategory.name}}\')]/ul[contains(@class, \'x-tree-node-ct\')]/li//a')); |
| 32 | + } |
| 33 | + }" stepKey="deleteAllChildCategories"/> |
| 34 | + </actionGroup> |
| 35 | +</actionGroups> |
0 commit comments