SlideShare ist ein Scribd-Unternehmen logo
1 von 32
www.coremedia.comwww.coremedia.com© CoreMedia | 2012-11-29 | 1
SoCraTes 2014:
Testing Rich-Web-UI
Mark Michaelis
Kudos to Martti Jeenicke
© CoreMedia AG | 10 April 2014 | 2
User Interface
© CoreMedia | 10 April 2014 | 3© CoreMedia AG | 10 April 2014 | 3
UI-Example: CoreMedia Studio
© CoreMedia | 10 April 2014 | 4© CoreMedia AG | 10 April 2014 | 4
Client-Server-Architecture
Studio-Server
(WebApp)
Client (Browser)
Content
REST Service
Presentation
ExtJS
MVC
Remoting
Backend Services
…
Content
Server
Search
AJAX Request
JSON
© CoreMedia AG | 10 April 2014 | 5
Testing UI-Components
© CoreMedia | 10 April 2014 | 6© CoreMedia AG | 10 April 2014 | 6© CoreMedia AG | 10 April 2014 | 6
Test-Pyramide (adopted from Mike Cohn)
UI
Service
Unit
Manual
© CoreMedia | 10 April 2014 | 7© CoreMedia AG | 10 April 2014 | 7
SoCraTes 2014 Session Notes
 Another pyramid introduced by Gojko Adzic:
How to implement UI testing without shooting yourself in the
foot (2010-04-13)
© CoreMedia AG | 10 April 2014 | 8
Technical Approach
© CoreMedia | 10 April 2014 | 9© CoreMedia AG | 10 April 2014 | 9
Primary Design Principles
Simplicity
Born
to Fail
Succeed
Fast
Reusable
Extensible
Sweetspot
© CoreMedia AG | 10 April 2014 | 10
UI-Test-Evolution
© CoreMedia | 10 April 2014 | 11© CoreMedia AG | 10 April 2014 | 11
UI-Test-Evolution
Old
@Test
void testDocUpdate() {
doc = cms.createDoc();
date1 = doc.getDate();
while (!searchServer.isIndexed(doc)) {
Thread.sleep(1000);
}
browser.open(„http://.../studio?id=“ + doc.getId());
Thread.sleep(2000);
browser.getElement(„text“).click();
browser.getElement(„text“).sendKeys(„lorem“);
browser.getElement(„save“).click();
Thread.sleep(500);
date2 = doc.getDate();
assertTrue(date2.after(date1));
}
© CoreMedia | 10 April 2014 | 12© CoreMedia AG | 10 April 2014 | 12
UI-Test-Evolution
New
@Test
void scenario_document_change_updates_date() {
Reference<Document> doc = ref();
given_document_D_exists(doc);
given_document_D_is_opened(doc);
when_I_change_document_D(doc);
then_modification_date_of_document_D_is_updated(doc);
}
© CoreMedia | 10 April 2014 | 13© CoreMedia AG | 10 April 2014 | 13
UI-Test-Evolution
Conditions/Matcher
@Test
void scenario_document_change_updates_date() {
Reference<Document> doc = ref();
given_document_D_exists(doc);
given_document_D_is_opened(doc);
when_I_change_document_D(doc);
then_modification_date_of_document_D_is_updated(doc);
}
searchServiceWrapper
.indexed(doc)
.waitUntil(equalTo(true));
© CoreMedia | 10 April 2014 | 14© CoreMedia AG | 10 April 2014 | 14
UI-Test-Evolution
UI-Wrapper
@Test
void scenario_document_change_updates_date() {
Reference<Document> doc = ref();
given_document_D_exists(doc);
given_document_D_is_opened(doc);
when_I_change_document_D(doc);
then_modification_date_of_document_D_is_updated(doc);
}
@Inject DocumentPanel panel;
TextField field = panel.getTextField();
field.write(„lorem“);
panel.saveDocument();
© CoreMedia | 10 April 2014 | 15© CoreMedia AG | 10 April 2014 | 15
UI-Test-Evolution
UI-Wrapper
@Test
void scenario_document_change_updates_date() {
Reference<Document> doc = ref();
given_document_D_exists(doc);
given_document_D_is_opened(doc);
when_I_change_document_D(doc);
then_modification_date_of_document_D_is_updated(doc);
}
@Inject DocumentPanel panel;
TextField field = panel.getTextField();
field.write(„lorem“);
panel.saveDocument();
@ExtJSObject(id = „docPanel“)
DocumentPanel extends ExtPanel {
@FindByExtJS(itemId=„save“) Button saveButton;
saveDocument() {
saveButton.click();
}
© CoreMedia | 10 April 2014 | 16© CoreMedia AG | 10 April 2014 | 16
UI-Test-Evolution
Wrapped UI
http://studio/
Content Tags Language
#onlinehelden
Title
Save Cancel
© CoreMedia | 10 April 2014 | 17© CoreMedia AG | 10 April 2014 | 17
UI-Test-Evolution
ExtJS Components
Panel
Toolbar Toolbar
TabView
Tab Tab Tab
Property Field
Toolbar
Label
Textfield
Button
© CoreMedia | 10 April 2014 | 18© CoreMedia AG | 10 April 2014 | 18
UI-Test-Evolution
Wrapper: Mapping ExtJS to Java
Hierarchy in ExtJS Hierarchy in Wrapperns
© CoreMedia | 10 April 2014 | 19© CoreMedia AG | 10 April 2014 | 19
GridView extends Base {
GridDragZone getDragZone();
Condition<WebElement> cellElement(row ,column);
Condition<WebElement> rowElement(row);
void dragRowFromTo(fromRow,toRow);
BooleanCondition empty();
}
Evolution eines Tests
UI-Wrapper – Ein Beispiel aus dem Leben
© CoreMedia AG | 10 April 2014 | 20
Wrap what?
© CoreMedia | 10 April 2014 | 21© CoreMedia AG | 10 April 2014 | 21
Wrap what?
Hidden Complexity (JavaScript)
self = Ext.getCmp(„panel“);
key = „itemId“; value = „save“;
btn = (self.find && self.find(key, value)[0])
|| (self.buttons
&& self.buttons.filter(
function(b){return b[key] && b[key]==value})[0])
|| (self.items
&& self.items.filter(key, value).get(0));
© CoreMedia | 10 April 2014 | 22© CoreMedia AG | 10 April 2014 | 22
Wrap what?
Hidden Complexity, DOM-Structure
<table cellspacing="0" class="x-toolbar-ct"><tbody>
<tr>
<td class="x-toolbar-left" align="left">
<table cellspacing="0"><tbody>
<tr class="x-toolbar-left-row"></tr>
</tbody></table>
</td>
<td class="x-toolbar-right" align="right">
<table cellspacing="0" class="x-toolbar-right-ct"><tbody>
<tr>
<td>
<table cellspacing="0"><tbody>
<tr class="x-toolbar-right-row">
<td class="x-toolbar-cell" id="ext-gen317">
<table id="ext-comp-1314" cellspacing="0" class="x-btn x-btn-noicon" style="width: 75px;">
<tbody class="x-btn-small x-btn-icon-small-left">
<tr>
<td class="x-btn-tl"><i>&nbsp;</i></td>
<td class="x-btn-tc"></td>
<td class="x-btn-tr"><i>&nbsp;</i></td>
</tr>
<tr>
<td class="x-btn-ml"><i>&nbsp;</i></td>
<td class="x-btn-mc">
<em class="" unselectable="on">
<button type="button" id="ext-gen318" style="" class=" x-btn-text">Bestätigen</button>
</em>
…
© CoreMedia AG | 10 April 2014 | 23
Some Graphs
© CoreMedia | 10 April 2014 | 24© CoreMedia AG | 10 April 2014 | 24
Responsibilities
WebDriver Wait Pattern
© CoreMedia | 10 April 2014 | 25© CoreMedia AG | 10 April 2014 | 25
Responsibilities
CoreMedia‘s Wait-Pattern
© CoreMedia | 10 April 2014 | 26© CoreMedia AG | 10 April 2014 | 26
Termination
WebDriver Wait Pattern
© CoreMedia | 10 April 2014 | 27© CoreMedia AG | 10 April 2014 | 27
Termination
CoreMedia‘s Wait Pattern
© CoreMedia | 10 April 2014 | 28© CoreMedia AG | 10 April 2014 | 28
What the Tester needs to know
WebDriver Wait Pattern
Everything…
© CoreMedia | 10 April 2014 | 29© CoreMedia AG | 10 April 2014 | 29
What the Tester needs to know
CoreMedia‘s Wait Pattern
© CoreMedia | 10 April 2014 | 30© CoreMedia AG | 10 April 2014 | 30
SoCraTes 2014 Session Notes
 What are you using for testing Web-UIs?
 DalekJS
 Selenium
 FluentLenium
 Protractor (for AngularJS Apps)
 ember
 capybara
 Greenpepper
 instanbul-js (Code Coverage)
© CoreMedia | 10 April 2014 | 31© CoreMedia AG | 10 April 2014 | 31
SoCraTes 2014 Session Notes
 Further Reading:
 testingexperience.de No. 4, January 2014:
(German, registration required for download)
Entwickler entdecken UI-Testing, pp. 12
www.coremedia.com© CoreMedia | 13. August 2014 | 32
Singapore
asia-info@coremedia.com
tel +65.6562.8866
Hamburg
info@coremedia.com
tel +49.40.32 55 87.0
San Francisco
usa-info@coremedia.com
tel +1.415.371.0400
London
uk-info@coremedia.com
tel +44.207.849.3317
Washington
info@coremedia.com
tel +1.703.945.1079

Weitere ähnliche Inhalte

Andere mochten auch

Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)
Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)
Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)Kiệm Phan
 
