DalekJSMy Name Is Not Sisyphus!
orLet Others Do Your Dirty Work
orAutomated Cross Browser Testing With JavaScript
Introduction
DalekJS :: What is DalekJS?
An easy to use JavaScript based
cross platform automated cross
browser black-box testing tool
DalekJS website Nir Elbaz
DalekJS :: Main Features
❖ Launch & automate your browser❖ Fill & submit forms❖ Click & follow links❖ Capture screenshots❖ Run your functional tests
Nir Elbaz
DalekJS :: Prerequisites
❖ Terminal friendly❖ Basic HTML & JavaScript❖ CSS selectors
Software:
❖ Terminal (command prompt)❖ Notepad
Nir Elbaz
CSS Selector
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
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
Installation
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
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
Hands On
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
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
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
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
Demo
Prolog
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
Nir Elbaz