testingautomated-testscodeceptionweb-testingwebtest

How to test with Codeception if the page has meta-tag?


e.g. to ensure that

<meta name="robots" content="noindex" />

does not exists on the page.

$I->wantTo('Check that page can be indexed');
$I->amOnPage('/');
$I->dontSeeInPageSource('<meta name="robots" content="noindex" />');

but it returns the error

Call to undefined method WebGuy::dontSeeInPageSource


Solution

  • $I->dontSeeElement('meta[name=robots]');