Reputation: 492
So I have written an Angular app and I want to implement end-to-end testing, so I searched the internet for a tool. I found out that Protractor and Cucumber are two popular tools that do that, but I am confused as to what is the difference between them.
Upvotes: 7
Views: 8712
Reputation: 75
Use cucumber. Way better to separate test description and implementation!
Upvotes: 0
Reputation: 99
Yes, There is a huge difference between 'Protractor' and 'Cucumber'. Protractor is a tool and Cucumber is just a framework( to be more precise-its a BDD(behaviour -driven-framework)). So first i'll describe Cucumber based on my experience:- Its very easy to use, we just need to install cucumber by just running a single command, then you are ready to use it. It uses GHERKIN language which is a basic english language. So we write acceptance tests using Gherkin we used to call it a feature file and saved it as ".feature" ex-:
Feature: Check validation of Google search button
Scenario: Finding results on the basis of search
Given I am on google home Page
When I type Europe in search field
And I click on search button
Then i should see some search result
So this is how feature files look written in Gherkin language. And this file is for non-technical persons like for BA's, Managers who just want to know what all things should be covered in one scenario. Now, what is protractor: - Its a tool build on 'Webdriver'. If you have ever worked on Selenium before than you must be knowing this term. So Basically we deal with the page locators using this tool. and for this we have multiple Element finders ex- CSS ,xpath etc. So inshort, We communicate with our application through Protractor and just giving a layer of abstraction through Cucumber so that non-techncal people can understand it, Cucumber adds more clarity and readability to our automated test scripts . After reading all this you must have to visit these two links : https://docs.cucumber.io/ https://www.protractortest.org/#/
Upvotes: 3
Reputation: 3645
Cucumber and Protractor dont do the same job to compare
Cucumber enables us to write automated tests in a behavior-driven development (BDD) style. Its available vis-a-vis with Jasmine or Mocha as a test framework over Protractor API
Protractor is a wrapper over WebDriver Js to write e2e tests to interact with browser. You can write Protractor tests using any of the below Frameworks
You will cucumber as a custom framework in Protractor config when you need to write your tests in a BDD style - acceptance tests
I guess this is enough to get you started and you can read more about Protractor with Cucumber here. there are npm packages - cucumber & protractor-cucumber-framework which will enable this integration
Upvotes: 7