From the course: Learning Selenium

Unlock the full course today

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

Add structure to tests

Add structure to tests - Selenium Tutorial

From the course: Learning Selenium

Start my 1-month free trial

Add structure to tests

- [Instructor] To confirm that the user is signed up, we'll want to add a final step in our test verifying this. When I sign up manually, I see that after submitting the form, a banner shows up on the home page to notify me that I have signed up successfully. I'm going to use that banner in an assertion to confirm that it appears after sign-up. In order to write assertions, we need the help of another Ruby library, since this is not something that is provided either natively in Ruby, or by Selenium WebDriver. There are multiple libraries that exist to help us write assertions. The one I will use is called RSpec. RSpec is a behavior driven framework for Ruby, and offers multiple libraries that can be used to work either together or independently. We're going to use two different libraries to add structure to our test, starting with RSpec Expectations. This library provides an API to express expected outcomes. There are multiple ways to express outcomes, by equivalence, by identity, by…

Contents