Skip to content

Commit 6fad45d

Browse files
authored
Merge pull request #707 from magento-qmt/MTA-3852
[Mavericks] Create 2.0 'green' functional test suite
2 parents 1c2e761 + c757acc commit 6fad45d

File tree

60 files changed

+406
-155
lines changed

Some content is hidden

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

60 files changed

+406
-155
lines changed
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?php
2+
/**
3+
* Copyright © 2016 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Client\Element;
8+
9+
use Magento\Mtf\Client\Locator;
10+
11+
/**
12+
* Class provides ability to work with page element radio button.
13+
*/
14+
class RadiobuttonElement extends SimpleElement
15+
{
16+
/**
17+
* Label for radio button selector.
18+
*
19+
* @var string
20+
*/
21+
protected $labelSelector = './..//label[contains(., "%s")]';
22+
23+
/**
24+
* Selector for selected label.
25+
*
26+
* @var string
27+
*/
28+
protected $selectedLabelSelector = 'input[type=radio]:checked + label';
29+
30+
/**
31+
* Get value of the required element.
32+
*
33+
* @return string
34+
*/
35+
public function getValue()
36+
{
37+
$this->eventManager->dispatchEvent(['get_value'], [$this->getAbsoluteSelector()]);
38+
return $this->find($this->selectedLabelSelector)->getText();
39+
}
40+
41+
/**
42+
* Select radio button based on label value.
43+
*
44+
* @param string $value
45+
* @return void
46+
*/
47+
public function setValue($value)
48+
{
49+
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]);
50+
$radioButtonLabel = $this->find(sprintf($this->labelSelector, $value), Locator::SELECTOR_XPATH);
51+
if (!$this->isSelected()) {
52+
$radioButtonLabel->click();
53+
}
54+
}
55+
}

