Review fixes

This commit is contained in:
Arminek 2016-11-04 10:08:19 +01:00
parent 31b3aa1640
commit 27e527118f
2 changed files with 11 additions and 5 deletions

View file

@ -7,9 +7,8 @@ Feature: Deleting a taxon
Background:
Given I am logged in as an administrator
@ui
@ui @javascript
Scenario: Deleted taxon should disappear from the registry
Given the store classifies its products as "T-Shirts"
When I delete taxon named "T-Shirts"
Then I should be notified that it has been successfully deleted
And the taxon named "T-Shirts" should no longer exist in the registry
Then the taxon named "T-Shirts" should no longer exist in the registry

View file

@ -41,7 +41,7 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
$matchedLeafsCounter = 0;
$leafs = $this->getLeafs();
foreach ($leafs as $leaf) {
if ($leaf->getText() === $name) {
if (strpos($leaf->getText(), $name) !== false) {
$matchedLeafsCounter++;
}
}
@ -65,7 +65,14 @@ class CreatePage extends BaseCreatePage implements CreatePageInterface
$leafs = $this->getLeafs();
foreach ($leafs as $leaf) {
if ($leaf->getText() === $name) {
$leaf->getParent()->find('css', '.ui.red.button')->press();
$leaf = $leaf->getParent();
$menuButton = $leaf->find('css', '.wrench');
$menuButton->click();
$deleteButton = $leaf->find('css', '.sylius-delete-resource');
$deleteButton->click();
$deleteButton->waitFor(5, function () use ($name) {
return $this->getFirstLeafName() !== $name;
});
return;
}