In part three of our testing frameworks webinar series, we explored the growing trend of open source UI frameworks. Join our very own Daniel Giordano as he walks you through how to use open source UI frameworks to your benefit.
4. Page
Proprietary & ConfidentialUI Testing Frameworks
Test Frameworks In SDLC
Requirements Tests Defects
What We Expect Configuration & Test
Definition Sets Environments
Actual Test Results
5. What is a Test Automation
Framework?
UI Testing Frameworks
6. Page
Proprietary & ConfidentialUI Testing Frameworks
What is a Test Automation Framework?
It’sasetofrules,tools,andspecificationsthatprovidesupportandeaseoftestingforaparticularproductorapplication.
Many times a test framework is responsible for:
Definingandassertingexpectations
Drivingthetestinteractiontheapplication
Executingthetest
Reportingontests
7. Page
Proprietary & ConfidentialUI Testing Frameworks
A Framework Is Not A “Shortcut”
Yes it is.
“If what we test is changing, our assertions
should change.”
“If the HTML changes, our Page Objects
should change.”
“If our environments need to change, then our
driver .config file needs to change.
9. Page
Proprietary & ConfidentialUI Testing Frameworks
Adding Up An Automation Framework
Assertions
Assertionshelpusmakesuretests
returnexpectedresults.
// Chai expect
expect(foo).to.be.a('string')
expect(foo).to.equal('bar')
Test Runners
Controlsandinteractswithbrowsers
toexecuteframework
.url('http://www.github.com')
.waitForElementVisible('body', 1000)
.setValue('form[action="/search"]
input[name="q"]', 'nightwatch')
.keys(browser.Keys.ENTER)
Test Framework
Aframeworkgivesourteststructure
andcommonsyntax.
describe('#save()', function() {
it('should save without
error', function(done)
}
10. Page
Proprietary & ConfidentialUI Testing Frameworks
Types Of Automated Testing
End to End TestingUnit Testing
• Smallpiecesofcodetestingsinglefunctions
• Think“noneedforaURLtotest”
• Thinklarger interactionsthatmimichumans
• Testingseveral”unittests”strungtogether
”Log In” Button Clicks
Or
“2+2=4”
CrossBrowserTesting.com loads
Click “Log In” Button
Fill in Username
Fill in Password
Click “Log In” Button
11. Page
Proprietary & ConfidentialUI Testing Frameworks
Unit Testing E2EAutomation
AssertionsRunner
NightWatchJS
WebDriver.IO
Casper.JS
Mocha,
Jasmine
Should
Frameworks
Chai
Siz
e of
= Popularity
Protractor
12. Page
Proprietary & ConfidentialUI Testing Frameworks
Why Are JavaScript Frameworks So Popular?
Because JavaScript is the language of the web.
14. Page
Proprietary & Confidential
Let’s Compare Two
UnitTesting Frameworks
UI Testing Frameworks
Mocha Jasmine
Assertion Library Has none out of box. Choose between
Chai, should, better-expect, expect.js
expect(calculator.add(1, 4)).to.equal(5);
Comes out of the box.
expect(calculator.add(1, 4)).toEqual(5);
Spies Has none out of box. Uses Sinon Comes out of the box.
Asynch Testing Does it really well Does it really well in 2.X
BDD/TDD Yes, both. Yes, both.
Community Really active community since it’s the hot
stock on the street.
Older, more mature documentation and
community base
15. Page
Proprietary & ConfidentialUI Testing Frameworks
Let’s Compare Three
E2E Testing
Nightwatch Protractor WebDriver.IO
Specialty Easy, out of the box set up Angular testing Customization
Architecture Custom implementation of W3C
webdriver JSON wire protocol
Selenium Wrapper Custom implementation of W3C
webdriver JSON wire protocol
Assertion Library Mocha, Its Own Chai, Jasmine, Mocha Chai, Jasmine, Mocha
Parallel Testing Yes Yes Yes
POM Support Yes Yes Yes
16. Page
Proprietary & ConfidentialUI Testing Frameworks
Critera For Selection
End to End Capabilities
Assertions
BDD/TDD Friendly
Tool Documentation
Visual Testing
CI Integrations
Dev Language
App Language
CloudSupport
Community Size
Style Fit
Technical Fit
17. Why Run Your Tests In The Cloud
Using CrossBrowserTesting?
UI Testing Frameworks
18. Page
Proprietary & ConfidentialUI Testing Frameworks
Running In The Cloud
CrossBrowserTesting’s Device Cloud
SeleniumorAppiumscriptsgetcreated
andexecutedasnormal,withonlyafew
changestothecode.
Seleniumsendscommandstoour
browsersandmobiledevicesandwesend
thetestresultsbacktotheuser.
21. Page
Proprietary & Confidential
Speed
Selenium Training
Test 2Test 2Test 2
Test 3 Test 3 Test 3
When we run automated tests
sequentially we are limited in how
many we can execute in a short period
of time.
Test 1Test 1 Test 1
Test 1
Test 1
Test 1
Test 2
Test 2
Test 2
Test 3
Test 3
Test 3
With parallel test
execution we can test
many cases and
browsers at once.
21
27. Page
Proprietary & ConfidentialUI Testing Frameworks
Test Automation Frameworks In SDLC
Requirements Tests Defects
What We Expect Configuration & Test
Definition Sets Environments
Actual Test Results
Assertions Test Results
Style Cloud
Frameworks
Let’s bring it back. We know about the various aspects of a testing framework as it fits in the SDLC, and this webinar is not meant to confuse you with muddying that word, though it will be muddied. This webinar will deal with open-source test automation frameworks, or rather tools, as they quickly rise to prominence in the testing community.
We will combine Assertion Libraries, Unit Testing and E2E testing together as Test Frameworks
But it builds good architecture.
Throw off the stigma
Test tools can be divided into the following functionalities. Some provide us with only one functionality, and some provide us with a combination.
It’s common to use a combination of tools even if one can achieve the same using a single tool in order to get a more flexible functionality.
There are also Spies, Stubbing or Mocking, and Code Coverage tools that are included in the testing tool chain.
NightwatchJS
WebDriver.IO
WebDriverCSS, for visual testing
Let’s bring it back. We know about the various aspects of a testing framework as it fits in the SDLC, and this webinar is not meant to confuse you with muddying that word, though it will be muddied. This webinar will deal with open-source test automation frameworks, or rather tools, as they quickly rise to prominence in the testing community.