Skip to main content
This test clicks Sign In on an empty login form and asserts that a “fields required” error appears.

Watch it run

The test

click-button.test.mjs

How it works

  • The find() description gives the button’s label, look, and position (“black button below the password field”).
  • click() clicks the returned element. It throws if find() didn’t locate it.
  • assert() describes the error in plain language, so the test doesn’t depend on exact wording or markup.

Run it

The test is in the TestDriver SDK repository. Clone it, install dependencies, and run the file:
The test reads your API key from TD_API_KEY. Create a key at console.testdriver.ai/team/api-keys. Then set it in your environment or a .env file.