- Testing JavaScript code helps ensure quality and allows for refactoring and code handovers. Unit, integration, and functional testing methodologies were discussed.
- Siesta was introduced as a JavaScript testing tool that supports unit and functional testing for Ext JS and Sencha Touch. It allows simulating user interactions and verifying results.
- Writing testable code through separation of concerns, avoiding direct DOM manipulation, and supporting dependency injection were recommended to facilitate automated testing. Continuous integration was also recommended for running tests regularly.
Cover the advantages of test driven development, the reasons for pushing it all the way to the browser level, and then explore the options for testing JavaScript, look at some examples, and then integrate the tests into our existing development workflow.
Вы пишете е2е тесты для вашего приложения иони даже работают, но интуиция подсказывает что не так. При каждом незначительном изменении html, приходится править тесты. Со временем их тяжело читать, дописывать и поддерживать. Звучит знакомо?
В этой лекции мы обсудим примеры и практики, которые решаю эти и многие другие проблемы. Эти практики - результат, накопленный за несколько лет написания и поддержки более тысячи тестов в WIX среди разных команд.
Slides for the presentation I did for the Vancouver AngularJS meetup group.
http://www.meetup.com/vanangularJS/events/216391652/
The code is available on my github account.
https://github.com/aeisenberg/angular-app/tree/vanangular-protractor
(Notice the branch is not master.)
Cover the advantages of test driven development, the reasons for pushing it all the way to the browser level, and then explore the options for testing JavaScript, look at some examples, and then integrate the tests into our existing development workflow.
Вы пишете е2е тесты для вашего приложения иони даже работают, но интуиция подсказывает что не так. При каждом незначительном изменении html, приходится править тесты. Со временем их тяжело читать, дописывать и поддерживать. Звучит знакомо?
В этой лекции мы обсудим примеры и практики, которые решаю эти и многие другие проблемы. Эти практики - результат, накопленный за несколько лет написания и поддержки более тысячи тестов в WIX среди разных команд.
Slides for the presentation I did for the Vancouver AngularJS meetup group.
http://www.meetup.com/vanangularJS/events/216391652/
The code is available on my github account.
https://github.com/aeisenberg/angular-app/tree/vanangular-protractor
(Notice the branch is not master.)
Performance optimization is a crucial aspect of building ‘snappy’ client-side applications and something which all developers using jQuery should bear in mind. In this talk, we're going to take a look at some of the best practices, tips and tricks for improving the performance of your jQuery code in 2011 with some quick wins and a few new surprises along the way.
UI Testing Best Practices - An Expected JourneyOren Farhi
This slide focus on the good reasons for writing unit tests for testing ui.
Much like you're testing ui manually, you can have simple minimal code doing that for you.
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015Matt Raible
Many Spring projects exist that leverage XML for their configuration and bean definitions. Most Java web applications use a web.xml to configure their servlets, filters and listeners. This session shows you how you can eliminate XML by configuring your Spring beans with JavaConfig and annotations. It also shows how you can remove your web.xml and configure your web components with Java.
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
One of the biggest challenges of many web applications is the support on the different browsers with different versions. JavaScript code that runs on Safari does not necessarily mean it will work on IE or Firefox or Google chrome. This challenge is inherited from the lack of testing the JavaScript code that lives in the presentation tier from day one. Without unit testing the JavaScript code, organization will pay much money for testing, re-testing, and re-testing web applications for just deciding upgrading or supporting new browsers. This presentation shows the solution of this problem.
Automation Abstraction Layers: Page Objects and BeyondAlan Richardson
An overview of different approaches to Page Objects and Domain Objects for GUI Automation. Examples use WebDriver and Java.
Full source code is available to download, For more details see the associated blog post.
Automated php unit testing in drupal 8Jay Friendly
An overview of PHPUnit Automated testing in Drupal 8, including a comparison of manual testing vs automated testing, the pros and cons of automated testing, and the types of automated tests available in Drupal 8.
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
Description
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.
We’ll learn how to test your API serverside with Testbox and Clientside with Jasmine.
With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.
Attendees should have some exposure to CFCs as endpoints, or CF API creations, and consuming with other languages/devices, in this case, JavaScript.
## Attendees will learn
How to use Testbox to test your CFCs 2 different ways
Different types and ways to test JavaScript
Overview of client/server side testing tools
Building testing into your workflow
You are one of many that are not testing your APIs thoroughly
Performance optimization is a crucial aspect of building ‘snappy’ client-side applications and something which all developers using jQuery should bear in mind. In this talk, we're going to take a look at some of the best practices, tips and tricks for improving the performance of your jQuery code in 2011 with some quick wins and a few new surprises along the way.
UI Testing Best Practices - An Expected JourneyOren Farhi
This slide focus on the good reasons for writing unit tests for testing ui.
Much like you're testing ui manually, you can have simple minimal code doing that for you.
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015Matt Raible
Many Spring projects exist that leverage XML for their configuration and bean definitions. Most Java web applications use a web.xml to configure their servlets, filters and listeners. This session shows you how you can eliminate XML by configuring your Spring beans with JavaConfig and annotations. It also shows how you can remove your web.xml and configure your web components with Java.
Efficient JavaScript Unit Testing, May 2012Hazem Saleh
One of the biggest challenges of many web applications is the support on the different browsers with different versions. JavaScript code that runs on Safari does not necessarily mean it will work on IE or Firefox or Google chrome. This challenge is inherited from the lack of testing the JavaScript code that lives in the presentation tier from day one. Without unit testing the JavaScript code, organization will pay much money for testing, re-testing, and re-testing web applications for just deciding upgrading or supporting new browsers. This presentation shows the solution of this problem.
Automation Abstraction Layers: Page Objects and BeyondAlan Richardson
An overview of different approaches to Page Objects and Domain Objects for GUI Automation. Examples use WebDriver and Java.
Full source code is available to download, For more details see the associated blog post.
Automated php unit testing in drupal 8Jay Friendly
An overview of PHPUnit Automated testing in Drupal 8, including a comparison of manual testing vs automated testing, the pros and cons of automated testing, and the types of automated tests available in Drupal 8.
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
Description
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.
We’ll learn how to test your API serverside with Testbox and Clientside with Jasmine.
With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.
Attendees should have some exposure to CFCs as endpoints, or CF API creations, and consuming with other languages/devices, in this case, JavaScript.
## Attendees will learn
How to use Testbox to test your CFCs 2 different ways
Different types and ways to test JavaScript
Overview of client/server side testing tools
Building testing into your workflow
You are one of many that are not testing your APIs thoroughly
SenchaCon 2016: How Sencha Test Helps Automate Functional Testing of Ext JS M...Sencha
Learn how Sencha Test helped profiq, a software engineering service provider, to automate and track verification of modern Ext JS applications and their various components on multiple web browsers and devices. You will also learn tips and tricks that can speed up the development cycle of your JavaScript applications, including how you can leverage Sencha Test and its APIs.
SenchaCon 2016: The Changing Landscape of JavaScript Testing - Joel Watson an...Sencha
Testing JavaScript applications can be difficult. In addition to testing application functionality, testers need to worry about browser compatibility, how to define tests, the environment under which tests will be run, integration into automation platforms, and the workflow of developers and testers. This presentation will discuss how Sencha Test provides development teams with a testing platform that addresses these challenges while minimizing the effort required to deploy and use testing tools--meaning that your team can focus on delivering awesome user experiences rather than fighting with their testing infrastructure.
Interested in starting a company in Brazil? Here is a quick 15-min guide for everything you need to know to get started.
This guide is provides an overview of the Brazil market size, key players, opportunity then dives into topics such as costs of operation, rules/regulations and even local culture.
Brazil Startup Report is a guide written by local volunteer entrepreneurs and investors. If you are interested in creating such a report for your own country, please contact hello@worldstartupreport.com. Please also consider making a donation to help create more of these free reports for other countries in need.
Thanks for reading!
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.
We’ll learn how to test your API serverside with Testbox and Clientside with Jasmine.
With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.
Attendees should have some exposure to CFCs as endpoints, or CF API creations, and consuming with other languages/devices, in this case, JavaScript.
Attendees will learn
How to use Testbox to test your CFCs 2 different ways
Different types and ways to test JavaScript
Overview of client/server side testing tools
Building testing into your workflow
You are one of many that are not testing your APIs thoroughly
Most projects in CF now involve creating some type of consumable CFC Endpoint or API Service... do you Unit test your API, do you use Integration Tests on your API? How many ways do you test your API? Not all tests are created equal.
We build our CFCs and CF API to be consumed with CF Apps, Mobile Apps, Javascript apps and devices we haven’t even thought about yet. To be smart developers we need to be able to test our CFC endpoints, and the code that uses those endpoints.
We’ll learn how to test your API serverside with Testbox and Clientside with Jasmine.
With Testbox and Jasmine both using BDD, your test code can almost be isomorphic.
Attendees should have some exposure to CFCs as endpoints, or CF API creations, and consuming with other languages/devices, in this case, JavaScript.
Attendees will learn
How to use Testbox to test your CFCs 2 different ways
Different types and ways to test JavaScript
Overview of client/server side testing tools
Building testing into your workflow
You are one of many that are not testing your APIs thoroughly
Mock what? What Mock?Learn What is Mocking, and how to use Mocking with ColdFusion testing, development, and continuous integration. Look at Mocking and Stubbing with a touch of Theory and a lot of Examples, including what you could test, and what you should test… and what you shouldn't test (but might be fun).
Mathilde Lemée & Romain Maton
La théorie, c’est bien, la pratique … aussi !
Venez nous rejoindre pour découvrir les profondeurs de Node.js !
Nous nous servirons d’un exemple pratique pour vous permettre d’avoir une premiere experience complete autour de Node.js et de vous permettre de vous forger un avis sur ce serveur Javascript qui fait parler de lui !
http://soft-shake.ch/2011/conference/sessions/incubator/2011/09/01/hands-on-nodejs.html
Testing mit Codeception: Full-stack testing PHP frameworkSusannSgorzaly
Codeception is a PHP testing framework for Behavior Driven Development, which covers all kinds of tests: unit tests, functional tests and acceptance tests. It is fast and simple in both usage and execution. This talk will give you a introduction to the software testing basics using codeception. It will also cover some stumbling blocks when writing tests, like:
- Test code stability against small changes
- Data stability
- Test structure
Last but not least I will give you a short outlook how to make your tests also understandable for product owners.
Mal ganz ehrlich: Testen im Frontend hat noch nie viel Spaß gemacht. In meinem Talk möchte ich mit Jest eine Testbibliothek vorstellen, die genau das ändern kann. Jest ist ohne viel Konfiguration direkt einsetzbar und bringt alles mit, was man von einer Testbibliothek erwartet (und noch mehr). An vielen praktischen Beispielen möchte ich meine Lieblingsfeatures wie z.B. Snapshot-Tests, Mocking oder das tolle CLI erläutern und zeigen, dass Testen im Frontend durchaus Spaß machen kann. Eine Ausrede weniger, um auf das Testen im Frontend zu verzichten!
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Epistemic Interaction - tuning interfaces to provide information for AI supportAlan Dix
Paper presented at SYNERGY workshop at AVI 2024, Genoa, Italy. 3rd June 2024
https://alandix.com/academic/papers/synergy2024-epistemic/
As machine learning integrates deeper into human-computer interactions, the concept of epistemic interaction emerges, aiming to refine these interactions to enhance system adaptability. This approach encourages minor, intentional adjustments in user behaviour to enrich the data available for system learning. This paper introduces epistemic interaction within the context of human-system communication, illustrating how deliberate interaction design can improve system understanding and adaptation. Through concrete examples, we demonstrate the potential of epistemic interaction to significantly advance human-computer interaction by leveraging intuitive human communication strategies to inform system design and functionality, offering a novel pathway for enriching user-system engagements.
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
2. Contents
• Why test your JavaScript?
• Testing Methodologies
• Introducing Siesta
• Writing testable JS
• Automating tests
3. About me
var me = {
name : ”Mats Bryntse”,
age : 35+,
lives : ”Helsingborg, Sweden”,
does : ”Runs Bryntum”,
site : ”www.bryntum.com”,
twitter : ”@bryntum”
};
6. How many of you...
• have a frontend test suite?
• have frontend test suite as part of your CI?
• run your test suite in all major browsers?
• have zero or fewer frontend tests for your app?
9. The backend
• Single controlled platform
• Simple to test and refactor
• Good IDEs and tools
PHP
C#
Java
10. The frontend
• Multiple platforms & versions
(Mac, Windows XP/Vista/7/8, Linux...)
• Multiple browser versions
• Hard to refactor
• JavaScript support in IDEs is
still !== awesome
11. Conclusion
Too easy to #FAIL as a frontend developer
Testing helps you keep fails to a minimum.
12. But...
”... my code is bug free”
”...testing takes time away from adding new
features (+ new bugs)”
”...it’s QA’s job to test”
”... it’s boring and I’ll quit my job”
13. A good investment
• Writing tests === investment in your code
• Takes time
• Will pay you back, though not instantly
18. A test suite...
=> confidence in your code
=> serves as extra documentation
=> easier refactoring
=> bugs happen once, easier to find
=======> quality of sleep
19. Code handover
• Test cases are really useful when handing over
responsibility for a JS module
• Developer Bob quits his job. New guy gets
responsibility of his JS code.
• How will new guy know what parts of the
codebase is safe to change & refactor?
20. New guy studies codebase
application.js
/**
* When I wrote this, only God and I understood what I was doing
* Now, God only knows
**/
/* I am not sure if we need this, but too scared to delete. */
// drunk, fix later
// This is my last day...
22. Code handover
• Without test suite, will new guy feel good
about making major changes?
• Only minor cosmetic changes on the surface.
• System accumulates cruft over time.
• Sounds familiar?
25. Unit testing
• Testing the API of a single isolated ’unit’
• Typically pure JS, non UI / DOM
• verify set/get method of a Model
• verify date manipulation logic
• Many tools available
28. Functional Web testing
• UI testing of a component or an application
as a whole.
• Send commands to the web page and
evaluate result.
• ’click button’, ’type into login field’, ...
30. Interacting with the DOM
Approaches to faking user input
• Synthetic events (JavaScript)
• Native events (via Java Applet)
31. Synthetic events
+ Supported in all major browsers
+ Compatible with mobile
+ Don’t rely on native event queue
Tests can be run in parallell.
- Browsers don’t ”trust” synthetic events
- Enter key on a focused link
- Tab between input fields, etc...
- X-browser differences
DOM Events, Key events, key codes (http://unixpapa.com)
32. Native events
+ Java applets are supported in desktop
browsers
+ As close to a ’real’ user as possible
- Won’t work on iOS, Android.
- No parallell tests since native event queue
is used.
33.
34. What is Siesta?
• Unit testing and DOM testing tool
• Optimized for Ext JS & Sencha Touch
- also supports jQuery, NodeJS, or any JS
• Simple syntax, Extensible
• Automate using PhantomJS & Selenium.
36. Siesta Browser Harness
• A UI for Siesta, view DOM, inspect assertions
• Define a tree of tests, in logical groups
• Global settings for the test suite
autoCheckGlobals, preload, testClass
37. A Siesta Test
• is pure JavaScript, no magic.
StartTest(function(t) {
$('body').html('JQuery was here');
t.contentLike(document.body,
'JQuery was here',
'Found correct text in DOM');
});
38. A Siesta Test
• is completely isolated in its own iframe
(no teardown, cleanup required)
39. A Siesta Test
• can be extended with your own custom
assertions and helper methods
StartTest(function(myTest) {
var app = myTest.startApplication();
myTest.performLogin(app);
myTest.isLoggedIn(app, ’Logged in ok’);
myTest.is(app.nbrUsers, 1, ’Found 1 user’);
});
40. Lifecycle of a UI test
Setup create grid, load stores
Wait for store to load, grid rows to render
Simulate click button, type into textbox
Verify isEqual(a, b)
52. Some ground rules
• Keep your JavaScript in JS files
• Never put JavaScript in your HTML
page/tags
• Keep code organized in logical manageable
files. Decide on some max nbr of lines/file.
54. Testable MVC code
• Fat model, skinny view
• Don’t pollute your views with business logic
• Testing pure JS is a lot easier than testing
DOM-dependent JS
• Promotes reuse of your code
55. Mixing view and logic
Ext.define('UserForm', {
extend: 'Ext.FormPanel',
width: 400,
height: 400,
// Returns true if User is valid
isValid: function (userModel) {
return userModel.name.length > 4 &&
userModel.password.length > 8;
}
});
57. Refactored view
Ext.define('UserForm', {
extend: 'Ext.FormPanel',
width: 400,
height: 400,
// Returns true if User is valid
isValid: function () {
return this.model.isValid();
}
});
58. Avoid private code
• Avoid overuse of private functions in
closures
• If your code cannot be accessed it cannot
be tested
59. Testing Ajax
• Try to avoid involving your database.
• Use either static JS files with mock data
(async, slower)
• Or Mock the entire Ajax call (sync, faster)
Sinon.js, Jasmine-ajax etc.
61. Continuous Integration
• Once you have decided on your testing
toolset, integrate it with your CI.
• Automatically run test suite on pre-commit
or post-commit
• Nightly builds, full test suite execution,
reporting via email etc.