uLucasFraga / capybara_for_studies

Repository with automated test for UI (web) using the frameworks: capybara and cucumber

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CAPYBARA-RUBY-FOR-STUDIES

SUMMARY

Repository with examples of automation using capybara + cucumber + siteprims + rspec

Capybara: Helps you test web applications by simulating how a real user would interact with your app. It is agnostic about the driver running your tests and comes with Rack::Test and Selenium support built in. WebKit is supported through an external gem.

Cucumber: Is a tool that supports Behaviour-Driven Development (BDD) - a software development process that aims to enhance software quality and reduce maintenance costs.

RSpec: Tests are not just scripts that verify your application code. They’re also specifications (or specs, for short): detailed explanations of how the application is supposed to behave, expressed in plain English.

SitePrism: Gives you a simple, clean and semantic DSL for describing your site using the Page Object Model pattern, for use with Capybara in automated acceptance testing.


Table of Contents

Índice README.


Prerequisites

Configuration

Mac:

Update ruby version and install (if required)

Windows:

Install (if required)

Ubuntu:

Install (if required)

Installation

Clone

  • Clone this repo to your local machine using https://github.com/uLucasFraga/capybara_for_studies.git

  • Install all dependencies (Gemfile) bundle install

Bundle install example

Tips

  • Use Gemfile to install the project dependencies

Features

  • file example .feature
# language: en
# encode: UTF-8

Feature: Add or remove a new product to cart
    - Add a new product to cart
    - Remove a product from the cart

    Background: Standard user login
        Given the standard user is logged

    Scenario: Add a new product for your cart
        When he adds a new product to the cart
        Then he can see the new product in the list

How to run tests

create and configure file .env

  • Create file .evn in /capybara_ruby_for_studies
  • Configure file .env with:

example:

SAUCEDEMO=https://www.saucedemo.com
STANDARD=standard_user
LOCKED_OUT=locked_out_user
PROBLEM=problem_user
PERFORMANCE_GLITCH=performance_glitch_user
USER_ERROR=error_login_user
PASSWORD=secret_sauce
ERROR_PASSWORD=sauce_secret

Run tests

run all tests with the bundle

$ bundle exec cucumber

run tests with chrome, firefox or chrome_headless

$ bundle exec cucumber -p chrome
$ bundle exec cucumber -p firefox
$ bundle exec cucumber -p chrome_headless

run tests with chrome, firefox or chrome_headless + tag

$ bundle exec cucumber -p chrome -t @regression
$ bundle exec cucumber -p firefox -t @regression
$ bundle exec cucumber -p chrome_headless -t @regression

run tests with the cucumber

$ cucumber

Support


License

License

About

Repository with automated test for UI (web) using the frameworks: capybara and cucumber


Languages

Language:Ruby 76.5%Language:Gherkin 23.5%