]> source.dussan.org Git - nextcloud-server.git/commitdiff
Assert also element visibility instead of just finding it
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 5 Mar 2021 21:00:22 +0000 (22:00 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 8 Mar 2021 07:59:37 +0000 (07:59 +0000)
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 <danxuliu@gmail.com>
tests/acceptance/features/bootstrap/AppsManagementContext.php

index 82d4561bd28b7a0348f08327a4f2d41328fc0955..332c3b020ec7f5fe9c2350af2565d8b5cf6673f9 100644 (file)
@@ -170,7 +170,9 @@ class AppsManagementContext implements Context, ActorAwareInterface {
         */
        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()
+               );
        }
 
        /**
@@ -178,7 +180,9 @@ class AppsManagementContext implements Context, ActorAwareInterface {
         */
        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()
+               );
        }
 
        /**
@@ -237,8 +241,12 @@ class AppsManagementContext implements Context, ActorAwareInterface {
         * @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()
+               );
        }
 
        /**