Skip to content

Commit f2fbc50

Browse files
author
Oleksandr Manchenko
committed
MTA-2236: Sync qmt repository with mainline - Sprint 14
- Fixed static test fails
1 parent 3d2b536 commit f2fbc50

File tree

2 files changed

+13
-44
lines changed

2 files changed

+13
-44
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function getAllTaxRates()
316316
public function isTaxRateAvailable($value)
317317
{
318318
/** @var \Magento\Mtf\Client\Element\MultiselectlistElement $taxRate */
319-
$taxRate = $taxRates = $this->_rootElement->find($this->taxRateBlock, Locator::SELECTOR_CSS, 'multiselectlist');
319+
$taxRate = $this->_rootElement->find($this->taxRateBlock, Locator::SELECTOR_CSS, 'multiselectlist');
320320
return $taxRate->isValueVisible($value);
321321
}
322322
}

dev/tests/functional/tests/app/Magento/Wishlist/Test/TestCase/ShareWishlistEntityTest.php

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@
77
namespace Magento\Wishlist\Test\TestCase;
88

99
use Magento\Catalog\Test\Fixture\CatalogProductSimple;
10-
use Magento\Catalog\Test\Page\Product\CatalogProductView;
1110
use Magento\Cms\Test\Page\CmsIndex;
1211
use Magento\Customer\Test\Fixture\Customer;
13-
use Magento\Customer\Test\Page\CustomerAccountIndex;
1412
use Magento\Wishlist\Test\Page\WishlistIndex;
1513
use Magento\Wishlist\Test\Page\WishlistShare;
1614
use Magento\Mtf\Client\BrowserInterface;
@@ -31,6 +29,8 @@
3129
*
3230
* @group Wishlist_(CS)
3331
* @ZephyrId MAGETWO-23394
32+
*
33+
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
3434
*/
3535
class ShareWishlistEntityTest extends Injectable
3636
{
@@ -46,20 +46,6 @@ class ShareWishlistEntityTest extends Injectable
4646
*/
4747
protected $cmsIndex;
4848

49-
/**
50-
* Customer account index page.
51-
*
52-
* @var CustomerAccountIndex
53-
*/
54-
protected $customerAccountIndex;
55-
56-
/**
57-
* Product view page.
58-
*
59-
* @var CatalogProductView
60-
*/
61-
protected $catalogProductView;
62-
6349
/**
6450
* Wishlist index page.
6551
*
@@ -81,10 +67,8 @@ class ShareWishlistEntityTest extends Injectable
8167
* @param CatalogProductSimple $product
8268
* @return array
8369
*/
84-
public function __prepare(
85-
Customer $customer,
86-
CatalogProductSimple $product
87-
) {
70+
public function __prepare(Customer $customer, CatalogProductSimple $product)
71+
{
8872
$customer->persist();
8973
$product->persist();
9074

@@ -98,22 +82,16 @@ public function __prepare(
9882
* Inject pages.
9983
*
10084
* @param CmsIndex $cmsIndex
101-
* @param CustomerAccountIndex $customerAccountIndex
102-
* @param CatalogProductView $catalogProductView
10385
* @param WishlistIndex $wishlistIndex
10486
* @param WishlistShare $wishlistShare
10587
* @return void
10688
*/
10789
public function __inject(
10890
CmsIndex $cmsIndex,
109-
CustomerAccountIndex $customerAccountIndex,
110-
CatalogProductView $catalogProductView,
11191
WishlistIndex $wishlistIndex,
11292
WishlistShare $wishlistShare
11393
) {
11494
$this->cmsIndex = $cmsIndex;
115-
$this->customerAccountIndex = $customerAccountIndex;
116-
$this->catalogProductView = $catalogProductView;
11795
$this->wishlistIndex = $wishlistIndex;
11896
$this->wishlistShare = $wishlistShare;
11997
}
@@ -134,27 +112,18 @@ public function test(
134112
array $sharingInfo
135113
) {
136114
//Steps
137-
$this->loginCustomer($customer);
138-
$browser->open($_ENV['app_frontend_url'] . $product->getUrlKey() . '.html');
139-
$this->catalogProductView->getViewBlock()->clickAddToWishlist();
115+
$this->objectManager->create(
116+
'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep',
117+
['customer' => $customer]
118+
)->run();
119+
$this->objectManager->create(
120+
'Magento\Wishlist\Test\TestStep\AddProductsToWishlistStep',
121+
['products' => [$product]]
122+
)->run();
140123
$this->wishlistIndex->getMessagesBlock()->waitSuccessMessage();
141124
$this->wishlistIndex->getWishlistBlock()->clickShareWishList();
142125
$this->cmsIndex->getCmsPageBlock()->waitPageInit();
143126
$this->wishlistShare->getSharingInfoForm()->fillForm($sharingInfo);
144127
$this->wishlistShare->getSharingInfoForm()->shareWishlist();
145128
}
146-
147-
/**
148-
* Login customer.
149-
*
150-
* @param Customer $customer
151-
* @return void
152-
*/
153-
protected function loginCustomer(Customer $customer)
154-
{
155-
$this->objectManager->create(
156-
'Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep',
157-
['customer' => $customer]
158-
)->run();
159-
}
160129
}

0 commit comments

Comments
 (0)