dev/tests/functional/lib/Magento/Mtf/Client/Element/SuggestElement.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ public function setValue($value)
6666
$searchedItem = $this->find(sprintf($this->resultItem, $value), Locator::SELECTOR_XPATH);
6767
if ($searchedItem->isVisible()) {
6868
try {
69+
$searchedItem->hover();
6970
$searchedItem->click();
7071
break;
7172
} catch (\Exception $e) {

dev/tests/functional/tests/app/Magento/Backend/Test/Block/Widget/Grid.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ public function isFirstRowVisible()
466466
*/
467467
public function openFirstRow()
468468
{
469+
$this->waitLoader();
469470
$this->_rootElement->find($this->firstRowSelector, Locator::SELECTOR_XPATH)->click();
470471
}
471472

dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/GlobalSearchEntityTest.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,25 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Backend\Test\TestCase\GlobalSearchEntityTest" summary="Global Search Backend " ticketId="MAGETWO-28457">
1010
<variation name="GlobalSearchEntityTestVariation2">
11+
<data name="tag" xsi:type="string">stable:no</data>
1112
<data name="description" xsi:type="string">search with 2 sign return no results</data>
1213
<data name="search/data/query" xsi:type="string">:)</data>
1314
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchNoRecordsFound" />
1415
</variation>
1516
<variation name="GlobalSearchEntityTestVariation3">
17+
<data name="tag" xsi:type="string">stable:no</data>
1618
<data name="description" xsi:type="string">search product by sku</data>
1719
<data name="search/data/query" xsi:type="string">orderInjectable::default::product::sku</data>
1820
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchProductName" />
1921
</variation>
2022
<variation name="GlobalSearchEntityTestVariation4">
23+
<data name="tag" xsi:type="string">stable:no</data>
2124
<data name="description" xsi:type="string">search existed customer</data>
2225
<data name="search/data/query" xsi:type="string">customer::johndoe_unique::lastname</data>
2326
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchCustomerName" />
2427
</variation>
2528
<variation name="GlobalSearchEntityTestVariation5">
29+
<data name="tag" xsi:type="string">stable:no</data>
2630
<data name="description" xsi:type="string">search order (by order id)</data>
2731
<data name="search/data/query" xsi:type="string">orderInjectable::default::id</data>
2832
<constraint name="Magento\Backend\Test\Constraint\AssertGlobalSearchOrderId" />

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
99
<testCase name="Magento\Bundle\Test\TestCase\CreateBundleProductEntityTest" summary="Create Bundle Product" ticketId="MAGETWO-24118">
1010
<variation name="CreateBundleProductEntityTestVariation1">
11+
<data name="tag" xsi:type="string">to_maintain:yes</data>
1112
<data name="description" xsi:type="string">Create default bundle with dynamic options</data>
1213
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
1314
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
@@ -23,6 +24,7 @@
2324
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" />
2425
</variation>
2526
<variation name="CreateBundleProductEntityTestVariation2">
27+
<data name="tag" xsi:type="string">to_maintain:yes</data>
2628
<data name="description" xsi:type="string">Create offline dynamic bundle with dynamic price and out of stock</data>
2729
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
2830
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
@@ -44,6 +46,7 @@
4446
<constraint name="Magento\Catalog\Test\Constraint\AssertProductNotSearchableBySku" />
4547
</variation>
4648
<variation name="CreateBundleProductEntityTestVariation3">
49+
<data name="tag" xsi:type="string">to_maintain:yes</data>
4750
<data name="description" xsi:type="string">Create dynamic bundle with price randle and all types options</data>
4851
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
4952
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
@@ -99,6 +102,7 @@
99102
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleItemsOnProductPage" />
100103
</variation>
101104
<variation name="CreateBundleProductEntityTestVariation5">
105+
<data name="tag" xsi:type="string">to_maintain:yes</data>
102106
<data name="description" xsi:type="string">Create fixed bundle with all types options</data>
103107
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
104108
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
@@ -134,6 +138,7 @@
134138
<constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" />
135139
</variation>
136140
<variation name="CreateBundleProductEntityTestVariation6">
141+
<data name="tag" xsi:type="string">to_maintain:yes</data>
137142
<data name="description" xsi:type="string">Create fixed bundle which is out of stock</data>
138143
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
139144
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
@@ -163,6 +168,7 @@
163168
<constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceView" />
164169
</variation>
165170
<variation name="CreateBundleProductEntityTestVariation7">
171+
<data name="tag" xsi:type="string">to_maintain:yes</data>
166172
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
167173
<data name="product/data/name" xsi:type="string">BundleProduct %isolation%</data>
168174
<data name="product/data/sku_type" xsi:type="string">Dynamic</data>
@@ -238,6 +244,7 @@
238244
<constraint name="Magento\Bundle\Test\Constraint\AssertBundlePriceType" />
239245
</variation>
240246
<variation name="CreateBundleProductEntityTestVariation11">
247+
<data name="tag" xsi:type="string">to_maintain:yes</data>
241248
<data name="description" xsi:type="string">Create fixed product with checkout first option</data>
242249
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
243250
<data name="product/data/name" xsi:type="string">Bundle Fixed %isolation%</data>
@@ -258,6 +265,7 @@
258265
<constraint name="Magento\Bundle\Test\Constraint\AssertProductCustomOptionsOnBundleProductPage" />
259266
</variation>
260267
<variation name="CreateBundleProductEntityTestVariation12">
268+
<data name="tag" xsi:type="string">to_maintain:yes</data>
261269
<data name="description" xsi:type="string">Create fixed product with checkout second option</data>
262270
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
263271
<data name="product/data/name" xsi:type="string">Bundle Fixed %isolation%</data>
@@ -288,6 +296,7 @@
288296
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSaveMessage" />
289297
</variation>
290298
<variation name="CreateBundleProductEntityTestVariation14">
299+
<data name="tag" xsi:type="string">stable:no</data>
291300
<data name="description" xsi:type="string">Create default fixed bundle</data>
292301
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
293302
<data name="product/data/name" xsi:type="string">Bundle Fixed %isolation%</data>
@@ -336,6 +345,7 @@
336345
<constraint name="Magento\Bundle\Test\Constraint\AssertBundleProductPage" />
337346
</variation>
338347
<variation name="CreateBundleProductEntityTestVariation25" summary="Create Bundle (dynamic) Product with one require option with one item" ticketId="MAGETWO-59841">
348+
<data name="tag" xsi:type="string">to_maintain:yes</data>
339349
<data name="product/data/url_key" xsi:type="string">bundle-product-%isolation%</data>
340350
<data name="product/data/name" xsi:type="string">Bundle Dynamic %isolation%</data>
341351
<data name="product/data/sku" xsi:type="string">sku_bundle_dynamic_%isolation%</data>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Product extends Tab
2020
*
2121
* @var string
2222
*/
23-
protected $selectItem = 'tbody tr .col-in_category';
23+
protected $selectItem = 'tbody tr .col-in_category input';
2424

2525
/**
2626
* Product grid locator.

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Tab;
88

99
use Magento\Mtf\Client\Locator;
10-
use Magento\Catalog\Test\Fixture\Category;
1110
use Magento\Mtf\Client\Element\SimpleElement;
1211
use Magento\Catalog\Test\Block\Adminhtml\Product\Edit\ProductTab;
1312

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/CreateCategoryEntityTest.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryPage" />
5656
</variation>
5757
<variation name="CreateCategoryEntityTestVariation4">
58+
<data name="tag" xsi:type="string">to_maintain:yes</data>
5859
<data name="description" xsi:type="string">Create not anchor subcategory with required fields</data>
5960
<data name="addCategory" xsi:type="string">addSubcategory</data>
6061
<data name="category/data/parent_id/dataset" xsi:type="string">default_category</data>
@@ -74,6 +75,7 @@
7475
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" />
7576
</variation>
7677
<variation name="CreateCategoryEntityTestVariation5">
78+
<data name="tag" xsi:type="string">to_maintain:yes</data>
7779
<data name="description" xsi:type="string">Create anchor subcategory with all fields</data>
7880
<data name="addCategory" xsi:type="string">addSubcategory</data>
7981
<data name="category/data/parent_id/dataset" xsi:type="string">default_category</data>
@@ -145,7 +147,7 @@
145147
<data name="category/data/is_active" xsi:type="string">Yes</data>
146148
<data name="category/data/include_in_menu" xsi:type="string">Yes</data>
147149
<data name="category/data/category_products/dataset" xsi:type="string">catalogProductSimple::default, configurableProduct::default, bundleProduct::bundle_fixed_product</data>
148-
<data name="tag" xsi:type="string">test_type:acceptance_test</data>
150+
<data name="tag" xsi:type="string">test_type:acceptance_test, to_maintain:yes</data>
149151
<constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" />
150152
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForAssignedProducts" />
151153
</variation>

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Category/UpdateCategoryEntityTest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
<constraint name="Magento\Catalog\Test\Constraint\AssertCategoryForm" />
4848
</variation>
4949
<variation name="UpdateCategoryEntityTestVariation4" summary="Update Category with custom Store View.">
50+
<data name="tag" xsi:type="string">to_maintain:yes</data>
5051
<data name="category/data/store_id/dataset" xsi:type="string">custom</data>
5152
<data name="category/data/name" xsi:type="string">Category %isolation%</data>
5253
<constraint name="Magento\Catalog\Test\Constraint\AssertCategorySaveMessage" />

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/Product/CreateSimpleProductEntityTest.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
<constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" />
4747
</variation>
4848
<variation name="CreateSimpleProductEntityTestVariation3">
49+
<data name="tag" xsi:type="string">to_maintain:yes</data>
4950
<data name="description" xsi:type="string">Create product with special price and custom options(fixed price)</data>
5051
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
5152
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
@@ -66,6 +67,7 @@
6667
<constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" />
6768
</variation>
6869
<variation name="CreateSimpleProductEntityTestVariation4">
70+
<data name="tag" xsi:type="string">to_maintain:yes</data>
6971
<data name="description" xsi:type="string">Create product with special price and custom options(percent price)</data>
7072
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
7173
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
@@ -86,6 +88,7 @@
8688
<constraint name="Magento\Catalog\Test\Constraint\AssertProductInCart" />
8789
</variation>
8890
<variation name="CreateSimpleProductEntityTestVariation5">
91+
<data name="tag" xsi:type="string">stable:no</data>
8992
<data name="description" xsi:type="string">Create product with group price and custom options(percent price)</data>
9093
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
9194
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
@@ -207,6 +210,7 @@
207210
<constraint name="Magento\Catalog\Test\Constraint\AssertProductOutOfStock" />
208211
</variation>
209212
<variation name="CreateSimpleProductEntityTestVariation12">
213+
<data name="tag" xsi:type="string">to_maintain:yes</data>
210214
<data name="description" xsi:type="string">Create product that visible only in search</data>
211215
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
212216
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
@@ -238,6 +242,7 @@
238242
<constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
239243
</variation>
240244
<variation name="CreateSimpleProductEntityTestVariation14">
245+
<data name="tag" xsi:type="string">stable:no</data>
241246
<data name="description" xsi:type="string">Create simple product and check visibility in category</data>
242247
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
243248
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
@@ -255,6 +260,7 @@
255260
<constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
256261
</variation>
257262
<variation name="CreateSimpleProductEntityTestVariation15">
263+
<data name="tag" xsi:type="string">stable:no</data>
258264
<data name="description" xsi:type="string">Create product with tax class and group price</data>
259265
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
260266
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
@@ -292,6 +298,7 @@
292298
<constraint name="Magento\Catalog\Test\Constraint\AssertProductSpecialPriceOnProductPage" />
293299
</variation>
294300
<variation name="CreateSimpleProductEntityTestVariation17">
301+
<data name="tag" xsi:type="string">stable:no</data>
295302
<data name="description" xsi:type="string">Create product without tax class and tier price</data>
296303
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
297304
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
@@ -394,6 +401,7 @@
394401
<constraint name="Magento\Catalog\Test\Constraint\AssertAddToCartButtonAbsent" />
395402
</variation>
396403
<variation name="CreateSimpleProductEntityTestVariation23" summary="Create Simple Product with Creating New Category (Required Fields Only)" ticketId="MAGETWO-13345">
404+
<data name="tag" xsi:type="string">to_maintain:yes</data>
397405
<data name="product/data/category_ids/new_category" xsi:type="string">yes</data>
398406
<data name="product/data/category_ids/dataset" xsi:type="string">default_subcategory</data>
399407
<data name="product/data/url_key" xsi:type="string">simple%isolation%</data>
@@ -405,6 +413,7 @@
405413
<constraint name="Magento\Catalog\Test\Constraint\AssertProductPage" />
406414
</variation>
407415
<variation name="CreateSimpleProductEntityTestVariation24" summary="Create Simple Product and Assigning It to Category" ticketId="MAGETWO-12514">
416+
<data name="tag" xsi:type="string">stable:no</data>
408417
<data name="product/data/url_key" xsi:type="string">simple-product-%isolation%</data>
409418
<data name="product/data/name" xsi:type="string">Simple Product %isolation%</data>
410419
<data name="product/data/sku" xsi:type="string">simple_sku_%isolation%</data>

0 commit comments

Comments
 (0)