Мебель для кабинетов и переговорных.
Мебель для кабинетов и переговорных.Мебель для кабинетов и переговорных.
Мебель для кабинетов и переговорных.IGC-MEBEL
 
Cara memecah ip_linux_kuliax_pada_virtualbox
Cara memecah ip_linux_kuliax_pada_virtualboxCara memecah ip_linux_kuliax_pada_virtualbox
Cara memecah ip_linux_kuliax_pada_virtualboxAzhar Atalarik Satrio
 
Simulasi pendapatan desa
Simulasi pendapatan desaSimulasi pendapatan desa
Simulasi pendapatan desadeivie dedep
 
6. harry potter và hoàng tử lai (148bp)
6. harry potter và hoàng tử lai (148bp)6. harry potter và hoàng tử lai (148bp)
6. harry potter và hoàng tử lai (148bp)Kiệm Phan
 
Giải phẫu tập 1 đh y thái nguyên (326p)
Giải phẫu tập 1 đh y thái nguyên (326p)Giải phẫu tập 1 đh y thái nguyên (326p)
Giải phẫu tập 1 đh y thái nguyên (326p)Kiệm Phan
 
Giải phẫu tập 2 đh y thái nguyên (275p)
Giải phẫu tập 2 đh y thái nguyên (275p)Giải phẫu tập 2 đh y thái nguyên (275p)
Giải phẫu tập 2 đh y thái nguyên (275p)Kiệm Phan
 
Portrait photography challenge with Christopher Marona.
Portrait photography challenge with Christopher Marona.Portrait photography challenge with Christopher Marona.
Portrait photography challenge with Christopher Marona.Christopher Marona
 
Long Rains Food Security Assessment Findings
Long Rains Food Security Assessment FindingsLong Rains Food Security Assessment Findings
Long Rains Food Security Assessment Findings IAWG Africa
 

Andere mochten auch (14)

Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)
Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)
Hạt giống tâm hồn 6 và ý nghĩa cuộc sống (137p)
 
Tugas ip addres
Tugas ip addresTugas ip addres
Tugas ip addres
 
