20
DalekJS My Name Is Not Sisyphus! or Let Others Do Your Dirty Work or Automated Cross Browser Testing With JavaScript

Dalek.js - Automated cross browser testing with JavaScript

Embed Size (px)

DESCRIPTION

A short introduction to one of the most easy-to-use cross browser testing tool. DalekJS helps you write simple instructions to drive either headless browser or real browsers, to see if your application works as expected

Citation preview

Page 1: Dalek.js - Automated cross browser testing with JavaScript

DalekJSMy Name Is Not Sisyphus!

orLet Others Do Your Dirty Work

orAutomated Cross Browser Testing With JavaScript

Page 2: Dalek.js - Automated cross browser testing with JavaScript

Introduction

Page 3: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: What is DalekJS?

An easy to use JavaScript based

cross platform automated cross

browser black-box testing tool

DalekJS website Nir Elbaz

Page 4: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Main Features

❖ Launch & automate your browser❖ Fill & submit forms❖ Click & follow links❖ Capture screenshots❖ Run your functional tests

Nir Elbaz

Page 5: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Prerequisites

❖ Terminal friendly❖ Basic HTML & JavaScript❖ CSS selectors

Software:

❖ Terminal (command prompt)❖ Notepad

Nir Elbaz

Page 6: Dalek.js - Automated cross browser testing with JavaScript

CSS Selector

Page 7: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: CSS Selectors

Select the element(s) you want to style

Selector {Property: Value;Property: Value;...

}

Selector {Property: Value;...

}

body {color: Red;font-size: 11px;...

}

#myButton {display: none;...

}

Nir Elbaz

Page 8: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: CSS Selectors

Selector types❖ element❖ #id❖ .class❖ [attribute]❖ [attribute=value]❖ :pseudo-class❖ ::pseudo-element❖ …

CSS Selectors Demo

❖ element1 descendant❖ element1 > child❖ element1 + adjacent❖ element1 ~ preceed❖ element:nth-child(2)❖ :not(selector)❖ …

Nir Elbaz

Page 9: Dalek.js - Automated cross browser testing with JavaScript

Installation

Page 10: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Installation

1. Install node.js2. Create a new directory for your tests3. Open terminal (command prompt)

a. Install dalekjs command line interface globally:npm install dalek-cli -g

b. Change path (cd) to tests directory

c. Install dalekjs package locally:npm install dalekjs

Nir Elbaz

Page 11: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Installation

Advance installations

1. Install more browsers drivers:npm install dalek-browser-chrome

npm install dalek-browser-ie

npm install dalek-browser-firefox

npm install dalek-browser-ios

1. Install reports:npm install dalek-reporter-html

Nir Elbaz

Page 12: Dalek.js - Automated cross browser testing with JavaScript

Hands On

Page 13: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Hands On

Test file sample (*.js)

module.exports = {

'Page title is correct': function (test) {

test

.open('http://google.com')

.assert.title().is('Google', 'It has title')

.done();

}

};

Nir Elbaz

Page 14: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Hands On

Running a test file using PhantomJS:dalek filename

Running a test file using a real browser:dalek filename -b chrome

Running a test file & create a report:dalek filename -r myreport.html

Nir Elbaz

Page 15: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Hands On

Actions - a way to control your browsers,e.g. simulate user interactions like clickingelements, open urls, filling out inputfields, etc.

reload, forward, open, submit, click, wait,

type, setValue, maximize, toParent...

DalekJS Cheat Sheet Nir Elbaz

Page 16: Dalek.js - Automated cross browser testing with JavaScript

Assertions - check if the assumptionsyou made about a website are correct.For example they might check if the titleof a page or the content text of an elementis as expected

height, css, attr, exists, text, cookie...

DalekJS :: Hands On

DalekJS Cheat Sheet Nir Elbaz

Page 17: Dalek.js - Automated cross browser testing with JavaScript

Demo

Page 18: Dalek.js - Automated cross browser testing with JavaScript

Prolog

Page 19: Dalek.js - Automated cross browser testing with JavaScript

DalekJS :: Prolog

❖ An easy to use UI testing automation tool❖ Can increase QA & Dev teams productivity

Create scripts repository, use task scheduler to auto-run test files...

❖ Great for regression & routine testing❖ Learn more on DalekJS.com & cheat sheet

However...

❖ It is still beta❖ This is NOT the only tool out there

Page 20: Dalek.js - Automated cross browser testing with JavaScript

Nir Elbaz