8
8
9
9
use Magento \Catalog \Test \Page \Product \CatalogProductCompare ;
10
10
use Magento \Catalog \Test \Page \Product \CatalogProductView ;
11
+ use Magento \Catalog \Test \TestStep \CreateProductsStep ;
11
12
use Magento \Cms \Test \Page \CmsIndex ;
12
13
use Magento \Customer \Test \Fixture \Customer ;
13
14
use Magento \Customer \Test \Page \Adminhtml \CustomerIndex ;
14
15
use Magento \Customer \Test \Page \Adminhtml \CustomerIndexEdit ;
16
+ use Magento \Customer \Test \TestStep \LoginCustomerOnFrontendStep ;
17
+ use Magento \Mtf \Util \Command \Cli \Config ;
15
18
use Magento \Sales \Test \Page \Adminhtml \OrderCreateIndex ;
16
19
use Magento \Mtf \Client \BrowserInterface ;
17
20
use Magento \Mtf \TestCase \Injectable ;
@@ -91,22 +94,30 @@ class MoveRecentlyComparedProductsOnOrderPageTest extends Injectable
91
94
*/
92
95
protected $ catalogProductCompare ;
93
96
97
+ /**
98
+ * @var Config
99
+ */
100
+ private $ config ;
101
+
94
102
/**
95
103
* Create customer.
96
- *
97
104
* @param Customer $customer
98
105
* @param BrowserInterface $browser
106
+ * @param Config $config
99
107
* @return array
100
108
*/
101
- public function __prepare (Customer $ customer , BrowserInterface $ browser )
109
+ public function __prepare (Customer $ customer , BrowserInterface $ browser, Config $ config )
102
110
{
103
111
$ customer ->persist ();
104
112
// Login under customer
105
113
$ this ->objectManager
106
- ->create (\ Magento \ Customer \ Test \ TestStep \ LoginCustomerOnFrontendStep::class, ['customer ' => $ customer ])
114
+ ->create (LoginCustomerOnFrontendStep::class, ['customer ' => $ customer ])
107
115
->run ();
108
116
$ this ->browser = $ browser ;
109
117
118
+ $ this ->config = $ config ;
119
+ $ this ->config ->setConfig ('reports/options/enabled ' , 1 );
120
+
110
121
return ['customer ' => $ customer ];
111
122
}
112
123
@@ -139,18 +150,18 @@ public function __inject(
139
150
140
151
/**
141
152
* Move recently compared products on order page.
142
- *
143
153
* @param Customer $customer
144
154
* @param string $products
145
155
* @param bool $productsIsConfigured
146
156
* @return array
157
+ * @throws \Exception
147
158
*/
148
159
public function test (Customer $ customer , $ products , $ productsIsConfigured = false )
149
160
{
150
161
// Preconditions
151
162
// Create product
152
163
$ products = $ this ->objectManager ->create (
153
- \ Magento \ Catalog \ Test \ TestStep \ CreateProductsStep::class,
164
+ CreateProductsStep::class,
154
165
['products ' => $ products ]
155
166
)->run ()['products ' ];
156
167
foreach ($ products as $ itemProduct ) {
@@ -171,4 +182,10 @@ public function test(Customer $customer, $products, $productsIsConfigured = fals
171
182
172
183
return ['products ' => $ products , 'productsIsConfigured ' => $ productsIsConfigured ];
173
184
}
185
+
186
+ public function tearDown ()
187
+ {
188
+ $ this ->config ->setConfig ('reports/options/enabled ' , 0 );
189
+ parent ::tearDown ();
190
+ }
174
191
}
0 commit comments