Giter Site home page Giter Site logo

34-protons-ruby-automation's Introduction

SitePrism-Playground

Code to demonstrate the use of SitePrism framework in organising code.

Once cloned use bundle install to install required gems and bundle exec cucumber to run feature file.

Individual scenarios have been tagged and can run selectively using bundle exec cucumber -t@tagname, @other_tagname.

SitePrism promotes the use of the Page Object Model (POM). Areas of a page with specific purpose can be grouped into classes that contains all the code that will interact with and queries the page state. In this way the code organisation maps onto the physical layout of the page.

Need to find the code that deals with a button or a field? Then identify the class that maps that the object and that is where it will live.

Each class can contain other "page objects" as class references in the methods section and sections or as references to element and elements objects.

The "page object" classes are used to compose the page or pages contained in a website or web-app. These page classes in turn can be incorporated into an object that represents the entire site or app. This single object is instantiated at runtime and becomes the access point for all calls to test code.

Individual method calls are prefixed with the "page object" name such that calls become fluent and more readable i.e.

@app_name.page_object_name.method_name(arg)

In the code within this repo the "page object" classes are contained in the file page_objects.rb.

The object representing the page is defined in the file demo_page.rb. An instance of the "page" is instaniated in the hooks.rb file which contains code that is called each time a scenario is run. In this way responsibility for creation of an instance of a page instance is handed off to the Cucumber framework.

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.