Commit fafa49b9 authored by catch's avatar catch

Issue #2854249 by GoZ, himanshu-dixit, boaloysius, xjm: Default message for...

Issue #2854249 by GoZ, himanshu-dixit, boaloysius, xjm: Default message for linkNotExists and linkByHrefNotExists is wrong
parent e09ba74f
...@@ -247,7 +247,7 @@ public function linkExists($label, $index = 0, $message = '') { ...@@ -247,7 +247,7 @@ public function linkExists($label, $index = 0, $message = '') {
* Thrown when element doesn't exist, or the link label is a different one. * Thrown when element doesn't exist, or the link label is a different one.
*/ */
public function linkNotExists($label, $message = '') { public function linkNotExists($label, $message = '') {
$message = ($message ? $message : strtr('Link with label %label found.', ['%label' => $label])); $message = ($message ? $message : strtr('Link with label %label not found.', ['%label' => $label]));
$links = $this->session->getPage()->findAll('named', ['link', $label]); $links = $this->session->getPage()->findAll('named', ['link', $label]);
$this->assert(empty($links), $message); $this->assert(empty($links), $message);
} }
...@@ -291,7 +291,7 @@ public function linkByHrefExists($href, $index = 0, $message = '') { ...@@ -291,7 +291,7 @@ public function linkByHrefExists($href, $index = 0, $message = '') {
*/ */
public function linkByHrefNotExists($href, $message = '') { public function linkByHrefNotExists($href, $message = '') {
$xpath = $this->buildXPathQuery('//a[contains(@href, :href)]', [':href' => $href]); $xpath = $this->buildXPathQuery('//a[contains(@href, :href)]', [':href' => $href]);
$message = ($message ? $message : strtr('Link containing href %href found.', ['%href' => $href])); $message = ($message ? $message : strtr('No link containing href %href found.', ['%href' => $href]));
$links = $this->session->getPage()->findAll('xpath', $xpath); $links = $this->session->getPage()->findAll('xpath', $xpath);
$this->assert(empty($links), $message); $this->assert(empty($links), $message);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment