From the course: Advanced Selenium: Automation Frameworks

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

Introducing Mocha and Chai

Introducing Mocha and Chai - Selenium Tutorial

From the course: Advanced Selenium: Automation Frameworks

Start my 1-month free trial

Introducing Mocha and Chai

- [Instructor] Mocha is an easy and flexible test framework for JavaScript and Chai provides a language of expectations for Mocha. Let's go ahead and install Chai first. Open up your terminal and in the directory you set up the project in go ahead and install Chai with an NPM command. When you install the package with the Save option, it tells NPM that you want to keep that package as a dependency for your project. When you install it with the Save Dev option, it tells NPM that you want to save the package as a development only dependency. The Selenium framework we'll be using, webdriver.io, has a special Mocha plugin, so instead of installing Mocha the same way as Chai, we'll be installing webdriver.io's Mocha plugin.

Contents