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 - Selenium Tutorial
From the course: Learning Selenium
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…
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.