...
/Solution: Testing the UI Workflow with WebdriverIO
Solution: Testing the UI Workflow with WebdriverIO
Review the solution to writing a test to complete the flow from sign-up to logout.
We'll cover the following...
Challenge solution
Let's review the code for the challenge exercise:
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
Let's explain the code above:
In lines 1–4, we import the
testUserfunction to generate a unique username for our test. We also import the page objects for the login, profile, and sign-up pages. ...
Ask