Giter Site home page Giter Site logo

brunomrpx / cucumber-watir-page-object-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tomafc330/cucumber-watir-page-object-example

0.0 2.0 0.0 116 KB

This is a fully functional project with Cucumber, Watir, and the page-object gem. Uses YAML to load in files for configuration

Ruby 87.51% Gherkin 9.68% Shell 2.81%

cucumber-watir-page-object-example's Introduction

Intro

This project is a working Cucumber + Watir-WebDriver framework using the page-object gem.

This is similar to the page from Alister Scott's WatirMelonCucumber, but it uses the page-object gem.

Features

It uses Watir-webdriver for driving the browser tests, and uses Cucumber for specs...not too interesting. However, I've also added the use of the page-object gem

Install

Run bundle install to get the appropriate gems

Things to note

I'm using a few gems to help me out:

page-object - adds the page abstraction layer so we can decouple any changes to the page with our steps definitions. page-object/page-factory - gives us the ability to call method on different pages. data_magic - gives the ability to load a YAML file and populate the page object's fields. rspec-expectation - adds some syntactic sugar on objects so they can be validated against using a human readable DSL.

Note the @current tag in the feature...this helps in development mode when you are working on 1 test at a time. Just run 'cucumber --tags @current' to run that 'current' test.

Also note that in hooks.rb, there is an After blocks that will take a screenshot of the current page if the scenario has failed.

We also have a Common.rb that serves as a module which will read in values from a YAML file (happens to be the same YAML file as the one used for the test data, but doesn't necessarily have to be that way).

Caveats

In the current version of the page-object gem, there is a big nasty message that gets spit out if you use the watir Element methods (such as element_wait_until_present). I believe this is a bug and has been submitted on the creator's Github issue site. In my opinion it's perfectly find to delegate to Watir's method if it doesn't happen to have it on the Element.

cucumber-watir-page-object-example's People

Contributors

tomafc330 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.