Giter Club home page Giter Club logo

watir-cuke-starter's Introduction

watir-cuke-starter

Runs tests against: http://the-internet.herokuapp.com/

To execute:

Install Ruby:

Windows:

https://github.com/nak1114/rbenv-win

Linux/Mac:

install asdf THEN
asdf list-all ruby
asdf install ruby 2.5.3
asdf global ruby 2.5.3

First, type :

  • bundle install

Then set ENV variables: SAUCE_USERNAME + SAUCE_ACCESS_KEY (either on your system or in the Rakefile directly)

Then execute:

  • bundle exec rake test_parallel

  • bundle exec rake test_inline

Notes:

Basically, Rake sets up environment variables and then runs the Cucumber execution command.

Uses newer Watir page-object lib.

Also, uses data_magic and watir_model libs ( https://leanpub.com/cucumber_and_cheese )

Test may not run unless you set system environment variables for SAUCE_USERNAME and SAUCE_ACCESS_KEY

Related Cucumber tools:

https://github.com/cucumber/cucumber/wiki/Related-tools

Another way to go with functionally oriented page objects maybe? https://github.com/automation-wizards/ferris/wiki/1-Quick-Start

I use Sublime as my IDE

Key shortcuts:

Command Palette CTRL + SHIFT + p File Switching CTRL + p Goto Symbols CTRL + r Multi Edit CTRL + click

RESEARCH AREA

This section is for TODO stuff I am still researching.

https://github.com/cheezy/page-object/wiki/Page-Sections

https://github.com/automation-wizards/ferris/wiki/4-Defining-Regions

class MyPage < Ferris::Core
  region(:faqs, MyFaqs) { browser.divs(id: 'faq') }
end

class MyFaqs < Ferris::Core
  element(:question) { root.div(id: 'q') }
  element(:answer) { root.button(id: 'a') }

  def has_a_question?
    question.present?
  end

  def has_an_answer?
    question.present?
  end

end

Usage
page = MyPage.new
page.faqs.size                            # returns number of faqs which exist in the DOM
page.faqs.each {|faq| puts faq.question } # outputs question for each faq
page.faqs.map(&:present?).all?            # returns true if all faqs are visible

Cool RSpec usage
expect(page.faqs).to all(have_a_question)
expect(page.faqs).to all(have_an_answer)
capybara == Framework & DSL
page-object == Library & DSL
watir, selenium & watir_drops == Library & API 
Framework has inversion of control, library is essentially helper/wrapper methods. DSL takes more magic actions, API is more explicit object oriented design

watir-cuke-starter's People

Contributors

austenjt avatar djangofan 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.