diff --git a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php index 02085b9..b31ce8b 100644 --- a/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php +++ b/core/tests/Drupal/FunctionalTests/BrowserTestBaseTest.php @@ -142,15 +142,17 @@ public function testLegacyXPathAsserts() { $this->drupalLogin($account); $this->drupalGet('admin/people'); - $this->assertFieldsByValue($this->xpath("//h1[@class = 'page-title']")); - $this->assertFieldsByValue($this->xpath('//table/tbody/tr[2]/td[1]/span'), $account->getAccountName()); - $this->assertFieldByXPath('//table/tbody/tr[2]/td[1]/span', $account->getAccountName()); + $body = Html::escape($this->xpath('//body')[0]->getHtml()); + $this->assertFieldsByValue($this->xpath("//h1[@class = 'page-title']"), NULL, $body); + $this->assertFieldsByValue($this->xpath('//table/tbody/tr[2]/td[1]/span'), $account->getAccountName(), $body); + $this->assertFieldByXPath('//table/tbody/tr[2]/td[1]/span', $account->getAccountName(), $body); $this->drupalGet('user/' . $account->id() . '/edit'); - $this->assertFieldsByValue($this->xpath("//input[@id = 'edit-name']"), $account->getAccountName()); - $this->assertFieldByXPath("//input[@id = 'edit-name']", $account->getAccountName()); - $this->assertFieldsByValue($this->xpath("//select[@id = 'edit-timezone--2']"), 'Australia/Sydney'); - $this->assertFieldByXPath("//select[@id = 'edit-timezone--2']", 'Australia/Sydney'); + $body = Html::escape($this->xpath('//body')[0]->getHtml()); + $this->assertFieldsByValue($this->xpath("//input[@id = 'edit-name']"), $account->getAccountName(), $body); + $this->assertFieldByXPath("//input[@id = 'edit-name']", $account->getAccountName(), $body); + $this->assertFieldsByValue($this->xpath("//select[@id = 'edit-timezone--2']"), 'Australia/Sydney', $body); + $this->assertFieldByXPath("//select[@id = 'edit-timezone--2']", 'Australia/Sydney', $body); $this->assertNoFieldByXPath('//notexisting'); $this->assertNoFieldByXPath("//input[@id = 'edit-name']", 'wrong value');