SlideShare a Scribd company logo
NemoJS'and'Applitools'Eyes
Visual'Tes*ng'with'node.js
Where%does%Nemo%
fit?
PayPal's NemoJS and Applitools Eyes - Visual Testing with Node.js
PayPal's NemoJS and Applitools Eyes - Visual Testing with Node.js
A"basic"JavaScript"selenium3webdriver"script:
var webdriver = require('selenium-webdriver'),
SeleniumServer = require('selenium-webdriver/remote').SeleniumServer;
var server = new SeleniumServer(pathToSeleniumJar, {
port: 4444
});
server.start();
var driver = new webdriver.Builder().
usingServer(server.address()).
withCapabilities(webdriver.Capabilities.firefox()).
build();
driver.get('https://www.paypal.com');
The$same$script$using$Nemo
var Nemo = require('nemo');
var nemo = Nemo(function () {
nemo.driver.get('https://www.paypal.com');
});
What%does%Nemo%do?
• provides*environment.aware*JSON*configura9on
• provides*plugin'API
• provides*access*to*the*webdriver*API
The$webdriver$API
exposed'as'nemo.driver'and'nemo.wd
Environment*aware*configura1on
• config.json"is"the"defaults"file
• add"overrides"based"on"NODE_ENV
• e.g."NODE_ENV=local"looks"for"local.json
Configura)on*protocols
• shortstop(handlers
• env:foo
• path:foo
• argv:foo
• config:foo.bar
config.json
{
"plugins": {
"view": {
"module": "nemo-view"
},
"util": {
"module": "path:plugin/util"
}
},
"driver": {
"browser": "chrome"
}
}
Nemo%code%pa*erns
Using&nemo*view
it('should execute high level functionality using flow modules', function (done) {
//login
nemo.driver.get(nemo.data.baseUrl);
util.waitForJSReady(nemo);
nemo.view.login.emailWaitVisible().sendKeys('me@mine.com');
nemo.view.login.password().sendKeys('11111111');
nemo.view.login.button().click();
//add card success
nemo.view.card.numberWaitVisible().sendKeys('123456789012');
nemo.view.card.typeOptionText('Misa');
nemo.view.card.button().click();
nemo.view.card.successWait();
//add card fail
nemo.view.card.number().clear();
nemo.view.card.number().sendKeys('1001001');
nemo.view.card.typeOptionText('Misa');
nemo.view.card.button().click();
nemo.view.card.failureWait();
...
DRY$pa'ern$(card$module)
var Card = function (nemo) {
this.nemo = nemo;
};
var _enterForm = function (nemo, number, type) {
nemo.view.card.numberWaitVisible().clear();
nemo.view.card.number().sendKeys(number);
nemo.view.card.typeOptionText(type);
return nemo.view.card.button().click();
}
Card.prototype.addSuccess = function(number, type) {
_enterForm(this.nemo, number, type);
return this.nemo.view.card.successWait();
};
Card.prototype.addFailure = function(number, type) {
_enterForm(this.nemo, number, type);
return this.nemo.view.card.failureWait();
};
module.exports = Card;
DRY$pa'ern$(navigate$module)
var util = require('../util');
var Navigate = function (nemo) {
this.nemo = nemo;
};
...
Navigate.prototype.logout = function() {
this.nemo.view.nav.logoutLink().click();
return this.nemo.view.login.emailWaitVisible();
};
Navigate.prototype.bank = function() {
this.nemo.view.nav.bankLink().click();
return this.nemo.view.bank.numberWaitVisible();
};
Navigate.prototype.card = function() {
this.nemo.view.nav.cardLink().click();
return nemo.view.card.numberWaitVisible();
};
module.exports = Navigate;
DRY$pa'ern$(spec$usage)
it('should execute high level functionality using flow modules', function (done) {
navigate.loginFailure('fail@fail.com', '11111111');
navigate.loginSuccess('me@mine.com', '11111111');
card.addSuccess('0123456789012345', 'Misa');
card.addFailure('1001001', 'Misa');
bank.addSuccess('0432787332', '92929');
bank.addFailure('1001001', '92929');
navigate.logout().then(util.doneSuccess(done), util.doneError(done));
});
countries.js,(dynamic,data)
module.exports = [
{
"locality": "en-US",
"url": "http://localhost:8000/responsive/us"
},
{
"locality": "de-DE",
"url": "http://localhost:8000/responsive/de"
}
];
eyes$spec.js
dd(countries, function () {
it('should let me reply to an email for locale {locality}', function (country, done) {
//login
nemo.driver.get(country.url);
nemo.waitForDom();
nemo.view._find('#reply').click();
nemo.view._find('#forward').click();
nemo.view._find('#moveto').click();
nemo.driver.sleep(2000);
nemo.view._find('#verify').getText().
then(function (verifyText) {
nemo.assert.equal(verifyText, 'replyforwardmoveto');
}).
then(function () {
done();
}).thenCatch(function (err) {
done(err);
});
});
});
Demo:&Running&our&localized&test
Visual'bug'introduced'DE'transla3on
PayPal's NemoJS and Applitools Eyes - Visual Testing with Node.js
Incorporate*Applitools
Catch&the&visual&bug&in&the&future
Basic&configura-on
"eyes": {
"module": "path:plugin/eyes",
"arguments": [
{
"sdk": {
"setApiKey": "env:applitools_api_key",
"setMatchLevel": "Layout"
},
"viewport": {
"width": 1200,
"height": 600
},
"mock": "env:applitools_mock"
}
]
}
Demo:&Run&one&test&to&applitools
PayPal's NemoJS and Applitools Eyes - Visual Testing with Node.js
Add#responsive#tes-ng
new$config$for$each$form$factor
phone.json
{
"plugins": {
"eyes": {
"module": "path:plugin/eyes",
"arguments": [{
"sdk": {
"setBatch": "PHONE",
"setMatchLevel": "Layout"
},
"viewport": {
"width": 620,
"height": 400
}
}]
}
}
}
tablet.json
{
"plugins": {
"eyes": {
"module": "path:plugin/eyes",
"arguments": [{
"sdk": {
"setBatch": "PHONE",
"setMatchLevel": "Layout"
},
"viewport": {
"width": 950,
"height": 600
}
}]
}
}
}
Demo:&Visual&tes.ng&along&two&
dimensions
Per$country,$per$form$factor
PayPal's NemoJS and Applitools Eyes - Visual Testing with Node.js
THANK&YOU
• h#ps://applitools.com/
• h#p://nemo.js.org
• @nemojs_news
• h#ps://github.com/paypal/nemo

More Related Content

PDF
React Native Internals
PDF
用 Javascript 實現你的想像
PPTX
Unit Testing con Jest + Enzime para ReactJs
PDF
Александр Зимин
PPTX
Service Workers
PDF
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...
PDF
Criando aplicações com vuejs
React Native Internals
用 Javascript 實現你的想像
Unit Testing con Jest + Enzime para ReactJs
Александр Зимин
Service Workers
Angular 2 не так уж и плох... А если задуматься, то и просто хорош / Алексей ...
Criando aplicações com vuejs

What's hot (15)

PDF
Spring Boot 소개
PDF
Discover ServiceWorker
PDF
5 Hidden Gems of Alloy UI
PDF
Plugins con React y la REST API (Elio Rivero, WCBA 2017)
PDF
Стажировка 2016-08-04 02 Юлия Ашаева. Делаем тесты лучше
ODP
Gradle - next generation of build tools
PDF
APEX Developers : Do More With LESS !
PDF
Task Automatisierung mit Grunt.js
PDF
Yeoman is awesome
PDF
Intro to jQuery UI
ODP
Des Templates Heiliger Gral
PPT
Node.js and Web.js
PDF
Nearby Messages API
PPTX
10. add in Symfony 4
DOCX
Multiple Hyperlinks App
Spring Boot 소개
Discover ServiceWorker
5 Hidden Gems of Alloy UI
Plugins con React y la REST API (Elio Rivero, WCBA 2017)
Стажировка 2016-08-04 02 Юлия Ашаева. Делаем тесты лучше
Gradle - next generation of build tools
APEX Developers : Do More With LESS !
Task Automatisierung mit Grunt.js
Yeoman is awesome
Intro to jQuery UI
Des Templates Heiliger Gral
Node.js and Web.js
Nearby Messages API
10. add in Symfony 4
Multiple Hyperlinks App
Ad

Viewers also liked (15)

PDF
Intro to Visual Test Automation with Applitools Eyes
PPTX
Selenium-based Visual Test Automation
PPTX
How to level-up your Selenium tests with Visual Testing #SeleniumCamp
PPTX
Selenium Based Visual Test Automation
PDF
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
PPTX
Advanced Visual Test Automation with Selenium
PDF
Awesome Test Automation Made Simple w/ Dave Haeffner
PPTX
Sauce Labs+Applitools - Automated Visual Testing in the Cloud
PPTX
Advanced Cross-Browser Visual Testing with Applitools Eyes and HP LeanFT
PPTX
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
ZIP
Automated Frontend Testing
PPTX
Advanced Automated Visual Testing
PPTX
SeConf2015: Advanced Automated Visual Testing With Selenium
PDF
Test automation - What? Why? How?
PPTX
Grading the Quality of Selenium Tests
Intro to Visual Test Automation with Applitools Eyes
Selenium-based Visual Test Automation
How to level-up your Selenium tests with Visual Testing #SeleniumCamp
Selenium Based Visual Test Automation
*Webinar* Learn from the Experts: How to Boost Test Coverage with Automated V...
Advanced Visual Test Automation with Selenium
Awesome Test Automation Made Simple w/ Dave Haeffner
Sauce Labs+Applitools - Automated Visual Testing in the Cloud
Advanced Cross-Browser Visual Testing with Applitools Eyes and HP LeanFT
Deep Dive Modern Apps Lifecycle with Visual Studio 2012: How to create cross ...
Automated Frontend Testing
Advanced Automated Visual Testing
SeConf2015: Advanced Automated Visual Testing With Selenium
Test automation - What? Why? How?
Grading the Quality of Selenium Tests
Ad

More from Applitools (20)

PDF
Applitools Platform Pulse: What's New and What's Coming - July 2025
PDF
Code and No-Code Journeys: The Maintenance Shortcut
PDF
Code and No-Code Journeys: The Coverage Overlook
PDF
Creating Automated Tests with AI - Cory House - Applitools.pdf
PDF
Navigating EAA Compliance in Testing.pdf
PDF
AI-Assisted, AI-Augmented & Autonomous Testing
PDF
Code or No-Code Tests: Why Top Teams Choose Both
PDF
The ROI of AI-Powered Testing, presented by Applitools
PDF
Building No-code Autonomous E2E Tests_Applitools.pdf
PDF
Conquer 6 Testing Challenges_Applitools.pdf
PDF
Autonomous End-to-End Testing for Online Banking Applications Presented with ...
PDF
Playwright Visual Testing Best Practices, presented by Applitools
PDF
Cross-Browser and Cross-Device Testing | Applitools in Action
PDF
Advanced Debugging Techniques | Applitools in Action.pdf
PDF
AI-Powered Testing Strategies for the Seasonal Shopping Surge.pdf
PDF
Test Automation for Dynamic Applications _ Applitools in Action.pdf
PDF
Proven Approaches to AI-Powered E2E Testing.pdf
PDF
Applitools Autonomous 2.0 Sneak Peek.pdf
PDF
Building the Ideal CI-CD Pipeline_ Achieving Visual Perfection
PDF
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton
Applitools Platform Pulse: What's New and What's Coming - July 2025
Code and No-Code Journeys: The Maintenance Shortcut
Code and No-Code Journeys: The Coverage Overlook
Creating Automated Tests with AI - Cory House - Applitools.pdf
Navigating EAA Compliance in Testing.pdf
AI-Assisted, AI-Augmented & Autonomous Testing
Code or No-Code Tests: Why Top Teams Choose Both
The ROI of AI-Powered Testing, presented by Applitools
Building No-code Autonomous E2E Tests_Applitools.pdf
Conquer 6 Testing Challenges_Applitools.pdf
Autonomous End-to-End Testing for Online Banking Applications Presented with ...
Playwright Visual Testing Best Practices, presented by Applitools
Cross-Browser and Cross-Device Testing | Applitools in Action
Advanced Debugging Techniques | Applitools in Action.pdf
AI-Powered Testing Strategies for the Seasonal Shopping Surge.pdf
Test Automation for Dynamic Applications _ Applitools in Action.pdf
Proven Approaches to AI-Powered E2E Testing.pdf
Applitools Autonomous 2.0 Sneak Peek.pdf
Building the Ideal CI-CD Pipeline_ Achieving Visual Perfection
Leveraging AI for Mobile App Testing on Real Devices | Applitools + Kobiton

PayPal's NemoJS and Applitools Eyes - Visual Testing with Node.js