I'm trying to test that an element don't exists in a page. I know that exists the elementAttributeExists()
method that checks that an attribute exists in an element. But I can't find any method like elementAttributeNotExists()
to check that an attribute don't exists in an element.
So, with the following code I can check that the 'autocomplete' attribute is present in the #edit-pass element:
public function testLoginForm() {
// Going to the log in.
$this->drupalGet('/user/login');
// Checking that the autocomplete is not set.
$this->assertSession()->elementAttributeExists('css', '#edit-pass', 'autocomplete');
}
But how I can check that the autocomplete attribute is not present?