Мебель для кабинетов и переговорных.
Мебель для кабинетов и переговорных.Мебель для кабинетов и переговорных.
Мебель для кабинетов и переговорных.
 
Cara memecah ip_linux_kuliax_pada_virtualbox
Cara memecah ip_linux_kuliax_pada_virtualboxCara memecah ip_linux_kuliax_pada_virtualbox
Cara memecah ip_linux_kuliax_pada_virtualbox
 
Simulasi pendapatan desa
Simulasi pendapatan desaSimulasi pendapatan desa
Simulasi pendapatan desa
 
PPT KD 3.3
PPT KD 3.3PPT KD 3.3
PPT KD 3.3
 
6. harry potter và hoàng tử lai (148bp)
6. harry potter và hoàng tử lai (148bp)6. harry potter và hoàng tử lai (148bp)
6. harry potter và hoàng tử lai (148bp)
 
Giải phẫu tập 1 đh y thái nguyên (326p)
Giải phẫu tập 1 đh y thái nguyên (326p)Giải phẫu tập 1 đh y thái nguyên (326p)
Giải phẫu tập 1 đh y thái nguyên (326p)
 
Giải phẫu tập 2 đh y thái nguyên (275p)
Giải phẫu tập 2 đh y thái nguyên (275p)Giải phẫu tập 2 đh y thái nguyên (275p)
Giải phẫu tập 2 đh y thái nguyên (275p)
 
Dias 14mg20214
Dias 14mg20214Dias 14mg20214
Dias 14mg20214
 
Portrait photography challenge with Christopher Marona.
Portrait photography challenge with Christopher Marona.Portrait photography challenge with Christopher Marona.
Portrait photography challenge with Christopher Marona.
 
Long Rains Food Security Assessment Findings
Long Rains Food Security Assessment FindingsLong Rains Food Security Assessment Findings
Long Rains Food Security Assessment Findings
 
Placement representative
Placement representativePlacement representative
Placement representative
 
Contoh perintah dasar linux
Contoh perintah dasar linuxContoh perintah dasar linux
Contoh perintah dasar linux
 

Ähnlich wie CoreMedia SoCraTes 2014: Testing Rich Web UIs

AngularJS: What's the Big Deal?
AngularJS: What's the Big Deal?AngularJS: What's the Big Deal?
AngularJS: What's the Big Deal?Jim Duffy
 
inventory mangement project.pdf
inventory mangement project.pdfinventory mangement project.pdf
inventory mangement project.pdfMeenakshiThakur86
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...IT Event
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSmurtazahaveliwala
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...Mark Roden
 
jnandag detailed profile
jnandag detailed profilejnandag detailed profile
jnandag detailed profileJatin Nanda
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointRene Modery
 
LRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf PresentationLRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf PresentationSteve Nisbet
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsNathan Smith
 
Eclipse e4 Overview
Eclipse e4 OverviewEclipse e4 Overview
Eclipse e4 OverviewLars Vogel
 
JSP Web Technology Application on Road Transport Services
JSP Web Technology Application on Road Transport ServicesJSP Web Technology Application on Road Transport Services
JSP Web Technology Application on Road Transport ServicesMujeeb Rehman
 
Dynamic components using SPA concepts in AEM
Dynamic components using SPA concepts in AEMDynamic components using SPA concepts in AEM
Dynamic components using SPA concepts in AEMBojana Popovska
 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesMark Rackley
 
Dynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQDynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQAndon Sikavica
 

Ähnlich wie CoreMedia SoCraTes 2014: Testing Rich Web UIs (20)

AngularJS: What's the Big Deal?
AngularJS: What's the Big Deal?AngularJS: What's the Big Deal?
AngularJS: What's the Big Deal?
 
inventory mangement project.pdf
inventory mangement project.pdfinventory mangement project.pdf
inventory mangement project.pdf
 
Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...Max Voloshin - "Organization of frontend development for products with micros...
Max Voloshin - "Organization of frontend development for products with micros...
 
CV-Suresh
CV-SureshCV-Suresh
CV-Suresh
 
