marvin-js
Just another web testing framework
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
One of the most recent opportunities was
improve our quality assurance process

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.
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

"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
-
Multi thread architecture
Run your test in parallel threads, and multiple browsers at the same time
-
Continuous integration ready
It’s incredibly easy to integrate with teamcity and other ci services
-
Cloud ready
Run tests through saucelabs, or browser stack
What we achieved
-
Test makes clear what the desidered behaviour is
Verba volant, scripta manent
-
Safer release & faster bug discovery
Increase platform stability
-
Code reuse makes us save time on the long run
Avoid repetitive works, Qa bottleneck...
-
Qa/dev cooperation
Give credits, when credit is due...
Moonraker,
Selenium Web Driver, Mocha, Yadda, Chai, ...
Demo Time
NO!
YTECH/MARVIN


Thank you!