Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
What's the difference between RSpec and Cucumber in Selenium?
The differences between RSpec and Cucumber are listed below −
| Sr. No. | RSpec | Cucumber |
|---|---|---|
| 1 | A testing framework which gives the option to build and execute tests. | A tool which is used to create test cases in plain English text. |
| 2 | Mainly used for integration and unit testing. | Mainly used for user acceptance testing. |
| 3 | Utilized for Test Driven Development by developers and for Behavior Driven Development by testers. | Utilized for Behavior Driven Development. |
| 4 | Narrates step from a business specification using the Describe, Context and It blocks. | Narrates step from a business specification with the Given, When, Then, And, But, and so on keywords. |
| 5 | Code for implementation of a step is available within the Describe, Context and It blocks. | Code for implementation of a step is available in a separate file called the step definition. |
| 6 | Team members having only technical knowledge (developers) can contribute. | All the project stakeholders (developers, testers, product owners, business analysts, clients and so on) can contribute. |
Example of Cucumber
Feature File
Feature: Login Module Scenario: User login Given: Visit URL "https://tutorialspoint.com"
The corresponding Step Definition File
@Given ("^Visit URL \"([^\"]*)\"$")
public void visit_url(String u){
System.out.println("URL is : " + u);
}
Example of RSpec
describe Login Module context "User Login" do it "Visit URL 'https://tutorialspoint.com'" do message = successfully logged in end end end
Advertisements