Clean Architecture @ Taxibeat
Clean Architecture @ TaxibeatClean Architecture @ Taxibeat
Clean Architecture @ Taxibeat
 
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJSAngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
AngularJS training - Day 1 - Basics: Why, What and basic features of AngularJS
 
Fastest offline with SQLite
Fastest offline with SQLiteFastest offline with SQLite
Fastest offline with SQLite
 
Resume
ResumeResume
Resume
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
jnandag detailed profile
jnandag detailed profilejnandag detailed profile
jnandag detailed profile
 
Introduction to using jQuery with SharePoint
Introduction to using jQuery with SharePointIntroduction to using jQuery with SharePoint
Introduction to using jQuery with SharePoint
 
LRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf PresentationLRT MoodleMootUK11 Unconf Presentation
LRT MoodleMootUK11 Unconf Presentation
 
Use Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile AppsUse Web Skills To Build Mobile Apps
Use Web Skills To Build Mobile Apps
 
Eclipse e4 Overview
Eclipse e4 OverviewEclipse e4 Overview
Eclipse e4 Overview
 
Achievement Archive
Achievement ArchiveAchievement Archive
Achievement Archive
 
JSP Web Technology Application on Road Transport Services
JSP Web Technology Application on Road Transport ServicesJSP Web Technology Application on Road Transport Services
JSP Web Technology Application on Road Transport Services
 
Dynamic components using SPA concepts in AEM
Dynamic components using SPA concepts in AEMDynamic components using SPA concepts in AEM
Dynamic components using SPA concepts in AEM
 
SPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery LibrariesSPTechCon Dev Days - Third Party jQuery Libraries
SPTechCon Dev Days - Third Party jQuery Libraries
 
Dynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQDynamic Components using Single-Page-Application Concepts in AEM/CQ
Dynamic Components using Single-Page-Application Concepts in AEM/CQ
 

Kürzlich hochgeladen

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Kürzlich hochgeladen (20)

CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

