Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Testing Ext JS 5 Applications with Siesta
Search
Mats Bryntse
December 02, 2014
Technology
1
120
Testing Ext JS 5 Applications with Siesta
From SenchaDay 2014 in Karlsruhe
Mats Bryntse
December 02, 2014
Tweet
Share
More Decks by Mats Bryntse
See All by Mats Bryntse
Expect the unexpected - How to deal with JavaScript errors in web applications
mats
1
69
Creating Reusable UI Components with Ext JS
mats
2
900
Dealing with javascript errors in SPAs
mats
0
110
Record.Replay.Reproduce
mats
0
150
Expect the unexpected
mats
0
350
Record.Replay.Reproduce - Dealing with JS errors in modern web apps
mats
0
430
Unit and UI Testing Your Ext JS Web Applications with Siesta
mats
0
210
Siesta Deep Dive
mats
0
320
JavaScript Testing and Continuous Integration
mats
1
160
Other Decks in Technology
See All in Technology
形式手法の 10 メートル手前 #kernelvm / Kernel VM Study Hokuriku Part 7
ytaka23
3
320
生成AIと知識グラフの相互利用に基づく文書解析
koujikozaki
1
150
プロダクトエンジニアが活躍する環境を作りたくて 事業責任者になった話 ~プロダクトエンジニアの行き着く先~
gimupop
1
550
いまならこう作りたい AWSコンテナ[本格]入門ハンズオン 〜2024年版 ハンズオンの構想〜
horsewin
10
2.2k
カメラを用いた店内計測におけるオプトインの仕組みの実現 / ai-optin-camera
cyberagentdevelopers
PRO
1
130
リンクアンドモチベーション ソフトウェアエンジニア向け紹介資料 / Introduction to Link and Motivation for Software Engineers
lmi
4
290k
DatabricksにおけるLLMOpsのベストプラクティス
taka_aki
4
1.4k
Fargateを使った研修の話
takesection
0
160
TinyGoを使ったVSCode拡張機能実装
askua
2
170
Spring Frameworkの新標準!? ~ RestClientとHTTPインターフェース入門 ~
ogiwarat
2
220
Microsoft Fabric OneLake の実体について
ryomaru0825
0
120
「 SharePoint 難しい」ってよく聞くけど、そんなに言うなら8歳の息子に試してもらった
taichinakamura
2
760
Featured
See All Featured
Making Projects Easy
brettharned
115
5.9k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Cult of Friendly URLs
andyhume
78
6k
Teambox: Starting and Learning
jrom
132
8.7k
Measuring & Analyzing Core Web Vitals
bluesmoon
2
53
Gamification - CAS2011
davidbonilla
80
5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
231
17k
Optimizing for Happiness
mojombo
376
69k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
Speed Design
sergeychernyshev
24
580
Fontdeck: Realign not Redesign
paulrobertlloyd
81
5.2k
Transcript
Copyright Sencha Inc. 2014 Mats Bryntse, Bryntum Testing Ext JS
5 Apps @Bryntum
Intro | DESCRIPTION Who am I?
Webinar | Content Unit tests UI tests Continuous Integration •
Writing a unit test • Using PhantomJS • Hello world sample • Event recorder intro • Testing an Ext JS cmp • Recording a UI test • TeamCity • Code Coverage • Statistics • Cloud Testing
Intro | DESCRIPTION Less Theory, More Real World
Intro | WHY Why Testing?
Intro | WHY Hands up: Who is testing their JS?
Intro | WHY
Intro | WHY 1. Productivity & confidence in code 2.
Frameworks contain bugs 3. So does your code (and mine) 4. Refactoring & code handover 5. Fix bugs once
Intro | TERMINOLOGY Terminology: what does testing mean for a
JS developer?
Intro | TERMINOLOGY Unit tests, UI tests, Application tests..?
Intro | TERMINOLOGY Unit tests App Tests UI tests
Testing With Siesta Introduction
Intro | Testing with Siesta • runs in any browser
• is written in plain JS • is sandboxed by default A Siesta test…
Intro | Testing with Siesta • can do both UI
and unit testing • can be automated using PhantomJS or Selenium WebDriver • can detect leaked global variables A Siesta test…
Intro | Testing with Siesta describe('A simple Model test', function
(t) { t.it('Should do something', function(t) { // Test things t.expect(1).toBe(1); }); });
Unit Tests Red, Green, Refactor
Unit tests | Intro •Unit tests usually only involve “raw”
JS •Run very fast •Perfect for pre-commit hooks •Disable sandboxing if possible
Unit tests | Intro •Should be your #1 priority •Cover
your most important JS classes •Run often, before commit, daily, nightly. •Use TDD approach + BDD style for readability
Unit tests | TDD basics 1. Make the unit test
fail 2. Implement 3. Make the test pass 4. Refactor, Repeat
Unit tests | Writing a unit test Unit testing demo
Testing your UI Functional testing
UI tests | Intro Manually writing UI tests takes time
UI tests | Intro UI tests are more fragile &
run slower than unit tests
UI tests | Intro Understanding CSS and ComponentQuery is key
UI tests | Intro •UI “unit test” of a single
UI component •Or Application test, open index.html and test it Two main types of UI tests
UI tests | Intro UI Unit test demo
UI tests | Intro Siesta Event Recorder
UI tests | Event recorder •Great for application tests •Records
user actions: clicks, types, drag drop •Exports actions to a Siesta test case •Can be used by a non-programmer •Big timesaver
UI tests | Event recorder Let’s try the recorder
UI tests | Monkey tests Monkey testing
UI tests | Monkey tests •Random UI testing •Clicks, drags
etc. in your UI •Finds unhandled exceptions •Free testing help. 0€
UI tests | Monkey tests Cost breakdown: 5€ * 0
= 0 5€
Continuous Integration TeamCity, Code Coverage & Statistics
Continuous Integration | Intro •Bryntum uses TeamCity, Siesta integrates with
others (Jenkins…) •Test suites run every 2 hours in Chrome •Full test suites executed nightly •Reports, statistics, charts and code coverage
Continuous Integration | TeamCity Let’s checkout TeamCity
UI tests | Cloud testing So…running in multiple browsers?
Continuous Integration | Cloud testing •Need to create Virtual Machines
for each version of IE •Total: Chrome, Safari, FF, IE 7-11 => 7 VMs •Managing such a farm can be very time consuming
Continuous Integration | Cloud testing •Siesta integrates with both BrowserStack
and Sauce Labs •Run tests easily in any OS and Browser combination •No need to setup your own VM farm •Read more on the Bryntum blog…
Continuous Integration | Cloud testing Launching tests in BrowserStack
Rounding up | Links •bryntum.com/products/siesta •bryntum.com/docs/siesta •teamcity.bryntum.com/guest •browserstack.com/ •saucelabs.com/
Rounding up | Questions Questions? Twitter: @Bryntum