]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add explicit locator for "Enable all" bundle button
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Fri, 5 Mar 2021 20:57:47 +0000 (21:57 +0100)
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>
Mon, 8 Mar 2021 07:59:36 +0000 (07:59 +0000)
Instead of looking for the bundle button and then checking its value now
the expected value is included in the locator and the button is checked
similarly to other elements.

No "Disable all" locator was added as it was not currently needed
anywhere.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
tests/acceptance/features/bootstrap/AppsManagementContext.php

index 56ec7c6b85ff736e5b6aedc21f0c1d441ce78bc8..82d4561bd28b7a0348f08327a4f2d41328fc0955 100644 (file)
@@ -84,10 +84,10 @@ class AppsManagementContext implements Context, ActorAwareInterface {
        /**
         * @return Locator
         */
-       public static function bundleButton($bundle) {
-               return Locator::forThe()->xpath("//div[@class='apps-header']/h2[normalize-space() = '$bundle']/input")->
+       public static function enableAllBundleButton($bundle) {
+               return Locator::forThe()->xpath("//div[@class='apps-header']/h2[normalize-space() = '$bundle']/input[@value='Enable all']")->
                                descendantOf(self::appsList())->
-                               describedAs("Button to enable / disable bundles");
+                               describedAs("Button to enable bundles");
        }
 
        /**
@@ -245,14 +245,16 @@ class AppsManagementContext implements Context, ActorAwareInterface {
         * @When /^I enable all apps from the "([^"]*)"$/
         */
        public function iEnableAllAppsFromThe($bundle) {
-               $this->actor->find(self::bundleButton($bundle), 2)->click();
+               $this->actor->find(self::enableAllBundleButton($bundle), 2)->click();
        }
 
        /**
         * @Given /^I see that the "([^"]*)" is disabled$/
         */
        public function iSeeThatTheIsDisabled($bundle) {
-               PHPUnit\Framework\Assert::assertEquals('Enable all', $this->actor->find(self::bundleButton($bundle), 2)->getValue());
+               PHPUnit_Framework_Assert::assertTrue(
+                       $this->actor->find(self::enableAllBundleButton($bundle), 2)->isVisible()
+               );
        }
 
        /**