CoreMedia SoCraTes 2014: Testing Rich Web UIs

  • 1. www.coremedia.comwww.coremedia.com© CoreMedia | 2012-11-29 | 1 SoCraTes 2014: Testing Rich-Web-UI Mark Michaelis Kudos to Martti Jeenicke
  • 2. © CoreMedia AG | 10 April 2014 | 2 User Interface
  • 3. © CoreMedia | 10 April 2014 | 3© CoreMedia AG | 10 April 2014 | 3 UI-Example: CoreMedia Studio
  • 4. © CoreMedia | 10 April 2014 | 4© CoreMedia AG | 10 April 2014 | 4 Client-Server-Architecture Studio-Server (WebApp) Client (Browser) Content REST Service Presentation ExtJS MVC Remoting Backend Services … Content Server Search AJAX Request JSON
  • 5. © CoreMedia AG | 10 April 2014 | 5 Testing UI-Components
  • 6. © CoreMedia | 10 April 2014 | 6© CoreMedia AG | 10 April 2014 | 6© CoreMedia AG | 10 April 2014 | 6 Test-Pyramide (adopted from Mike Cohn) UI Service Unit Manual
  • 7. © CoreMedia | 10 April 2014 | 7© CoreMedia AG | 10 April 2014 | 7 SoCraTes 2014 Session Notes  Another pyramid introduced by Gojko Adzic: How to implement UI testing without shooting yourself in the foot (2010-04-13)
  • 8. © CoreMedia AG | 10 April 2014 | 8 Technical Approach
  • 9. © CoreMedia | 10 April 2014 | 9© CoreMedia AG | 10 April 2014 | 9 Primary Design Principles Simplicity Born to Fail Succeed Fast Reusable Extensible Sweetspot
  • 10. © CoreMedia AG | 10 April 2014 | 10 UI-Test-Evolution
  • 11. © CoreMedia | 10 April 2014 | 11© CoreMedia AG | 10 April 2014 | 11 UI-Test-Evolution Old @Test void testDocUpdate() { doc = cms.createDoc(); date1 = doc.getDate(); while (!searchServer.isIndexed(doc)) { Thread.sleep(1000); } browser.open(„http://.../studio?id=“ + doc.getId()); Thread.sleep(2000); browser.getElement(„text“).click(); browser.getElement(„text“).sendKeys(„lorem“); browser.getElement(„save“).click(); Thread.sleep(500); date2 = doc.getDate(); assertTrue(date2.after(date1)); }
  • 12. © CoreMedia | 10 April 2014 | 12© CoreMedia AG | 10 April 2014 | 12 UI-Test-Evolution New @Test void scenario_document_change_updates_date() { Reference<Document> doc = ref(); given_document_D_exists(doc); given_document_D_is_opened(doc); when_I_change_document_D(doc); then_modification_date_of_document_D_is_updated(doc); }
  • 13. © CoreMedia | 10 April 2014 | 13© CoreMedia AG | 10 April 2014 | 13 UI-Test-Evolution Conditions/Matcher @Test void scenario_document_change_updates_date() { Reference<Document> doc = ref(); given_document_D_exists(doc); given_document_D_is_opened(doc); when_I_change_document_D(doc); then_modification_date_of_document_D_is_updated(doc); } searchServiceWrapper .indexed(doc) .waitUntil(equalTo(true));
  • 14. © CoreMedia | 10 April 2014 | 14© CoreMedia AG | 10 April 2014 | 14 UI-Test-Evolution UI-Wrapper @Test void scenario_document_change_updates_date() { Reference<Document> doc = ref(); given_document_D_exists(doc); given_document_D_is_opened(doc); when_I_change_document_D(doc); then_modification_date_of_document_D_is_updated(doc); } @Inject DocumentPanel panel; TextField field = panel.getTextField(); field.write(„lorem“); panel.saveDocument();
  • 15. © CoreMedia | 10 April 2014 | 15© CoreMedia AG | 10 April 2014 | 15 UI-Test-Evolution UI-Wrapper @Test void scenario_document_change_updates_date() { Reference<Document> doc = ref(); given_document_D_exists(doc); given_document_D_is_opened(doc); when_I_change_document_D(doc); then_modification_date_of_document_D_is_updated(doc); } @Inject DocumentPanel panel; TextField field = panel.getTextField(); field.write(„lorem“); panel.saveDocument(); @ExtJSObject(id = „docPanel“) DocumentPanel extends ExtPanel { @FindByExtJS(itemId=„save“) Button saveButton; saveDocument() { saveButton.click(); }
  • 16. © CoreMedia | 10 April 2014 | 16© CoreMedia AG | 10 April 2014 | 16 UI-Test-Evolution Wrapped UI http://studio/ Content Tags Language #onlinehelden Title Save Cancel
  • 17. © CoreMedia | 10 April 2014 | 17© CoreMedia AG | 10 April 2014 | 17 UI-Test-Evolution ExtJS Components Panel Toolbar Toolbar TabView Tab Tab Tab Property Field Toolbar Label Textfield Button
  • 18. © CoreMedia | 10 April 2014 | 18© CoreMedia AG | 10 April 2014 | 18 UI-Test-Evolution Wrapper: Mapping ExtJS to Java Hierarchy in ExtJS Hierarchy in Wrapperns
  • 19. © CoreMedia | 10 April 2014 | 19© CoreMedia AG | 10 April 2014 | 19 GridView extends Base { GridDragZone getDragZone(); Condition<WebElement> cellElement(row ,column); Condition<WebElement> rowElement(row); void dragRowFromTo(fromRow,toRow); BooleanCondition empty(); } Evolution eines Tests UI-Wrapper – Ein Beispiel aus dem Leben
  • 20. © CoreMedia AG | 10 April 2014 | 20 Wrap what?
  • 21. © CoreMedia | 10 April 2014 | 21© CoreMedia AG | 10 April 2014 | 21 Wrap what? Hidden Complexity (JavaScript) self = Ext.getCmp(„panel“); key = „itemId“; value = „save“; btn = (self.find && self.find(key, value)[0]) || (self.buttons && self.buttons.filter( function(b){return b[key] && b[key]==value})[0]) || (self.items && self.items.filter(key, value).get(0));
  • 22. © CoreMedia | 10 April 2014 | 22© CoreMedia AG | 10 April 2014 | 22 Wrap what? Hidden Complexity, DOM-Structure <table cellspacing="0" class="x-toolbar-ct"><tbody> <tr> <td class="x-toolbar-left" align="left"> <table cellspacing="0"><tbody> <tr class="x-toolbar-left-row"></tr> </tbody></table> </td> <td class="x-toolbar-right" align="right"> <table cellspacing="0" class="x-toolbar-right-ct"><tbody> <tr> <td> <table cellspacing="0"><tbody> <tr class="x-toolbar-right-row"> <td class="x-toolbar-cell" id="ext-gen317"> <table id="ext-comp-1314" cellspacing="0" class="x-btn x-btn-noicon" style="width: 75px;"> <tbody class="x-btn-small x-btn-icon-small-left"> <tr> <td class="x-btn-tl"><i>&nbsp;</i></td> <td class="x-btn-tc"></td> <td class="x-btn-tr"><i>&nbsp;</i></td> </tr> <tr> <td class="x-btn-ml"><i>&nbsp;</i></td> <td class="x-btn-mc"> <em class="" unselectable="on"> <button type="button" id="ext-gen318" style="" class=" x-btn-text">Bestätigen</button> </em> …
  • 23. © CoreMedia AG | 10 April 2014 | 23 Some Graphs
  • 24. © CoreMedia | 10 April 2014 | 24© CoreMedia AG | 10 April 2014 | 24 Responsibilities WebDriver Wait Pattern
  • 25. © CoreMedia | 10 April 2014 | 25© CoreMedia AG | 10 April 2014 | 25 Responsibilities CoreMedia‘s Wait-Pattern
  • 26. © CoreMedia | 10 April 2014 | 26© CoreMedia AG | 10 April 2014 | 26 Termination WebDriver Wait Pattern
  • 27. © CoreMedia | 10 April 2014 | 27© CoreMedia AG | 10 April 2014 | 27 Termination CoreMedia‘s Wait Pattern
  • 28. © CoreMedia | 10 April 2014 | 28© CoreMedia AG | 10 April 2014 | 28 What the Tester needs to know WebDriver Wait Pattern Everything…
  • 29. © CoreMedia | 10 April 2014 | 29© CoreMedia AG | 10 April 2014 | 29 What the Tester needs to know CoreMedia‘s Wait Pattern
  • 30. © CoreMedia | 10 April 2014 | 30© CoreMedia AG | 10 April 2014 | 30 SoCraTes 2014 Session Notes  What are you using for testing Web-UIs?  DalekJS  Selenium  FluentLenium  Protractor (for AngularJS Apps)  ember  capybara  Greenpepper  instanbul-js (Code Coverage)
  • 31. © CoreMedia | 10 April 2014 | 31© CoreMedia AG | 10 April 2014 | 31 SoCraTes 2014 Session Notes  Further Reading:  testingexperience.de No. 4, January 2014: (German, registration required for download) Entwickler entdecken UI-Testing, pp. 12
  • 32. www.coremedia.com© CoreMedia | 13. August 2014 | 32 Singapore asia-info@coremedia.com tel +65.6562.8866 Hamburg info@coremedia.com tel +49.40.32 55 87.0 San Francisco usa-info@coremedia.com tel +1.415.371.0400 London uk-info@coremedia.com tel +44.207.849.3317 Washington info@coremedia.com tel +1.703.945.1079

Hinweis der Redaktion

  1. ExpectedCondition responsible for accessing SUT and for matching
  2. Single Responsibility Pattern
  3. Obfuscated contract ExpectedCondition only usable for matching
  4. Clear contract Expressions reusable for matching and for retrieving values