Skip to content

Commit 69eb8f1

Browse files
author
Dmytro Aponasenko
committed
MTA-1814: Analyse functional test failures - Sprint 9
1 parent e5741f5 commit 69eb8f1

File tree

10 files changed

+339
-502
lines changed

10 files changed

+339
-502
lines changed

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Menu.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,8 @@ public function navigate($menuItem)
9090
}
9191
$subMenuSelector = sprintf($this->subMenu, $mainMenu);
9292
$this->waitForElementVisible($subMenuSelector, Locator::SELECTOR_XPATH);
93-
$subMenuItem = $this->_rootElement->find($subMenuSelector, Locator::SELECTOR_XPATH)
94-
->find(sprintf($this->subMenuItem, $subMenu), Locator::SELECTOR_XPATH);
95-
if (!$subMenuItem->isVisible()) {
96-
throw new \Exception('Submenu item "' . $subMenu . '" is not visible in "' . $mainMenu . '"');
97-
}
93+
$subMenuItem = $subMenuSelector . sprintf($this->subMenuItem, $subMenu);
94+
$this->waitForElementVisible($subMenuItem, Locator::SELECTOR_XPATH);
9895
$subMenuItem->click();
9996
$this->waitForElementNotVisible($subMenuSelector, Locator::SELECTOR_XPATH);
10097
}

dev/tests/functional/tests/app/Magento/Bundle/Test/TestCase/CreateBundleProductEntityTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" />
100100
</variation>
101101
<variation name="CreateBundleProductEntityTestVariation5">
102+
<data name="issue" xsi:type="string">Bug: MAGETWO-35342</data>
102103
<data name="description" xsi:type="string">Create fixed bundle with all types options</data>
103104
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
104105
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
@@ -163,7 +164,6 @@
163164
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
164165
<constraint name="Magento\Catalog\Test\Constraint\AssertProductInGrid" />
165166
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductForm" />
166-
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" />
167167
<constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" />
168168
<constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" />
169169
</variation>

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,43 @@
88

99
use Magento\Mtf\Client\Element\SuggestElement;
1010
use Magento\Catalog\Test\Fixture\CatalogProductAttribute;
11+
use Magento\Mtf\Client\Locator;
1112

1213
/**
13-
* Class FormAttributeSearch
14-
* Form Attribute Search on Product page
14+
* Form Attribute Search on Product page.
1515
*/
1616
class Search extends SuggestElement
1717
{
1818
/**
19-
* Attribute Set locator
19+
* Attributes locator.
2020
*
2121
* @var string
2222
*/
2323
protected $value = '.action-toggle > span';
2424

2525
/**
26-
* Attribute Set button
26+
* Attributes button.
2727
*
2828
* @var string
2929
*/
3030
protected $actionToggle = '.action-toggle';
3131

3232
/**
33-
* Search attribute result locator
33+
* Saerch result dropdown.
3434
*
3535
* @var string
3636
*/
37-
protected $searchResult = '.mage-suggest-dropdown .ui-corner-all';
37+
protected $searchResult = '.mage-suggest-dropdown';
3838

3939
/**
40-
* Set value
40+
* Searched attribute result locator.
41+
*
42+
* @var string
43+
*/
44+
protected $searchArrtibute = './/a[text()="%s"]';
45+
46+
/**
47+
* Set value.
4148
*
4249
* @param string $value
4350
* @return void
@@ -49,7 +56,7 @@ public function setValue($value)
4956
}
5057

5158
/**
52-
* Get value
59+
* Get value.
5360
*
5461
* @return string
5562
*/
@@ -59,7 +66,7 @@ public function getValue()
5966
}
6067

6168
/**
62-
* Checking not exist attribute in search result
69+
* Checking not exist attribute in search result.
6370
*
6471
* @param CatalogProductAttribute $productAttribute
6572
* @return bool
@@ -69,10 +76,24 @@ public function isExistAttributeInSearchResult($productAttribute)
6976
$this->find($this->actionToggle)->click();
7077
$this->find($this->suggest)->setValue($productAttribute->getFrontendLabel());
7178
$this->waitResult();
72-
if ($this->find($this->searchResult)->getText() == $productAttribute->getFrontendLabel()) {
73-
return true;
74-
}
79+
$attributeSelector = sprintf($this->searchArrtibute, $productAttribute->getFrontendLabel());
80+
return $this->find($this->searchResult)->find($attributeSelector, Locator::SELECTOR_XPATH)->isVisible();
81+
}
7582

76-
return false;
83+
/**
84+
* Wait for search result is visible.
85+
*
86+
* @return void
87+
*/
88+
public function waitResult()
89+
{
90+
$browser = $this;
91+
$selector = $this->searchResult;
92+
$browser->waitUntil(
93+
function () use ($browser, $selector) {
94+
$element = $browser->find($selector);
95+
return $element->isVisible() ? true : null;
96+
}
97+
);
7798
}
7899
}

dev/tests/functional/tests/app/Magento/ConfigurableProduct/Test/Block/Adminhtml/Product/Edit/Tab/Super/Config/Attribute.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,8 @@ protected function createNewVariationSet(array $attribute)
166166

167167
$this->_rootElement->find($this->createNewVariationSet)->click();
168168
$newAttribute = $this->getEditAttributeForm();
169-
$newAttribute->fill($attributeFixture);
170-
$newAttribute->_rootElement->find($this->saveAttribute)->click();
171-
172-
$this->browser->switchToFrame();
169+
$this->getEditAttributeForm()->fill($attributeFixture);
170+
$this->getEditAttributeForm()->saveAttributeForm();
173171
}
174172

175173
/**

dev/tests/functional/tests/app/Magento/Customer/Test/TestStep/LoginCustomerOnFrontendStep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function run()
6464
$this->cmsIndex->getCmsPageBlock()->waitPageInit();
6565
if ($this->cmsIndex->getLinksBlock()->isLinkVisible("Log Out")) {
6666
$this->cmsIndex->getLinksBlock()->openLink("Log Out");
67-
$this->cmsIndex->getCmsPageBlock()->waitUntilTextIsVisible('Home Page');
67+
$this->cmsIndex->getCmsPageBlock()->waitPageInit();
6868
}
6969
$this->cmsIndex->getLinksBlock()->openLink("Log In");
7070
$this->cmsIndex->getCmsPageBlock()->waitPageInit();

0 commit comments

Comments
 (0)