Testing the Login Flow

Learn how to test the login behavior.

Testing the login workflow

Previously, we tested the sign-up workflow. Now let's test the login workflow by creating a new test. Once we sign up for a new account, we can use the login form shown below on the home page to log in to the application:

Execute the application below to start the application:

const randUserName = () => {
  const chars = 'abcdefghijklmnopqrstuvwxyz0123456789'
  let result = ''
  for (let i = 0; i < 8; i++) {
    result += chars[Math.floor(Math.random() * chars.length)]
  }
  return result
}

export default randUserName
The login application

Explanation

Let's explain the code above:

  • In lines 1–2, we import page objects for the ...