/**
  * Create Integration Entity test.
  *
  * @param Integration $integration
  * @return void
  */
 public function test(Integration $integration)
 {
     // Steps
     $this->integrationIndexPage->open();
     $this->integrationIndexPage->getGridPageActions()->addNew();
     $this->integrationNewPage->getIntegrationForm()->fill($integration);
     $this->integrationNewPage->getFormPageActions()->saveNew();
 }
 /**
  * Assert no alert when saving an integration.
  *
  * @param IntegrationNew $integrationNew
  * @return void
  */
 public function processAssert(IntegrationNew $integrationNew)
 {
     $isAlertPresent = $integrationNew->getFormPageActions()->isAlertPresent();
     if ($isAlertPresent) {
         $integrationNew->getFormPageActions()->acceptAlert();
     }
     \PHPUnit_Framework_Assert::assertFalse($isAlertPresent, 'Saving an integration should not cause alert.');
 }
 /**
  * Create Integration Entity with existing name test.
  *
  * @param Integration $integration
  * @return array
  */
 public function test(Integration $integration)
 {
     // Precondition
     $integration->persist();
     // Steps
     $this->integrationIndexPage->open();
     $this->integrationIndexPage->getGridPageActions()->addNew();
     $this->integrationNewPage->getIntegrationForm()->fill($integration);
     $this->integrationNewPage->getFormPageActions()->saveNew();
     return ['integration' => $integration];
 }
 /**
  * Update Integration Entity test.
  *
  * @param Integration $initialIntegration
  * @param Integration $integration
  * @return void
  */
 public function test(Integration $initialIntegration, Integration $integration)
 {
     // Precondition
     $initialIntegration->persist();
     // Steps
     $filter = ['name' => $initialIntegration->getName()];
     $this->integrationIndexPage->open();
     $this->integrationIndexPage->getIntegrationGrid()->searchAndOpen($filter);
     $this->integrationNewPage->getIntegrationForm()->fill($integration);
     $this->integrationNewPage->getFormPageActions()->save();
 }
 /**
  * Run Lock user when creating new integration test.
  *
  * @param Integration $integration
  * @param int $attempts
  * @param User $customAdmin
  * @param string $configData
  * @return void
  */
 public function test(Integration $integration, $attempts, User $customAdmin, $configData = null)
 {
     $this->configData = $configData;
     // Preconditions
     $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
     $customAdmin->persist();
     $this->adminAuthLogin->open();
     $this->adminAuthLogin->getLoginBlock()->fill($customAdmin);
     $this->adminAuthLogin->getLoginBlock()->submit();
     // Steps
     $this->integrationIndexPage->open();
     $this->integrationIndexPage->getGridPageActions()->addNew();
     for ($i = 0; $i < $attempts; $i++) {
         $this->integrationNewPage->getIntegrationForm()->fill($integration);
         $this->integrationNewPage->getFormPageActions()->saveNew();
     }
     // Reload page
     $this->adminAuthLogin->open();
     $this->adminAuthLogin->getLoginBlock()->fill($customAdmin);
     $this->adminAuthLogin->getLoginBlock()->submit();
 }