Registration & Login
Register an account, then log in with it. Password rules, confirm-password, terms checkbox and wrong-credential handling – all in the browser, nothing is stored on a server.
Register
Password strength: -
Account created. You can log in now.
Login
Invalid username or password
Password rules: at least 8 characters, one uppercase letter, one digit and one special character. There is also a ready account – qa.tester / Passw0rd!
Practice tasks
- Register with a weak password and assert the rules error appears.
- Register with mismatching passwords and assert the confirm-password error.
- Register without ticking the terms and assert it is blocked.
- Register successfully, then log in with the same credentials and assert the welcome text shows the username.
- Log in with a wrong password and assert the error message is displayed.
- Log out and assert the login form is shown again.
Sample automation code
driver.findElement(By.id("reg-username")).sendKeys("new.tester");
driver.findElement(By.id("reg-email")).sendKeys("new.tester@example.com");
driver.findElement(By.id("reg-password")).sendKeys("Passw0rd!");
driver.findElement(By.id("reg-confirm")).sendKeys("Passw0rd!");
driver.findElement(By.id("reg-terms")).click();
driver.findElement(By.id("reg-submit")).click();
Assert.assertTrue(driver.findElement(By.id("reg-success")).isDisplayed());
driver.findElement(By.id("login-username")).sendKeys("new.tester");
driver.findElement(By.id("login-password")).sendKeys("Passw0rd!");
driver.findElement(By.id("login-submit")).click();
Assert.assertTrue(driver.findElement(By.id("logged-in-user")).getText().contains("new.tester"));
await page.getByTestId('reg-username').fill('new.tester');
await page.getByTestId('reg-email').fill('new.tester@example.com');
await page.getByTestId('reg-password').fill('Passw0rd!');
await page.getByTestId('reg-confirm').fill('Passw0rd!');
await page.getByTestId('reg-terms').check();
await page.getByTestId('reg-submit').click();
await expect(page.getByTestId('reg-success')).toBeVisible();
await page.getByTestId('login-username').fill('new.tester');
await page.getByTestId('login-password').fill('Passw0rd!');
await page.getByTestId('login-submit').click();
await expect(page.locator('#logged-in-user')).toContainText('new.tester');