Replace "named" Mink selectors with "named_exact" Mink selectors
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>
This commit is contained in:
parent
762a8e0b76
commit
1381f6c131
|
@ -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));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue