Skip to content
Prev Previous commit
Next Next commit
Assert also element visibility instead of just finding it
Although if the element could not be found an exception would be thrown
and the test aborted if an element is in the DOM but hidden it would be
found and the test would pass.

Signed-off-by: Daniel Calviño Sánchez <[email protected]>
  • Loading branch information
danxuliu authored and backportbot[bot] committed Mar 8, 2021
commit f92a216dcf80a2e5cfbe2a956dfbc1abd0a1add6
16 changes: 12 additions & 4 deletions tests/acceptance/features/bootstrap/AppsManagementContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,15 +170,19 @@ public function iDisableTheApp($app) {
*/
public function iSeeThatTheAppHasBeenEnabled($app) {
// TODO: Find a way to check if the enable button is removed
$this->actor->find(self::disableButtonForApp($app), 10);
PHPUnit_Framework_Assert::assertTrue(
$this->actor->find(self::disableButtonForApp($app), 10)->isVisible()
);
}

/**
* @Then I see that the :app app has been disabled
*/
public function iSeeThatTheAppHasBeenDisabled($app) {
// TODO: Find a way to check if the disable button is removed
$this->actor->find(self::enableButtonForApp($app), 10);
PHPUnit_Framework_Assert::assertTrue(
$this->actor->find(self::enableButtonForApp($app), 10)->isVisible()
);
}

/**
Expand Down Expand Up @@ -237,8 +241,12 @@ public function iSeeThatThereAreOnlyEnabledApps() {
* @Given /^I see the app bundles$/
*/
public function iSeeTheAppBundles() {
$this->actor->find(self::rowForApp('Auditing / Logging'), 2);
$this->actor->find(self::rowForApp('LDAP user and group backend'), 2);
PHPUnit_Framework_Assert::assertTrue(
$this->actor->find(self::rowForApp('Auditing / Logging'), 2)->isVisible()
);
PHPUnit_Framework_Assert::assertTrue(
$this->actor->find(self::rowForApp('LDAP user and group backend'), 2)->isVisible()
);
}

/**
Expand Down