marvin-js

Just another web testing framework

by

In the beginning the universe was created.

This has made a lot of people very angry, and
been widely regarded as a bad move.

It's 2000 A.D.

We survived the millenium bug, and F. Marchetti created YOOX

With many stores
comes great "opportunities"

One of the most recent opportunities was
improve our quality assurance process

Time consuming Repetitive work Regressions Docs Legacy Browsers Internet Explorer Bug Triage Bottleneck Late discovery

An increasing HUGE number of online stores,
A lot of localizations, and sometime even exceptions.

Quality assurance is not a game for the weak of heart.

Hire much more QAs

Automation

[aw-tuh-mey-shuh n]

The technique, method, or system of operating or controlling a process by highly automatic means, as by electronic devices, reducing human intervention to a minimum.

marvin-js

A node web testing framework
built on top of the standards

marvin-js

Hello World

"Hello World" with Marvin: Gherkin

    
      @cart
      Feature: Add to shopping bag
        Scenario: User search an item, and then add it to his shopping bag
          Given I visit the store’s homepage in [countrycode]
          And I search for [query]
          And I click on the first result product
          And I click the Add to Shopping Bag button
          Then In the shopping bag there is one item

        Where:
        countrycode     | query
            it          | pantaloni con pois rossi
            us          | jacket
    
  

"Hello World" with Marvin: Gherkin

    
      @cart
      Feature: Add to shopping bag
        Scenario: User search an item, and then add it to his shopping bag
          Given I visit the store’s homepage in [countrycode]
          And I search for [query]
          And I click on the first result product
          And I click the Add to Shopping Bag button
          Then In the shopping bag there is one item

        Where:
        countrycode     | query
            it          | pantaloni con pois rossi
            us          | jacket
    
  

"Hello World" with Marvin: Gherkin

    
      @cart
      Feature: Add to shopping bag
        Scenario: User search an item, and then add it to his shopping bag
          Given I visit the store’s homepage in [countrycode]
          And I search for [query]
          And I click on the first result product
          And I click the Add to Shopping Bag button
          Then In the shopping bag there is one item

        Where:
        countrycode     | query
            it          | pantaloni con pois rossi
            us          | jacket
    
  

"Hello World" with Marvin: Gherkin

    
      @cart
      Feature: Add to shopping bag
        Scenario: User search an item, and then add it to his shopping bag
          Given I visit the store’s homepage in [countrycode]
          And I search for [query]
          And I click on the first result product
          And I click the Add to Shopping Bag button
          Then In the shopping bag there is one item

        Where:
        countrycode     | query
            it          | pantaloni con pois rossi
            us          | jacket
    
  

Page Object
Pattern

Reference:
http://martinfowler.com/bliki/PageObject.html

"Hello World" with Marvin: Page Model

    
      const Page = require(‘marvin-js’).Page

      module.exports = new Page({
        addToShoppingBagButton: {
          get: function () { return this.element(‘button#addItem’) }
        }
      })
    
  

"Hello World" with Marvin: Page Model

    
      const Page = require(‘marvin-js’).Page

      module.exports = new Page({
        addToShoppingBagButton: {
          get: function () { return this.element(‘button#addItem’) }
        }
      })
    
  

"Hello World" with Marvin: Page Model

    
      const Page = require(‘marvin-js’).Page

      module.exports = new Page({
        addToShoppingBagButton: {
          get: function () { return this.element(‘button#addItem’) }
        }
      })
    
  

"Hello World" with Marvin: Test's Steps

    
      const item = require(‘pages/item’)

      exports.define = function (steps) {

        steps.when(/And I click the Add to Shopping Bag button/, () => {
          item.addToShoppingBagButton.click()
        })

      }
    
  

"Hello World" with Marvin: Test's Steps

    
      const item = require(‘pages/item’)

      exports.define = function (steps) {

        steps.when(/And I click the Add to Shopping Bag button/, () => {
          item.addToShoppingBagButton.click()
        })

      }
    
  

"Hello World" with Marvin: Test's Steps

    
      const item = require(‘pages/item’)

      exports.define = function (steps) {

        steps.when(/And I click the Add to Shopping Bag button/, () => {
          item.addToShoppingBagButton.click()
        })

      }
    
  

"Hello World" with Marvin: Test's Steps

    
      const item = require(‘pages/item’)

      exports.define = function (steps) {

        steps.when(/And I click the Add to Shopping Bag button/, () => {
          item.addToShoppingBagButton.click()
        })

      }
    
  

"Hello World" with Marvin: Test's Assertions

    
      const session = require(‘marvin-js’).session
      const checkout = require(‘pages/checkout’)

      steps.then(/In the shopping bag there is one item/, () => {
        checkout.shoppingBag.products.then(products => {
          expect(products).to.equal(1)
          session.saveScreenshot(‘shopping-bag’)
        })
      })
    
  

"Hello World" with Marvin: Test's Assertions

    
      const session = require(‘marvin-js’).session
      const checkout = require(‘pages/checkout’)

      steps.then(/In the shopping bag there is one item/, () => {
        checkout.shoppingBag.products.then(products => {
          expect(products).to.equal(1)
          session.saveScreenshot(‘shopping-bag’)
        })
      })
    
  

"Hello World" with Marvin: Test's Assertions

    
      const session = require(‘marvin-js’).session
      const checkout = require(‘pages/checkout’)

      steps.then(/In the shopping bag there is one item/, () => {
        checkout.shoppingBag.products.then(products => {
          expect(products).to.equal(1)
          session.saveScreenshot(‘shopping-bag’)
        })
      })
    
  

"Hello World" with Marvin: Test's Assertions

    
      const session = require(‘marvin-js’).session
      const checkout = require(‘pages/checkout’)

      steps.then(/In the shopping bag there is one item/, () => {
        checkout.shoppingBag.products.then(products => {
          expect(products).to.equal(1)
          session.saveScreenshot(‘shopping-bag’)
        })
      })
    
  

More About Marvin

What we achieved

Give credits, when credit is due...

Moonraker,
Selenium Web Driver, Mocha, Yadda, Chai, ...

If you copy from one is plagiarism, if you take from many ...
IT'S ART

Demo Time

NO!

YTECH/MARVIN

Thank you!