]> source.dussan.org Git - nextcloud-server.git/commitdiff
Replace "named" Mink selectors with "named_exact" Mink selectors 4662/head
authorDaniel Calviño Sánchez <danxuliu@gmail.com>
Tue, 2 May 2017 12:33:34 +0000 (14:33 +0200)
committerDaniel Calviño Sánchez <danxuliu@gmail.com>
Tue, 2 May 2017 13:09:38 +0000 (15:09 +0200)
The "named" Mink selector first tries to find an exact match for its
locator and then, if not found, tries to find a partial match. Besides
other harder to track problems (see comment in the commit in which the
"content" locator was removed), this could cause, for example, finding
an action link titled "Favorited" when looking for the action link
titled "Favorite" (that is, one that conveys the opposite state to the
one found).

Although currently all the acceptance tests are compatible with both the
"named" and the "named_exact" Mink selectors the predefined locators are
modified to use the "named_exact" Mink selector to make them more
future-proof; the "named" Mink selector can still be used if needed
through the "customSelector" method in the builder object.

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

index 64b2aa00cd9da5c0b0a96c30f708d7004367803b..e670a5b8065a54bbd9f4c3a6f32b675f3239a89d 100644 (file)
@@ -134,7 +134,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function id($value) {
-               return $this->customSelector("named", array("id", $value));
+               return $this->customSelector("named_exact", array("id", $value));
        }
 
        /**
@@ -142,7 +142,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function idOrName($value) {
-               return $this->customSelector("named", array("id_or_name", $value));
+               return $this->customSelector("named_exact", array("id_or_name", $value));
        }
 
        /**
@@ -150,7 +150,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function link($value) {
-               return $this->customSelector("named", array("link", $value));
+               return $this->customSelector("named_exact", array("link", $value));
        }
 
        /**
@@ -158,7 +158,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function button($value) {
-               return $this->customSelector("named", array("button", $value));
+               return $this->customSelector("named_exact", array("button", $value));
        }
 
        /**
@@ -166,7 +166,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function linkOrButton($value) {
-               return $this->customSelector("named", array("link_or_button", $value));
+               return $this->customSelector("named_exact", array("link_or_button", $value));
        }
 
        /**
@@ -174,7 +174,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function field($value) {
-               return $this->customSelector("named", array("field", $value));
+               return $this->customSelector("named_exact", array("field", $value));
        }
 
        /**
@@ -182,7 +182,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function selectField($value) {
-               return $this->customSelector("named", array("select", $value));
+               return $this->customSelector("named_exact", array("select", $value));
        }
 
        /**
@@ -190,7 +190,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function checkbox($value) {
-               return $this->customSelector("named", array("checkbox", $value));
+               return $this->customSelector("named_exact", array("checkbox", $value));
        }
 
        /**
@@ -198,7 +198,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function radioButton($value) {
-               return $this->customSelector("named", array("radio", $value));
+               return $this->customSelector("named_exact", array("radio", $value));
        }
 
        /**
@@ -206,7 +206,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function fileInput($value) {
-               return $this->customSelector("named", array("file", $value));
+               return $this->customSelector("named_exact", array("file", $value));
        }
 
        /**
@@ -214,7 +214,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function optionGroup($value) {
-               return $this->customSelector("named", array("optgroup", $value));
+               return $this->customSelector("named_exact", array("optgroup", $value));
        }
 
        /**
@@ -222,7 +222,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function option($value) {
-               return $this->customSelector("named", array("option", $value));
+               return $this->customSelector("named_exact", array("option", $value));
        }
 
        /**
@@ -230,7 +230,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function fieldSet($value) {
-               return $this->customSelector("named", array("fieldset", $value));
+               return $this->customSelector("named_exact", array("fieldset", $value));
        }
 
        /**
@@ -238,7 +238,7 @@ class LocatorBuilder {
         * @return LocatorBuilderSecondStep
         */
        public function table($value) {
-               return $this->customSelector("named", array("table", $value));
+               return $this->customSelector("named_exact", array("table", $value));
        }
 
 }