Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
SwaggerUiForRestApiTest.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\TestCase\Injectable;
11 
27 class SwaggerUiForRestApiTest extends Injectable
28 {
29  /* tags */
30  const MVP = 'no';
31  const TEST_TYPE = 'extended_acceptance_test';
32  /* end tags */
33 
39  protected $serviceName;
40 
46  protected $endpoints;
47 
53  protected $swaggerPage;
54 
61  public function __inject(
63  ) {
64  $this->swaggerPage = $swaggerPage;
65  }
66 
74  public function test(
76  array $endpoints
77  ) {
78  $this->serviceName = $serviceName;
79  $this->endpoints = $endpoints;
80  $this->swaggerPage->open();
81  $this->swaggerPage->expandServiceContent($this->serviceName);
82  foreach ($endpoints as $endpoint) {
83  $this->swaggerPage->expandEndpointContent($serviceName, $endpoint);
84  }
85  }
86 
92  public function tearDown()
93  {
94  foreach ($this->endpoints as $endpoint) {
95  $this->swaggerPage->closeEndpointContent($this->serviceName, $endpoint);
96  }
97  $this->swaggerPage->closeServiceContent($this->serviceName);
98  $this->swaggerPage->close();
99  }
100 }