Skip to content

Commit 8a9424a

Browse files
author
olysenko
committed
MAGETWO-63737: [FT] Analytics Subscription Tests are failing on CI
1 parent 5f9ea24 commit 8a9424a

File tree

6 files changed

+92
-68
lines changed

6 files changed

+92
-68
lines changed

dev/tests/functional/tests/app/Magento/Analytics/Test/Constraint/AssertConfigAnalyticsDisabled.php

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
use Magento\Mtf\Constraint\AbstractConstraint;
99
use Magento\Analytics\Test\Page\Adminhtml\ConfigAnalytics;
10-
use Magento\Backend\Test\Page\Adminhtml\Dashboard;
11-
use Magento\Backend\Test\Page\Adminhtml\SystemConfigEdit;
10+
use Magento\Analytics\Test\TestStep\OpenAnalyticsConfigStep;
1211

1312
/**
1413
* Assert Analytics is disabled in Stores>Configuration>General>Analytics->General menu.
@@ -19,31 +18,21 @@ class AssertConfigAnalyticsDisabled extends AbstractConstraint
1918
* Assert Analytics is disabled in Stores > Configuration > General > Analytics menu.
2019
*
2120
* @param ConfigAnalytics $configAnalytics
22-
* @param Dashboard $dashboard
23-
* @param SystemConfigEdit $systemConfigPage
21+
* @param OpenAnalyticsConfigStep $openAnalyticsConfigStep
2422
* @return void
2523
*/
26-
public function processAssert(
27-
ConfigAnalytics $configAnalytics,
28-
Dashboard $dashboard,
29-
SystemConfigEdit $systemConfigPage
30-
) {
31-
$this->objectManager->create(
32-
\Magento\Analytics\Test\TestStep\OpenAnalyticsConfigStep::class,
33-
[
34-
'dashboard' => $dashboard,
35-
'systemConfigPage' => $systemConfigPage
36-
]
37-
)->run();
24+
public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsConfigStep $openAnalyticsConfigStep)
25+
{
26+
$openAnalyticsConfigStep->run();
3827

3928
\PHPUnit_Framework_Assert::assertFalse(
4029
(bool)$configAnalytics->getAnalyticsForm()->isAnalyticsEnabled(),
41-
'Magento Analytics is not disabled'
30+
'Magento Analytics is not disabled.'
4231
);
4332
\PHPUnit_Framework_Assert::assertEquals(
4433
$configAnalytics->getAnalyticsForm()->getAnalyticsStatus(),
4534
'Subscription status: Disabled',
46-
'Magento Analytics status is not disabled'
35+
'Magento Analytics status is not disabled.'
4736
);
4837
}
4938

@@ -55,6 +44,6 @@ public function processAssert(
5544
public function toString()
5645
{
5746
return 'Magento Analytics is disabled in Stores > Configuration > General > Analytics > General menu'
58-
. ' and has Disabled status';
47+
. ' and has Disabled status.';
5948
}
6049
}

dev/tests/functional/tests/app/Magento/Analytics/Test/Constraint/AssertConfigAnalyticsEnabled.php

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77

88
use Magento\Mtf\Constraint\AbstractConstraint;
99
use Magento\Analytics\Test\Page\Adminhtml\ConfigAnalytics;
10-
use Magento\Backend\Test\Page\Adminhtml\Dashboard;
11-
use Magento\Backend\Test\Page\Adminhtml\SystemConfigEdit;
10+
use Magento\Analytics\Test\TestStep\OpenAnalyticsConfigStep;
1211

