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