2

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

Eugene Kaurov
  • 2,356
  • 28
  • 39

2 Answers2

1

To test it doesn't have the tag:

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

To test it does have the tag:

$I->seeElementInDOM('meta[name=robots]');
dhinchliff
  • 1,106
  • 8
  • 17
0
$I->dontSeeElement('meta[name=robots]');
Eugene Kaurov
  • 2,356
  • 28
  • 39
  • Meta elements are never visible so this assertion will pass regardless of whether the meta tag is present or not. – dhinchliff May 03 '18 at 10:31