1312
/**
1413
* Assert Analytics is enabled in Stores > Configuration > General > Analytics > General menu.
@@ -19,31 +18,22 @@ class AssertConfigAnalyticsEnabled extends AbstractConstraint
1918
* Assert Analytics is enabled in Stores > Configuration > General > Analytics menu.
2019
*
2120
* @param ConfigAnalytics $configAnalytics
22-
* @param Dashboard $dashboard
23-
* @param SystemConfigEdit $systemConfigPage
21+
* @param OpenAnalyticsConfigStep $openAnalyticsConfigStep
2422
* @return void
2523
*/
26-
public function processAssert(
27-
ConfigAnalytics $configAnalytics,
28-
Dashboard $dashboard,
29-
SystemConfigEdit $systemConfigPage
30-
) {
31-
$this->objectManager->create(
32-
\Magento\Analytics\Test\TestStep\OpenAnalyticsConfigStep::class,
33-
[
34-
'dashboard' => $dashboard,
35-
'systemConfigPage' => $systemConfigPage
36-
]
37-
)->run();
24+
public function processAssert(ConfigAnalytics $configAnalytics, OpenAnalyticsConfigStep $openAnalyticsConfigStep)
25+
{
26+
$openAnalyticsConfigStep->run();
27+
3828
\PHPUnit_Framework_Assert::assertTrue(
3929
(bool)$configAnalytics->getAnalyticsForm()->isAnalyticsEnabled(),
40-
'Magento Analytics is not enabled'
30+
'Magento Analytics is not enabled.'
4131
);
4232

4333
\PHPUnit_Framework_Assert::assertEquals(
4434
$configAnalytics->getAnalyticsForm()->getAnalyticsStatus(),
4535
'Subscription status: Pending',
46-
'Magento Analytics status is not pending'
36+
'Magento Analytics status is not pending.'
4737
);
4838
}
4939

dev/tests/functional/tests/app/Magento/Analytics/Test/Constraint/AssertConfigAnalyticsRestored.php

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
use Magento\Mtf\Constraint\AbstractConstraint;
99
use Magento\Analytics\Test\Page\Adminhtml\ConfigAnalytics;
10-
use Magento\Backend\Test\Page\Adminhtml\Dashboard;
10+
use Magento\Analytics\Test\TestStep\OpenAnalyticsConfigStep;
1111
use Magento\Backend\Test\Page\Adminhtml\SystemConfigEdit;
1212

1313
/**
@@ -19,32 +19,26 @@ class AssertConfigAnalyticsRestored extends AbstractConstraint
1919
* Assert sending data to the Analytics is restored.
2020
*
2121
* @param ConfigAnalytics $configAnalytics
22-
* @param Dashboard $dashboard
22+
* @param OpenAnalyticsConfigStep $openAnalyticsConfigStep
2323
* @param SystemConfigEdit $systemConfigPage
2424
* @param string $vertical
2525
* @return void
2626
*/
2727
public function processAssert(
2828
ConfigAnalytics $configAnalytics,
29-
Dashboard $dashboard,
29+
OpenAnalyticsConfigStep $openAnalyticsConfigStep,
3030
SystemConfigEdit $systemConfigPage,
3131
$vertical
3232
) {
33-
$this->objectManager->create(
34-
\Magento\Analytics\Test\TestStep\OpenAnalyticsConfigStep::class,
35-
[
36-
'dashboard' => $dashboard,
37-
'systemConfigPage' => $systemConfigPage
38-
]
39-
)->run();
33+
$openAnalyticsConfigStep->run();
4034

4135
$configAnalytics->getAnalyticsForm()->enableAnalytics();
4236
$configAnalytics->getAnalyticsForm()->setAnalyticsVertical($vertical);
4337
$configAnalytics->getAnalyticsForm()->saveConfig();
4438

4539
\PHPUnit_Framework_Assert::assertTrue(
4640
$systemConfigPage->getMessagesBlock()->assertSuccessMessage(),
47-
'Sending data to the Analytics is not saved'
41+
'Sending data to the Analytics is not saved.'
4842
);
4943
}
5044

@@ -55,6 +49,6 @@ public function processAssert(
5549
*/
5650
public function toString()
5751
{
58-
return 'Sending data to the Analytics is saved';
52+
return 'Sending data to the Analytics is saved.';
5953
}
6054
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2013-2017 Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
9+
<testCase name="Magento\Install\Test\TestCase\InstallTest" summary="[Web Setup][Auto] Install CE Magento via Web Interface">
10+
<variation name="InstallTestVariation1" summary="Restore Magento analytics subscription" ticketId="MAGETWO-63196">
11+
<data name="tag" xsi:type="string">severity:S1</data>
12+
<data name="vertical" xsi:type="string">Apps and Games</data>
13+
<constraint name="Magento\Analytics\Test\Constraint\AssertSkipSubscriptionPopup" prev="Magento\User\Test\Constraint\AssertUserSuccessLogin" next="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsRestored" />
14+
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsRestored" prev="Magento\Analytics\Test\Constraint\AssertSkipSubscriptionPopup" next="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsEnabled" />
15+
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsEnabled" prev="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsRestored" />
16+
</variation>
17+
<variation name="InstallTestVariation2" summary="Decline Magento analytics subscription" ticketId="MAGETWO-63156">
18+
<data name="tag" xsi:type="string">severity:S1</data>
19+
<constraint name="Magento\Analytics\Test\Constraint\AssertDeclineSubscriptionPopup" prev="Magento\User\Test\Constraint\AssertUserSuccessLogin" next="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsDisabled" />
20+
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsDisabled" prev="Magento\Analytics\Test\Constraint\AssertDeclineSubscriptionPopup" />
21+
</variation>
22+
<variation name="InstallTestVariation3" summary="Accept Magento analytics subscription" ticketId="MAGETWO-63108">
23+
<data name="tag" xsi:type="string">severity:S1</data>
24+
<constraint name="Magento\Analytics\Test\Constraint\AssertAcceptSubscriptionPopup" prev="Magento\User\Test\Constraint\AssertUserSuccessLogin" next="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsEnabled" />
25+
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsEnabled" prev="Magento\Analytics\Test\Constraint\AssertAcceptSubscriptionPopup" />
26+
</variation>
27+
</testCase>
28+
</config>

dev/tests/functional/tests/app/Magento/Analytics/Test/etc/di.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,34 @@
1818
<argument name="severity" xsi:type="string">S1</argument>
1919
</arguments>
2020
</type>
21+
<type name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsDisabled">
22+
<arguments>
23+
<argument name="severity" xsi:type="string">S1</argument>
24+
</arguments>
25+
</type>
26+
<type name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsEnabled">
27+
<arguments>
28+
<argument name="severity" xsi:type="string">S1</argument>
29+
</arguments>
30+
</type>
31+
<type name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsRestored">
32+
<arguments>
33+
<argument name="severity" xsi:type="string">S1</argument>
34+
</arguments>
35+
</type>
36+
<type name="Magento\Analytics\Test\Constraint\AssertAcceptSubscriptionPopup">
37+
<arguments>
38+
<argument name="severity" xsi:type="string">S1</argument>
39+
</arguments>
40+
</type>
41+
<type name="Magento\Analytics\Test\Constraint\AssertDeclineSubscriptionPopup">
42+
<arguments>
43+
<argument name="severity" xsi:type="string">S1</argument>
44+
</arguments>
45+
</type>
46+
<type name="Magento\Analytics\Test\Constraint\AssertSkipSubscriptionPopup">
47+
<arguments>
48+
<argument name="severity" xsi:type="string">S1</argument>
49+
</arguments>
50+
</type>
2151
</config>

dev/tests/functional/tests/app/Magento/Install/Test/TestCase/InstallTest.xml

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,33 @@
66
*/
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/variations.xsd">
9-
<testCase name="Magento\Install\Test\TestCase\InstallTest" summary="[Web Setup][Auto] Install CE Magento via Web Interface; restore Magento analytics subscription" ticketId="MAGETWO-31431, MAGETWO-63196">
10-
<variation name="InstallTestVariation1" summary="Install with custom admin path">
9+
<testCase name="Magento\Install\Test\TestCase\InstallTest" summary="[Web Setup][Auto] Install CE Magento via Web Interface" ticketId="MAGETWO-31431">
10+
<variation name="InstallTestVariation1" firstConstraint="Magento\Install\Test\Constraint\AssertSuccessInstall" summary="Install with custom admin path">
1111
<data name="user/dataset" xsi:type="string">default</data>
1212
<data name="install/admin" xsi:type="string">custom</data>
1313
<data name="vertical" xsi:type="string">Apps and Games</data>
14-
<constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" />
15-
<constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
16-
<constraint name="Magento\Analytics\Test\Constraint\AssertSkipSubscriptionPopup" />
17-
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsRestored" />
18-
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsEnabled" />
14+
<constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" next="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
15+
<constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" prev="Magento\Install\Test\Constraint\AssertSuccessInstall" />
1916
</variation>
20-
<variation name="InstallTestVariation2" summary="Install with custom encryption key and changed currency and locale; decline Magento analytics subscription" ticketId="MAGETWO-63156">
17+
<variation name="InstallTestVariation2" firstConstraint="Magento\Install\Test\Constraint\AssertSuccessInstall" summary="Install with custom encryption key and changed currency and locale">
2118
<data name="user/dataset" xsi:type="string">default</data>
2219
<data name="install/keyOwn" xsi:type="string">I want to use my own encryption key</data>
2320
<data name="install/keyValue" xsi:type="string">123123qa</data>
2421
<data name="install/storeLanguage" xsi:type="string">German (Germany)</data>
2522
<data name="install/storeCurrency" xsi:type="string">Euro (EUR)</data>
2623
<data name="currencySymbol" xsi:type="string">€</data>
2724
<data name="languageTemplate" xsi:type="string">Suchbegriffe</data>
28-
<constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" />
29-
<constraint name="Magento\Install\Test\Constraint\AssertKeyCreated" />
30-
<constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
31-
<constraint name="Magento\Install\Test\Constraint\AssertCurrencySelected" />
32-
<constraint name="Magento\Analytics\Test\Constraint\AssertDeclineSubscriptionPopup" />
33-
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsDisabled" />
25+
<constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" next="Magento\Install\Test\Constraint\AssertKeyCreated" />
26+
<constraint name="Magento\Install\Test\Constraint\AssertKeyCreated" prev="Magento\Install\Test\Constraint\AssertSuccessInstall" next="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
27+
<constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" prev="Magento\Install\Test\Constraint\AssertKeyCreated" next="Magento\Install\Test\Constraint\AssertCurrencySelected" />
28+
<constraint name="Magento\Install\Test\Constraint\AssertCurrencySelected" prev="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
3429
</variation>
35-
<variation name="InstallTestVariation3" summary="Install with table prefix; accept Magento analytics subscription" ticketId="MAGETWO-63108">
30+
<variation name="InstallTestVariation3" summary="Install with table prefix">
3631
<data name="user/dataset" xsi:type="string">default</data>
3732
<data name="install/dbTablePrefix" xsi:type="string">pref_</data>
3833
<data name="install/storeLanguage" xsi:type="string">Chinese (China)</data>
39-
<constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" />
40-
<constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
41-
<constraint name="Magento\Analytics\Test\Constraint\AssertAcceptSubscriptionPopup" />
42-
<constraint name="Magento\Analytics\Test\Constraint\AssertConfigAnalyticsEnabled" />
34+
<constraint name="Magento\Install\Test\Constraint\AssertSuccessInstall" next="Magento\User\Test\Constraint\AssertUserSuccessLogin" />
35+
<constraint name="Magento\User\Test\Constraint\AssertUserSuccessLogin" prev="Magento\Install\Test\Constraint\AssertSuccessInstall" />
4336
</variation>
4437
<variation name="InstallTestVariation4" summary="Install with enabled url rewrites">
4538
<data name="user/dataset" xsi:type="string">default</data>

0 commit comments

Comments
 (0)