Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
RefreshReportsStatisticsTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Reports\Test\Page\Adminhtml\Statistics;
10 use Magento\Mtf\TestCase\Injectable;
11 use Magento\Mtf\TestStep\TestStepFactory;
12 
28 class RefreshReportsStatisticsTest extends Injectable
29 {
30  /* tags */
31  const MVP = 'no';
32  /* end tags */
33 
39  protected $reportStatistics;
40 
46  protected $testStepFactory;
47 
55  public function __inject(
56  TestStepFactory $testStepFactory,
57  Statistics $reportStatistics
58  ) {
59  $this->testStepFactory = $testStepFactory;
60  $this->reportStatistics = $reportStatistics;
61  }
62 
70  public function test($action, $configData)
71  {
72  // Preconditions
73  $this->testStepFactory->create(
74  \Magento\Config\Test\TestStep\SetupConfigurationStep::class,
75  ['configData' => $configData]
76  )->run();
77 
78  // Test steps
79  $this->reportStatistics->open();
80  $this->reportStatistics->getGridBlock()->massaction([], $action, true, 'Select All');
81  }
82 }
__inject(TestStepFactory $testStepFactory, Statistics $reportStatistics)