Skip to content

Commit cfa87e3

Browse files
author
Dmytro Vilchynskyi
committed
MAGETWO-36622: [UI] Merge grid styles
- fixed tests
1 parent e6b2116 commit cfa87e3

File tree

6 files changed

+47
-56
lines changed

6 files changed

+47
-56
lines changed

dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/CurrencyRateForm.php

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,42 @@
1616
class CurrencyRateForm extends Form
1717
{
1818
/**
19-
* Fill currency rate form.
19+
* Locator value for "Messages" block.
20+
*
21+
* @var string
22+
*/
23+
protected $message = '#messages';
24+
25+
/**
26+
* Locator value for "Import" button.
27+
*
28+
* @var string
29+
*/
30+
protected $importButton = '[data-ui-id$="import-button"]';
31+
32+
/**
33+
* Click on the "Import" button.
34+
*
35+
* @throws \Exception
36+
* @return void
37+
*/
38+
public function clickImportButton()
39+
{
40+
$this->_rootElement->find($this->importButton)->click();
41+
42+
//Wait message
43+
$browser = $this->browser;
44+
$selector = $this->message;
45+
$browser->waitUntil(
46+
function () use ($browser, $selector) {
47+
$message = $browser->find($selector);
48+
return $message->isVisible() ? true : null;
49+
}
50+
);
51+
}
52+
53+
/**
54+
* Fill "Currency Rates" form.
2055
*
2156
* @param FixtureInterface $fixture
2257
* @param SimpleElement|null $element

dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Block/Adminhtml/System/Currency/Rate/GridPageActions.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/Page/Adminhtml/SystemCurrencyIndex.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../vendor/magento/mtf/etc/pages.xsd">
99
<page name="SystemCurrencyIndex" area="Adminhtml" mca="admin/system_currency/index" module="Magento_CurrencySymbol">
10-
<block name="gridPageActions" class="Magento\CurrencySymbol\Test\Block\Adminhtml\System\Currency\Rate\GridPageActions" locator=".grid-actions" strategy="css selector"/>
1110
<block name="formPageActions" class="Magento\CurrencySymbol\Test\Block\Adminhtml\System\Currency\Rate\FormPageActions" locator=".page-main-actions" strategy="css selector"/>
12-
<block name="currencyRateForm" class="Magento\CurrencySymbol\Test\Block\Adminhtml\System\Currency\Rate\CurrencyRateForm" locator="#rate-form" strategy="css selector"/>
11+
<block name="currencyRateForm" class="Magento\CurrencySymbol\Test\Block\Adminhtml\System\Currency\Rate\CurrencyRateForm" locator="#container" strategy="css selector"/>
1312
<block name="messagesBlock" class="Magento\Backend\Test\Block\Messages" locator="#messages" strategy="css selector"/>
1413
</page>
1514
</config>

dev/tests/functional/tests/app/Magento/CurrencySymbol/Test/TestCase/AbstractCurrencySymbolEntityTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ protected function importCurrencyRate($configData)
7979

8080
// Import Exchange Rates for currencies
8181
$this->currencyIndex->open();
82-
$this->currencyIndex->getGridPageActions()->clickImportButton();
82+
$this->currencyIndex->getCurrencyRateForm()->clickImportButton();
8383
if ($this->currencyIndex->getMessagesBlock()->isVisibleMessage('warning')) {
8484
throw new \Exception($this->currencyIndex->getMessagesBlock()->getWarningMessages());
8585
}

dev/tests/functional/tests/app/Magento/Sales/Test/Block/Adminhtml/Order/Create/Store.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ class Store extends Block
2525
*/
2626
protected $templateBlock = './ancestor::body';
2727

28+
/**
29+
* Locator value for specified Store control.
30+
*
31+
* @var string
32+
*/
33+
protected $store = '//label[contains(., "%s")]/preceding-sibling::*';
34+
2835
/**
2936
* Get backend abstract block
3037
*
@@ -48,7 +55,7 @@ public function selectStoreView(StoreFixture $fixture = null)
4855
return;
4956
}
5057
$storeName = $fixture == null ? 'Default Store View' : $fixture->getName();
51-
$selector = '//label[text()="' . $storeName . '"]/preceding-sibling::*';
58+
$selector = sprintf($this->store, $storeName);
5259
$this->_rootElement->find($selector, Locator::SELECTOR_XPATH, 'checkbox')->setValue('Yes');
5360
$this->getTemplateBlock()->waitLoader();
5461
}

dev/tests/functional/tests/app/Magento/Tax/Test/Block/Adminhtml/Rule/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Grid extends GridInterface
4949
*
5050
* @var string
5151
*/
52-
protected $firstRowSelector = '//tr[./td[contains(@class, "col-name")]][1]';
52+
protected $firstRowSelector = '//tbody/tr[./td[contains(@class, "col-name")]][1]';
5353

5454
/**
5555
* Check if specific row exists in grid

0 commit comments

Comments
 (0)