Skip to content

Commit bfdcc6d

Browse files
author
Dale Sikkema
committed
Merge remote-tracking branch 'origin/MAGETWO-50160-fix-functional-test' into ext_pr
2 parents 4d7411e + fcaa162 commit bfdcc6d

File tree

16 files changed

+235
-49
lines changed

16 files changed

+235
-49
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class DropdownmultiselectElement extends MultiselectElement
3232
*
3333
* @var string
3434
*/
35-
protected $optionByValue = './/li[label[contains(normalize-space(.), %s)]]';
35+
protected $optionByValue = './/li//label[contains(normalize-space(.), %s)]';
3636

3737
/**
3838
* Set values.

dev/tests/functional/tests/app/Magento/Backend/Test/TestCase/ExpireAdminSessionTest.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
namespace Magento\Backend\Test\TestCase;
88

99
use Magento\Backend\Test\Page\Adminhtml\SystemConfigEdit;
10+
use Magento\Backend\Test\Page\AdminAuthLogin;
1011
use Magento\Config\Test\Fixture\ConfigData;
1112
use Magento\Mtf\TestCase\Injectable;
1213

@@ -46,10 +47,14 @@ class ExpireAdminSessionTest extends Injectable
4647
*
4748
* @param SystemConfigEdit $systemConfigEdit
4849
* @param ConfigData $sessionLifetimeConfig
50+
* @param AdminAuthLogin $adminAuthLogin
4951
* @return void
5052
*/
51-
public function test(SystemConfigEdit $systemConfigEdit, ConfigData $sessionLifetimeConfig)
52-
{
53+
public function test(
54+
SystemConfigEdit $systemConfigEdit,
55+
ConfigData $sessionLifetimeConfig,
56+
AdminAuthLogin $adminAuthLogin
57+
) {
5358
$this->systemConfigEdit = $systemConfigEdit;
5459
$this->sessionLifetimeConfig = $sessionLifetimeConfig;
5560
$this->systemConfigEdit->open();
@@ -71,7 +76,7 @@ public function test(SystemConfigEdit $systemConfigEdit, ConfigData $sessionLife
7176
*/
7277
sleep($section[$keys[0]]['label']);
7378

74-
$this->systemConfigEdit->open();
79+
$adminAuthLogin->open();
7580
}
7681

7782
/**

dev/tests/functional/tests/app/Magento/Catalog/Test/TestCase/NavigateMenuTest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
</variation>
1515
<variation name="NavigateMenuTest10">
1616
<data name="menuItem" xsi:type="string">Products > Categories</data>
17-
<data name="pageTitle" xsi:type="string">Categories</data>
17+
<data name="pageTitle" xsi:type="string">Default Category</data>
1818
<constraint name="Magento\Backend\Test\Constraint\AssertBackendPageIsAvailable"/>
1919
</variation>
2020
<variation name="NavigateMenuTest11">

dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Block/Edit/CmsForm.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
<input>multiselectgrouplist</input>
1313
</stores>
1414
<is_active>
15-
<input>checkbox</input>
15+
<selector>.admin__actions-switch-label</selector>
16+
<input>switcher</input>
1617
</is_active>
1718
</fields>
1819
</mapping>

dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/PageForm.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
<fields>
1414
<title />
1515
<is_active>
16-
<input>checkbox</input>
16+
<selector>.admin__actions-switch-label</selector>
17+
<input>switcher</input>
1718
</is_active>
1819
</fields>
1920
</page_information>

dev/tests/functional/tests/app/Magento/Cms/Test/Block/Adminhtml/Page/Edit/Tab/Content.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,13 @@ class Content extends Tab
5959
*/
6060
protected $contentHeading = '[name="content_heading"]';
6161

62+
/**
63+
* Header locator.
64+
*
65+
* @var string
66+
*/
67+
protected $header = 'header.page-header';
68+
6269
/**
6370
* Clicking in content tab 'Insert Variable' button.
6471
*
@@ -85,7 +92,12 @@ public function clickInsertWidget(SimpleElement $element = null)
8592
$context = $element === null ? $this->_rootElement : $element;
8693
$addWidgetButton = $context->find($this->addWidgetButton);
8794
if ($addWidgetButton->isVisible()) {
88-
$addWidgetButton->click();
95+
try {
96+
$addWidgetButton->click();
97+
} catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
98+
$this->browser->find($this->header)->hover();
99+
$addWidgetButton->click();
100+
}
89101
}
90102
}
91103

dev/tests/functional/tests/app/Magento/Cms/Test/Constraint/AssertCmsBlockNotInGrid.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public function processAssert(CmsBlock $cmsBlock, CmsBlockIndex $cmsBlockIndex)
2929
{
3030
$cmsBlockIndex->open();
3131
$data = $cmsBlock->getData();
32+
$data['is_active'] = $data['is_active'] == 'Yes' ? 'Enabled' : 'Disabled';
3233
if (isset($data['stores'])) {
3334
$storeId = is_array($data['stores']) ? reset($data['stores']) : $data['stores'];
3435
$parts = explode("/", $storeId);

dev/tests/functional/tests/app/Magento/Customer/Test/Block/Form/Register.php

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,20 @@ class Register extends Form
3030
*/
3131
protected $customerAttribute = "[name='%s']";
3232

33+
/**
34+
* Locator for password error
35+
*
36+
* @var string
37+
*/
38+
protected $passwordError = "#password-error";
39+
40+
/**
41+
* Locator for password confirmation error
42+
*
43+
* @var string
44+
*/
45+
protected $passwordConfirmationError = "#password-confirmation-error";
46+
3347
/**
3448
* Create new customer account and fill billing address if it exists
3549
*
@@ -44,4 +58,26 @@ public function registerCustomer(FixtureInterface $fixture, $address = null)
4458
}
4559
$this->_rootElement->find($this->submit, Locator::SELECTOR_CSS)->click();
4660
}
61+
62+
/**
63+
* Get password error on new customer registration form.
64+
*
65+
* @return string
66+
*
67+
*/
68+
public function getPasswordError()
69+
{
70+
return $this->_rootElement->find($this->passwordError, Locator::SELECTOR_CSS)->getText();
71+
}
72+
73+
/**
74+
* Get password confirmation error on new customer registration form.
75+
*
76+
* @return string
77+
*
78+
*/
79+
public function getPasswordConfirmationError()
80+
{
81+
return $this->_rootElement->find($this->passwordConfirmationError, Locator::SELECTOR_CSS)->getText();
82+
}
4783
}

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/CreateExistingCustomerFrontendEntity.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<data name="customer/data/firstname" xsi:type="string">john</data>
1212
<data name="customer/data/lastname" xsi:type="string">doe</data>
1313
<data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data>
14-
<data name="customer/data/password" xsi:type="string">123123q</data>
15-
<data name="customer/data/password_confirmation" xsi:type="string">123123q</data>
14+
<data name="customer/data/password" xsi:type="string">123123q#</data>
15+
<data name="customer/data/password_confirmation" xsi:type="string">123123q#</data>
1616
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerFailRegisterMessage" />
1717
</variation>
1818
</testCase>

dev/tests/functional/tests/app/Magento/Customer/Test/TestCase/RegisterCustomerFrontendEntityTest.xml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,23 +41,5 @@
4141
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerSuccessRegisterMessage" />
4242
<constraint name="Magento\Customer\Test\Constraint\AssertCustomerRedirectToDashboard" />
4343
</variation>
44-
<variation name="RegisterCustomerFrontendEntityTestVariation4" summary="Customer password length is below 8 characters">
45-
<data name="customer/data/firstname" xsi:type="string">john</data>
46-
<data name="customer/data/lastname" xsi:type="string">doe</data>
47-
<data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data>
48-
<data name="customer/data/is_subscribed" xsi:type="string">No</data>
49-
<data name="customer/data/password" xsi:type="string">123123q</data>
50-
<data name="customer/data/password_confirmation" xsi:type="string">123123q</data>
51-
<constraint name="Magento\Customer\Test\Constraint\AssertPasswordLengthErrorMessage" />
52-
</variation>
53-
<variation name="RegisterCustomerFrontendEntityTestVariation5" summary="Customer password is not secure enough">
54-
<data name="customer/data/firstname" xsi:type="string">john</data>
55-
<data name="customer/data/lastname" xsi:type="string">doe</data>
56-
<data name="customer/data/email" xsi:type="string">johndoe%isolation%@example.com</data>
57-
<data name="customer/data/is_subscribed" xsi:type="string">No</data>
58-
<data name="customer/data/password" xsi:type="string">123123qw</data>
59-
<data name="customer/data/password_confirmation" xsi:type="string">123123qw</data>
60-
<constraint name="Magento\Customer\Test\Constraint\AssertPasswordIsNotSecureEnoughMessage" />
61-
</variation>
6244
</testCase>
6345
</config>

0 commit comments

Comments
 (0)