Skip to content

Commit 637cbbf

Browse files
author
Dmytro Aponasenko
committed
MTA-1994: Analyse functional test failures - Sprint 10
- Moved functional tests
1 parent c915f36 commit 637cbbf

File tree

122 files changed

+8073
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+8073
-147
lines changed

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/ProductAttribute/CreateProductAttributeEntityTest.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@
182182
<data name="productAttribute/data/is_searchable" xsi:type="string">Yes</data>
183183
<data name="productAttribute/data/is_visible_in_advanced_search" xsi:type="string">Yes</data>
184184
<data name="productAttribute/data/is_comparable" xsi:type="string">Yes</data>
185-
<data name="issue" xsi:type="string">Bug: MAGETWO-33625</data>
186185
<constraint name="Magento\Catalog\Test\Constraint\AssertProductAttributeIsUnique" />
187186
</variation>
188187
</testCase>

dev/tests/functional/tests/app/Magento/OfflinePayments/Test/Repository/ConfigData.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
</dataset>
4646

4747
<dataset name="checkmo_specificcountry_gb_rollback">
48-
<field path="payment/checkmo/active" scope="payment" scope_id="1" label="No" xsi:type="string">0</field>
4948
<field path="payment/checkmo/allowspecific" scope="payment" scope_id="1" label="All Allowed Countries" xsi:type="string">0</field>
5049
</dataset>
5150

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Sales\Test\Block\Adminhtml\Order\Create;
8+
9+
use Magento\Backend\Test\Block\Widget\Form;
10+
use Magento\SalesRule\Test\Fixture\SalesRuleInjectable;
11+
use Magento\Mtf\Client\Locator;
12+
13+
/**
14+
* Adminhtml sales order create coupons block.
15+
*/
16+
class Coupons extends Form
17+
{
18+
/**
19+
* Fill discount code input selector.
20+
*
21+
* @var string
22+
*/
23+
protected $couponCode = 'input[name="coupon_code"]';
24+
25+
/**
26+
* Click apply button selector.
27+
*
28+
* @var string
29+
*/
30+
protected $applyButton = '//*[@id="coupons:code"]/following-sibling::button';
31+
32+
/**
33+
* Enter discount code and click apply button.
34+
*
35+
* @param SalesRuleInjectable $code
36+
* @return void
37+
*/
38+
public function applyCouponCode(SalesRuleInjectable $code)
39+
{
40+
$this->_rootElement->find($this->couponCode)->setValue($code->getCouponCode());
41+
$this->_rootElement->find($this->applyButton, Locator::SELECTOR_XPATH)->click();
42+
}
43+
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ abstract class Sidebar extends Block
2929
protected $addToOrderProductName = '//tr/td[.="%s"]';
3030

3131
/**
32-
* Add product to order by name.
32+
* Add productz to order.
3333
*
34-
* @param string|array $names
34+
* @param array $products
3535
* @return void
3636
*/
37-
public function addToOrderByName($names)
37+
public function addProductsToOrder(array $products)
3838
{
39-
$names = is_array($names) ? $names : [$names];
40-
foreach ($names as $name) {
39+
foreach ($products as $product) {
40+
$name = $product->getName();
4141
$this->_rootElement->find(sprintf($this->addToOrderProductName, $name), Locator::SELECTOR_XPATH)->click();
4242
$this->_rootElement->click();
4343
$this->_rootElement->find(sprintf($this->addToOrder, $name), Locator::SELECTOR_XPATH, 'checkbox')
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo;
8+
9+
use Magento\Sales\Test\Block\Adminhtml\Order\AbstractForm;
10+
use Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items;
11+
12+
/**
13+
* Credit memo create form.
14+
*/
15+
class Form extends AbstractForm
16+
{
17+
/**
18+
* Items block css selector.
19+
*
20+
* @var string
21+
*/
22+
protected $items = '#creditmemo_item_container';
23+
24+
/**
25+
* Get items block.
26+
*
27+
* @return Items
28+
*/
29+
public function getItemsBlock()
30+
{
31+
return $this->blockFactory->create(
32+
'Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items',
33+
['element' => $this->_rootElement->find($this->items)]
34+
);
35+
}
36+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="0">
9+
<wrapper>creditmemo</wrapper>
10+
<fields>
11+
<comment_text />
12+
<shipping_amount />
13+
<adjustment_positive />
14+
<adjustment_negative />
15+
<comment_customer_notify>
16+
<input>checkbox</input>
17+
</comment_customer_notify>
18+
<send_email>
19+
<input>checkbox</input>
20+
</send_email>
21+
<refund_customerbalance_return_enable>
22+
<selector>#creditmemo_customerbalance_return_enable</selector>
23+
<input>checkbox</input>
24+
</refund_customerbalance_return_enable>
25+
<refund_customerbalance_return />
26+
</fields>
27+
</mapping>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form;
8+
9+
use Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items\Product;
10+
use Magento\Mtf\Block\Block;
11+
use Magento\Mtf\Client\Locator;
12+
use Magento\Mtf\Fixture\FixtureInterface;
13+
14+
/**
15+
* Credit Memo Items block on Credit Memo new page.
16+
*/
17+
class Items extends Block
18+
{
19+
/**
20+
* Item product.
21+
*
22+
* @var string
23+
*/
24+
protected $productItems = '//tr[contains(.,"%s")]';
25+
26+
/**
27+
* 'Update Qty's' button css selector.
28+
*
29+
* @var string
30+
*/
31+
protected $updateQty = '.update-button';
32+
33+
/**
34+
* Get item product block.
35+
*
36+
* @param FixtureInterface $product
37+
* @return Product
38+
*/
39+
public function getItemProductBlock(FixtureInterface $product)
40+
{
41+
$selector = sprintf($this->productItems, $product->getSku());
42+
return $this->blockFactory->create(
43+
'Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items\Product',
44+
['element' => $this->_rootElement->find($selector, Locator::SELECTOR_XPATH)]
45+
);
46+
}
47+
48+
/**
49+
* Click update qty button.
50+
*
51+
* @return void
52+
*/
53+
public function clickUpdateQty()
54+
{
55+
$this->_rootElement->find($this->updateQty)->click();
56+
}
57+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo\Form\Items;
8+
9+
/**
10+
* Item product form on credit memo items block.
11+
*/
12+
class Product extends \Magento\Sales\Test\Block\Adminhtml\Order\AbstractForm\Product
13+
{
14+
//
15+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" ?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<mapping strict="0">
9+
<fields>
10+
<qty>
11+
<selector>[name$="[qty]"]</selector>
12+
</qty>
13+
<back_to_stock>
14+
<selector>[name$="[back_to_stock]"]</selector>
15+
<input>checkbox</input>
16+
</back_to_stock>
17+
</fields>
18+
</mapping>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Sales\Test\Block\Adminhtml\Order\Creditmemo;
8+
9+
use Magento\Mtf\Client\Locator;
10+
11+
/**
12+
* Invoice totals block.
13+
*/
14+
class Totals extends \Magento\Sales\Test\Block\Adminhtml\Order\Totals
15+
{
16+
/**
17+
* Submit invoice button selector.
18+
*
19+
* @var string
20+
*/
21+
protected $submit = '[data-ui-id="order-items-submit-button"]';
22+
23+
/**
24+
* Capture amount select selector.
25+
*
26+
* @var string
27+
*/
28+
protected $capture = '[name="invoice[capture_case]"]';
29+
30+
/**
31+
* Submit invoice.
32+
*
33+
* @return void
34+
*/
35+
public function submit()
36+
{
37+
$browser = $this->_rootElement;
38+
$selector = $this->submit . '.disabled';
39+
$strategy = Locator::SELECTOR_CSS;
40+
$browser->waitUntil(
41+
function () use ($browser, $selector, $strategy) {
42+
$element = $browser->find($selector, $strategy);
43+
return $element->isVisible() == false ? true : null;
44+
}
45+
);
46+
$this->_rootElement->find($this->submit)->click();
47+
}
48+
49+
/**
50+
* Set Capture amount option:
51+
* Capture Online|Capture Offline|Not Capture
52+
*
53+
* @param string $option
54+
* @return void
55+
*/
56+
public function setCaptureOption($option)
57+
{
58+
$this->_rootElement->find($this->capture, Locator::SELECTOR_CSS, 'select')->setValue($option);
59+
}
60+
}

0 commit comments

Comments
 (0)