In this exercise, we want to test the user login authentication that we created in the previous chapter, Chapter 12, Creating User Logins and API Authentication, against the Chrome browser. We want to make sure the user can log in with their credentials and obtain their user data as expected. We will write the tests in the /frontend/ directory where we kept the Nuxt app, so we will need to modify the package.json file accordingly and write the tests in the following steps:
- Install ChromeDriver via npm and save it to the devDependencies option in the package.json file:
$ npm install chromedriver --save-dev
- Change the launch URL to localhost:3000 and other settings as shown in the following code block in the nightwatch.json file for testing against Chrome in the Nightwatch configuration file:
// nightwatch.json
{
"src_folders" : ["tests"],
"webdriver" : {
"start_process": true,
"server_path...