Pass if the page HTML title is the given string.
string $expected_title: The string the page title should be.
\Behat\Mink\Exception\ExpectationException Thrown when element doesn't exist, or the title is a different one.
protected function assertPageTitle($expected_title) {
$page_title_element = $this
->getSession()
->getPage()
->find('css', 'h1.page-title');
if (!$page_title_element) {
throw new ExpectationException('No page title element found on the page', $this
->getSession()
->getDriver());
}
$actual_title = $page_title_element
->getText();
$this
->assertSame($expected_title, $actual_title, 'The page title is not the same as expected.');
}