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 - Selenium Tutorial
From the course: Advanced Selenium: Automation Frameworks
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.
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.