Skip to content

Commit ab36d41

Browse files
authored
Merge pull request #233 from magento-qmt/PR
Fixed issue: - MAGETWO-55970 [FT] Constraint AssertProductQtyInMiniShoppingCart is absent Functional tests: - MTA-3383 Catalog Widget: Extend existing functional automated tests. Cache - MTA-3242 Reports: Extend existing functional automated tests - MTA-3241 Catalog Widget: Extend existing functional automated tests - MTA-3237 Downloadable: Extend existing functional automated tests - MTA-3483 Create pull request and deliver extended functional tests to mainline - MTA-3437 \Magento\Config\Test\Handler\ConfigData\Curl handler doesn't allow to save values for different website scopes.
2 parents d95d459 + 3b0eb04 commit ab36d41

File tree

62 files changed

+1247
-277
lines changed

Some content is hidden

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

62 files changed

+1247
-277
lines changed

dev/tests/functional/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"magento/mtf": "1.0.0-rc44",
3+
"magento/mtf": "1.0.0-rc46",
44
"php": "~5.6.0|7.0.2|~7.0.6",
55
"phpunit/phpunit": "4.1.0",
66
"phpunit/phpunit-selenium": ">=1.2"
Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2016 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd">
10+
11+
<repository class="Magento\Catalog\Test\Repository\CatalogAttributeSet">
12+
<dataset name="default">
13+
<field name="attribute_set_id" xsi:type="number">4</field>
14+
</dataset>
15+
</repository>
16+
17+
<repository class="Magento\Catalog\Test\Repository\CatalogProductAttribute">
18+
<dataset name="quantity_and_stock_status">
19+
<field name="attribute_id" xsi:type="number">113</field>
20+
</dataset>
21+
22+
<dataset name="tax_class_id">
23+
<field name="attribute_id" xsi:type="number">172</field>
24+
</dataset>
25+
</repository>
26+
27+
<repository class="Magento\Catalog\Test\Repository\Category">
28+
<dataset name="default_category">
29+
<field name="parent_id" xsi:type="number">1</field>
30+
<field name="id" xsi:type="number">2</field>
31+
</dataset>
32+
33+
<dataset name="root_category">
34+
<field name="parent_id" xsi:type="number">1</field>
35+
</dataset>
36+
</repository>
37+
38+
<repository class="Magento\Customer\Test\Repository\CustomerGroup">
39+
<dataset name="General">
40+
<field name="customer_group_id" xsi:type="number">1</field>
41+
</dataset>
42+
43+
<dataset name="Retailer">
44+
<field name="customer_group_id" xsi:type="number">3</field>
45+
</dataset>
46+
47+
<dataset name="Wholesale">
48+
<field name="customer_group_id" xsi:type="number">2</field>
49+
</dataset>
50+
51+
<dataset name="all_customer_groups">
52+
<field name="customer_group_id" xsi:type="number">0</field>
53+
</dataset>
54+
55+
<dataset name="NOT_LOGGED_IN">
56+
<field name="customer_group_id" xsi:type="number">0</field>
57+
</dataset>
58+
59+
<dataset name="ALL_GROUPS">
60+
<field name="customer_group_id" xsi:type="number">32000</field>
61+
</dataset>
62+
</repository>
63+
64+
<repository class="Magento\Store\Test\Repository\Store">
65+
<dataset name="default">
66+
<field name="store_id" xsi:type="number">1</field>
67+
</dataset>
68+
69+
<dataset name="default_store_view">
70+
<field name="store_id" xsi:type="number">1</field>
71+
</dataset>
72+
73+
<dataset name="all_store_views">
74+
<field name="store_id" xsi:type="number">0</field>
75+
</dataset>
76+
</repository>
77+
78+
<repository class="Magento\Store\Test\Repository\StoreGroup">
79+
<dataset name="default">
80+
<field name="group_id" xsi:type="number">1</field>
81+
</dataset>
82+
</repository>
83+
84+
<repository class="Magento\Store\Test\Repository\Website">
85+
<dataset name="default">
86+
<field name="website_id" xsi:type="number">1</field>
87+
</dataset>
88+
89+
<dataset name="all_websites">
90+
<field name="website_id" xsi:type="number">0</field>
91+
</dataset>
92+
93+
<dataset name="main_website">
94+
<field name="website_id" xsi:type="number">1</field>
95+
</dataset>
96+
</repository>
97+
98+
<repository class="Magento\Tax\Test\Repository\TaxClass">
99+
<dataset name="taxable_goods">
100+
<field name="id" xsi:type="number">2</field>
101+
<field name="class_id" xsi:type="number">2</field>
102+
</dataset>
103+
104+
<dataset name="retail_customer">
105+
<field name="class_id" xsi:type="number">3</field>
106+
<field name="id" xsi:type="number">3</field>
107+
</dataset>
108+
109+
<dataset name="None">
110+
<field name="id" xsi:type="number">0</field>
111+
</dataset>
112+
</repository>
113+
114+
<repository class="Magento\Tax\Test\Repository\TaxRate">
115+
<dataset name="US-CA-Rate_1">
116+
<field name="tax_calculation_rate_id" xsi:type="number">1</field>
117+
<field name="tax_region_id" xsi:type="number">12</field>
118+
</dataset>
119+
120+
<dataset name="US-IL-Rate_1">
121+
<field name="tax_region_id" xsi:type="number">23</field>
122+
</dataset>
123+
124+
<dataset name="US-NY-Rate_1">
125+
<field name="tax_calculation_rate_id" xsi:type="number">2</field>
126+
<field name="tax_region_id" xsi:type="number">43</field>
127+
</dataset>
128+
</repository>
129+
130+
<repository class="Magento\User\Test\Repository\Role">
131+
<dataset name="Administrators">
132+
<field name="role_id" xsi:type="number">1</field>
133+
</dataset>
134+
</repository>
135+
136+
<repository class="Magento\User\Test\Repository\User">
137+
<dataset name="default">
138+
<field name="user_id" xsi:type="number">1</field>
139+
</dataset>
140+
</repository>
141+
142+
<repository class="Magento\Catalog\Test\Repository\CatalogProductSimple">
143+
<dataset name="sample_data_simple_product">
144+
<field name="id" xsi:type="number">1</field>
145+
</dataset>
146+
</repository>
147+
</config>

dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ protected function execute($command, $options = [])
4747
{
4848
$curl = $this->transport;
4949
$curl->write($this->prepareUrl($command, $options), [], CurlInterface::GET);
50+
$curl->read();
5051
$curl->close();
5152
}
5253

@@ -60,6 +61,6 @@ protected function execute($command, $options = [])
6061
private function prepareUrl($command, array $options)
6162
{
6263
$command .= ' ' . implode(' ', $options);
63-
return $_ENV['app_frontend_url'] . Cli::URL . '?command=' . urldecode($command);
64+
return $_ENV['app_frontend_url'] . Cli::URL . '?command=' . urlencode($command);
6465
}
6566
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Util\Command\Cli;
8+
9+
use Magento\Mtf\Util\Command\Cli;
10+
11+
/**
12+
* Handle cache for tests executions.
13+
*/
14+
class Cache extends Cli
15+
{
16+
/**
17+
* Parameter for flush cache command.
18+
*/
19+
const PARAM_CACHE_FLUSH = 'cache:flush';
20+
21+
/**
22+
* Parameter for cache disable command.
23+
*/
24+
const PARAM_CACHE_DISABLE = 'cache:disable';
25+
26+
/**
27+
* Parameter for cache enable command.
28+
*/
29+
const PARAM_CACHE_ENABLE = 'cache:enable';
30+
31+
/**
32+
* Flush cache.
33+
*
34+
* @return void
35+
*/
36+
public function flush()
37+
{
38+
parent::execute(Cache::PARAM_CACHE_FLUSH);
39+
}
40+
41+
/**
42+
* Disable all cache or one cache type.
43+
*
44+
* @param string $cacheType [optional]
45+
* @return void
46+
*/
47+
public function disableCache($cacheType = null)
48+
{
49+
parent::execute(Cache::PARAM_CACHE_DISABLE . ($cacheType ? " $cacheType" : ''));
50+
}
51+
52+
/**
53+
* Enable all cache or one cache type.
54+
*
55+
* @param string $cacheType [optional]
56+
* @return void
57+
*/
58+
public function enableCache($cacheType = null)
59+
{
60+
parent::execute(Cache::PARAM_CACHE_ENABLE . ($cacheType ? " $cacheType" : ''));
61+
}
62+
}

dev/tests/functional/lib/Magento/Mtf/Util/Command/Website.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ public function create($websiteCode)
5858
*/
5959
private function prepareUrl($websiteCode)
6060
{
61-
return $_ENV['app_frontend_url'] . Website::URL . '?website_code=' . urldecode($websiteCode);
61+
return $_ENV['app_frontend_url'] . Website::URL . '?website_code=' . urlencode($websiteCode);
6262
}
6363
}

dev/tests/functional/tests/app/Magento/AdminNotification/Test/Block/System/Messages.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\AdminNotification\Test\Block\System;
88

99
use Magento\Mtf\Block\Block;
10+
use Magento\Mtf\Client\Locator;
1011

1112
/**
1213
* Global messages block.
@@ -20,6 +21,13 @@ class Messages extends Block
2021
*/
2122
protected $closePopup = '[data-role="closeBtn"]';
2223

