Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertNoAlertPopup.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Integration\Test\Page\Adminhtml\IntegrationNew;
10 use Magento\Mtf\Constraint\AbstractConstraint;
11 
15 class AssertNoAlertPopup extends AbstractConstraint
16 {
23  public function processAssert(
24  IntegrationNew $integrationNew
25  ) {
26  $isAlertPresent = $integrationNew->getFormPageActions()->isAlertPresent();
27  if ($isAlertPresent) {
28  $integrationNew->getFormPageActions()->acceptAlert();
29  }
30  \PHPUnit\Framework\Assert::assertFalse(
31  $isAlertPresent,
32  'Saving an integration should not cause alert.'
33  );
34  }
35 
41  public function toString()
42  {
43  return 'Integration is saved with no alert.';
44  }
45 }