zombiejs

27
{ Introduction to Zombie.js Victor Tkachenko

Upload: -

Post on 17-Jun-2015

307 views

Category:

Software


0 download

DESCRIPTION

Lightweight client-side framework based on node.js for automation testing

TRANSCRIPT

Page 1: Zombiejs

{Introduction to Zombie.js

Victor Tkachenko

Page 2: Zombiejs

verifying functional requirements produce load testing checking database

Automation testing allows to:

Page 3: Zombiejs

Zombie.js is a lightweight framework for testing client-side JavaScript code in a simulated environment

Zombie.js: what it is?

Page 4: Zombiejs

PhantomJS NightwatchJS HtmlUnit (based on Java) Ghost, Twill, Spynner (based on Python) Awesomium (based on .NET/C++). Commercial SimpleBrowser (based on .NET4.0/C#) EnvJS (based on JavaScrpt via Java/Rhino) Watir-webdriver with headless gem (Ruby via

WebDriver) Selenium WebDriver (based on JavaScript,

Node.js) Other…

Also we have another headless web browsers:

Page 5: Zombiejs

very fast easy to run easy to understand based on promise-object support mainstream test frameworks no need to use IDE such as Visual Studio

etc

What we get from Zombie.js?

Page 6: Zombiejs

HTML5 parsing and dealing with tag soups DOM Level 3 implementation HTML5 form fields (search, url, etc) CSS3 Selectors with some extensions Cookies and Web Storage XMLHttpRequest in all its glory setTimeout/setInterval pushState, popstate and hashchange events alert, confirm and prompt WebSockets and Server-Sent Events

Zombie.js support

Page 7: Zombiejs

unix-based OS g++ node.js node-gyp package python (from 2.5 to 3.0 version)

Dependencies

Page 8: Zombiejs

We should type in command line: sudo apt-get install g++ sudo apt-get install python-software-

properties sudo apt-get install nodejs-legacy sudo apt-get install npm npm install zombie

How to install

Page 9: Zombiejs

How to run

Page 10: Zombiejs

Getting started

Page 11: Zombiejs

browser.query(selector); browser.queryAll(selector); browser.clickLink(selector/text, callback(e, browser,

status)); browser.text(selector); browser.html(selector); support xpath selectors

API for managing DOM

Page 12: Zombiejs

DOM manipulation

Page 13: Zombiejs

browser.attach(selector, filename, callback);

browser.fill(selector, text); browser.select(selector, value); browser.pressButton(selector/text in

button); browser.check(field, callback); browser.choose(field, callback); browser.field(selector); browser.button(selector);

API for managing Forms

Page 14: Zombiejs

browser.cookies(domain, path); browser.fork(); browser.localStorage(host); browser.sessionStorage(host);

API for state management

Page 15: Zombiejs

We have a few functions based on promises like as visit, wait, clickLink

Callbacks API based on promises

Page 16: Zombiejs

browser.fire(name, target, callback); browser.wait(callback);

Events API

Page 17: Zombiejs

Firing event

Page 18: Zombiejs

How to use

Page 19: Zombiejs

browser.dump(); browser.lastError(); browser.log(arguments); browser.resources(); browser.viewInBrowser(name);

Debug API

Page 20: Zombiejs

windows.all(); windows.close(window); windows.current; windows.get(name || index); windows.count; windows.select(window);

Windows management

Page 21: Zombiejs

browser.location browser.history browser.reload browser.statusCode browser.redirected

API for managing BOM

Page 22: Zombiejs

debug loadCSS runScripts headers maxWait userAgent site waitFor and other

We have options such as

Page 23: Zombiejs

browser.debug = true;

Page 24: Zombiejs
Page 25: Zombiejs

?

Page 26: Zombiejs

https://www.google.com.ua/#q=zombie.js

Used literature

Page 27: Zombiejs

Skype: victor.tkachenko6 E-mail: [email protected]

Contact info