24+
/**
25+
* Locator for popup text.
26+
*
27+
* @var string
28+
*/
29+
protected $popupText = ".//*[@id='system_messages_list']/ul/li";
30+
2331
/**
2432
* Close popup block.
2533
*
@@ -31,4 +39,14 @@ public function closePopup()
3139
$this->_rootElement->find($this->closePopup)->click();
3240
}
3341
}
42+
43+
/**
44+
* Get pop up text.
45+
*
46+
* @return string
47+
*/
48+
public function getPopupText()
49+
{
50+
return $this->_rootElement->find($this->popupText, Locator::SELECTOR_XPATH)->getText();
51+
}
3452
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\AdminNotification\Test\Block\System\Messages;
8+
9+
use Magento\Mtf\Block\Block;
10+
11+
/**
12+
* System message block.
13+
*/
14+
class System extends Block
15+
{
16+
/**
17+
* Get block text content.
18+
*
19+
* @return string
20+
*/
21+
public function getContent()
22+
{
23+
return $this->_rootElement->getText();
24+
}
25+
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Block/Category/View.php

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ class View extends Block
2020
*
2121
* @var string
2222
*/
23-
protected $recentlyViewedProducts = './/*[contains(@class,"widget")]//strong[@class="product-item-name"]';
23+
protected $recentlyViewedProducts = '.block-viewed-products-grid strong.product-item-name';
24+
25+
/**
26+
* New Products selectors.
27+
*
28+
* @var string
29+
*/
30+
protected $newProducts = '.block-new-products strong.product-item-name';
2431

2532
/**
2633
* Description CSS selector.
@@ -65,8 +72,24 @@ public function getContent()
6572
public function getProductsFromRecentlyViewedBlock()
6673
{
6774
$products = [];
68-
$this->waitForElementVisible($this->recentlyViewedProducts, Locator::SELECTOR_XPATH);
69-
$productNames = $this->_rootElement->getElements($this->recentlyViewedProducts, Locator::SELECTOR_XPATH);
75+
$this->waitForElementVisible($this->recentlyViewedProducts, Locator::SELECTOR_CSS);
76+
$productNames = $this->_rootElement->getElements($this->recentlyViewedProducts, Locator::SELECTOR_CSS);
77+
foreach ($productNames as $productName) {
78+
$products[] = $productName->getText();
79+
}
80+
return $products;
81+
}
82+
83+
/**
84+
* Get products from Catalog New Products List block.
85+
*
86+
* @return array
87+
*/
88+
public function getProductsFromCatalogNewProductsListBlock()
89+
{
90+
$products = [];
91+
$this->waitForElementVisible($this->newProducts, Locator::SELECTOR_CSS);
92+
$productNames = $this->_rootElement->getElements($this->newProducts, Locator::SELECTOR_CSS);
7093
foreach ($productNames as $productName) {
7194
$products[] = $productName->getText();
7295
}

dev/tests/functional/tests/app/Magento/Catalog/Test/Fixture/Product/TierPrice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class TierPrice extends DataSource
4141
private $fixtureFactory;
4242

4343
/**
44-
* Rought fixture field data.
44+
* Rough fixture field data.
4545
*
4646
* @var array
4747
*/

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogAttributeSet.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/Magento/Mtf/Repository/etc/repository.xsd">
99
<repository class="Magento\Catalog\Test\Repository\CatalogAttributeSet">
1010
<dataset name="default">
11+
<field name="attribute_set_id" xsi:type="string">%id%</field>
1112
<field name="attribute_set_name" xsi:type="string">Default</field>
12-
<field name="attribute_set_id" xsi:type="string">4</field>
1313
</dataset>
1414

1515
<dataset name="custom_attribute_set">

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductAttribute.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</dataset>
1515

1616
<dataset name="quantity_and_stock_status">
17-
<field name="attribute_id" xsi:type="number">113</field>
17+
<field name="attribute_id" xsi:type="string">%id%</field>
1818
<field name="frontend_label" xsi:type="string">Quantity</field>
1919
<field name="attribute_code" xsi:type="string">quantity_and_stock_status</field>
2020
<field name="frontend_input" xsi:type="string">Dropdown</field>
@@ -34,7 +34,7 @@
3434
</dataset>
3535

3636
<dataset name="tax_class_id">
37-
<field name="attribute_id" xsi:type="number">172</field>
37+
<field name="attribute_id" xsi:type="string">%id%</field>
3838
<field name="frontend_label" xsi:type="string">Tax Class%isolation%</field>
3939
<field name="attribute_code" xsi:type="string">tax_class_id%isolation%</field>
4040
<field name="frontend_input" xsi:type="string">Dropdown</field>

dev/tests/functional/tests/app/Magento/Catalog/Test/Repository/CatalogProductSimple.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@
12251225
</dataset>
12261226

12271227
<dataset name="sample_data_simple_product">
1228-
<field name="id" xsi:type="string">1</field>
1228+
<field name="id" xsi:type="string">%id%</field>
12291229
<field name="name" xsi:type="string">Overnight Duffle</field>
12301230
<field name="sku" xsi:type="string">24-WB07</field>
12311231
<field name="url_key" xsi:type="string">overnight-duffle</field>

0 commit comments

Comments
 (0)