Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertEndpointContentDisplay.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertEndpointContentDisplay extends AbstractConstraint
16 {
25  public function processAssert(SwaggerUiPage $swaggerPage, $serviceName, array $endpoints)
26  {
27  foreach ($endpoints as $endpoint) {
31  $operationContentSelector = '#operations-%s-%s%s .opblock-body';
32 
33  $operationContentSelector = sprintf($operationContentSelector, $serviceName, $serviceName, $endpoint);
34  \PHPUnit\Framework\Assert::assertTrue(
35  $swaggerPage->isElementVisible($operationContentSelector),
36  'REST API endpoint operation content on swagger page.'
37  );
38  }
39  }
40 
46  public function toString()
47  {
48  return 'REST API endpoint operation content on swagger page.';
49  }
50 }
processAssert(SwaggerUiPage $swaggerPage, $serviceName, array $endpoints)
isElementVisible($selector, $strategy=Locator::SELECTOR_CSS)