0

Why am I not getting an error when I use PHPUnit + Selenium Server to log in with an email and password that doesn't exists? This is the PHPUnit script.

public function testUserNotExists() {
    $this->open('https://dev.example.com/login');
    $this->type("id=email", "1d0ntex1s7@live.com");
    $this->type("id=password", "1d0n73x1s7");
    $this->click("name=login_user");

}

When I run it, it doesn't show an error

Terminal: phpunit ExampleTest.php PHPUnit 3.6.12 by Sebastian Bergmann.

E...

Time: 29 seconds, Memory: 4.75Mb

There was 1 error:

1) ExampleTest::testTitle

Method assertTitleEquals not defined.

FAILURES! Tests: 4, Assertions: 1, Errors: 1.

yan
  • 480
  • 1
  • 11
  • 21

1 Answers1

1

You have to write assertions to get some failure. Selenium doesn't know what should (or shouldn't) happen after sending some form.

Josef Cech
  • 2,115
  • 16
  • 17