SlideShare a Scribd company logo
Build reliableSvelte
applications usingCypress
Maurice de Beijer
@mauricedb
1
 Maurice de Beijer
 The Problem Solver
 Microsoft MVP
 Freelance developer/instructor
 Twitter: @mauricedb
 Web: http://www.TheProblemSolver.nl
 E-mail: maurice.de.beijer@gmail.com
2
Cypress.io
Course
3
Topics
 What is Cypress.io?
 What is Svelte and SvelteKit?
 UsingTDD to building a SvelteKit application
 Testing pages
 API testing
 Running the Cypress tests in GitHub Actions
4
What isCypress and
why should you care?
5
Cypress.io
6
What is
Cypress?
 Cypress is a front end testing tool
 Built for the modern web
 Tests are easy to write
 Using simple JavaScript orTypeScript
 TimeTravel runner lets you inspect test at each step
 Click on a step to see the state of the browser
 Automatic waiting for elements
 Makes tests more resilient
 Video recording of running test
 Helps debugging failing tests on the CI server
7
What is
Cypress?
 Lets you fake the network when required
 Or use the real backend as appropriate
 Automatically retry of failing tests
 Run flaky tests multiple times
 Many standard and 3rd party extensions
 Or write your own in JavaScript
 Can run in Docker containers
 Consistent cross platform behavior
 Runs inside the browser
 Not based onW3C WebDriver API
8
Testing
Triangle
🗣
End 2 End
Integration
UnitTesting
9
UnitTesting
10
Why End to End?
The more your tests resemble the way your software
is used, the more confidence they can give you!
Kent C. Dodds
11
What isSvelte
andSvelteKit?
12
svelte.dev
13
Svelte
 A new approach to building user interfaces
 The most loved web framework according to Stack Overflow
 Svelte is a component framework
 Just like React,Vue or Angular
 A Svelte application is reactive
 Only the parts of the application that use reactive state are updated
 Compiles your components into JavaScript
 No Svelte runtime library
14
SvelteKit
15
SvelteKit
 SvelteKit is an application framework powered by Svelte
 Just like Next.js for React or Nuxt.js forVue
 Designed for building extremely high-performance web apps
 Server side rendering at runtime
 Prerendering at build time
 Prefetching pages
 File based routing
 HTTP API endpoints
 Error handling
 Sessions
 Very fast builds when developing
 UsingVite/ESBuild
16
npm init svelte
17
MovieCard.svelte
18
What we are
building
19
How we are
testing
20
Cypress
Dashboard
21
Cypress andTDD
22
Testing the
navigation
23
Testing anAPI
24
Intercepting an
AJAX request
25
GitHubAction
26
CypressTesting Library
27
28
Cypress
Testing
Library
 Test your UI components in a more user-centric way
 Users don’t use CSS queries
 Allows better queries within Cypress
 Queries are often bases on accessibility
 SvelteTesting Library is also usable with Jest
 Using the same query functions
29
Cypress
Testing
Library
30
Code/Slides
 http://theproblemsolver.nl/Presentations
 https://github.com/mauricedb/surati-tech-talk-2022
31
Conclusion
 Cypress is a great tool for End to End testing
 More reliable then relying on unit testing and manual testing
 Write tests that resemble your user’s actions
 Great approach forTest Driven Development
 Test that your API’s return the shape you expect
 A mismatch can lead to vague errors
32
Maurice de Beijer
@mauricedb
maurice.de.beijer
@gmail.com
33

More Related Content

PDF
Securing Containers From Day One | null Ahmedabad Meetup
PPTX
Deep Dive into AWS ECS and Spot Instances at Scale
PPTX
Cloudsolutionday 2016: Getting Started with Severless Architecture
PDF
Serverless Stream Processing with Bill Bejeck
PDF
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
PPT
Docker in the Cloud
PPTX
Sas 2015 event_driven
PPTX
ASP.NET vNext
Securing Containers From Day One | null Ahmedabad Meetup
Deep Dive into AWS ECS and Spot Instances at Scale
Cloudsolutionday 2016: Getting Started with Severless Architecture
Serverless Stream Processing with Bill Bejeck
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Docker in the Cloud
Sas 2015 event_driven
ASP.NET vNext

What's hot (15)

PPT
DevOpsCon Cloud Workshop
PPTX
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
PPTX
Serverless
PDF
Microservice With Spring Boot and Spring Cloud
PPTX
Meetup #3: Migrating an Oracle Application from on-premise to AWS
PPTX
MVC 6 - the new unified Web programming model
PPTX
WinOps Conf 2016 - Michael Greene - Release Pipelines
PPTX
Greetings from AWS User Group Taiwan
ODP
Developing Microservices using Spring - Beginner's Guide
PPTX
Meetup #3: Migrate a fast scale system to AWS
PDF
Intro to Serverless
PPTX
104 meets cloud
PPTX
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020
PPTX
Neil Peterson - Azure CLI Deep Dive
PPTX
AWS ECS workshop
DevOpsCon Cloud Workshop
Weaveworks at AWS re:Invent 2016: Operations Management with Amazon ECS
Serverless
Microservice With Spring Boot and Spring Cloud
Meetup #3: Migrating an Oracle Application from on-premise to AWS
MVC 6 - the new unified Web programming model
WinOps Conf 2016 - Michael Greene - Release Pipelines
Greetings from AWS User Group Taiwan
Developing Microservices using Spring - Beginner's Guide
Meetup #3: Migrate a fast scale system to AWS
Intro to Serverless
104 meets cloud
goployer, 코드 기반의 배포 도구 - 송주영 (beNX) :: AWS Community Day 2020
Neil Peterson - Azure CLI Deep Dive
AWS ECS workshop
Ad

Similar to Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress (20)

PPTX
Build reliable Svelte applications using Cypress
PPTX
Building reliable web applications using Cypress
PDF
Modern e2e-testing-for-complex-web-applications-with-cypressio
PDF
Testing Vue Apps with Cypress.io (STLJS Meetup April 2018)
PPTX
Introduction to Integration Testing With Cypress
PDF
Cypress Testing Demystified: A Practical Guide
PPTX
Introduction toTesting with Cypress (Tool)
PPTX
Cypress E2E Testing
PPTX
Progressive Web App Testing With Cypress.io
PPTX
Slides for Automation Testing or End to End testing
PPTX
End to end test automation with cypress
PDF
MoT Athens meets Thessaloniki Software Testing & QA meetup
PPTX
Cypress.pptx
PDF
Cypress vs Selenium Choosing the Best Tool for Your Automation Needs.pdf
PDF
Getting Started With Cypress
PDF
sveltekit-en.pdf
PDF
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
PDF
Boosting QA Efficiency: Benefits of Cypress for API Automation
PDF
Automated testing with Cypress
Build reliable Svelte applications using Cypress
Building reliable web applications using Cypress
Modern e2e-testing-for-complex-web-applications-with-cypressio
Testing Vue Apps with Cypress.io (STLJS Meetup April 2018)
Introduction to Integration Testing With Cypress
Cypress Testing Demystified: A Practical Guide
Introduction toTesting with Cypress (Tool)
Cypress E2E Testing
Progressive Web App Testing With Cypress.io
Slides for Automation Testing or End to End testing
End to end test automation with cypress
MoT Athens meets Thessaloniki Software Testing & QA meetup
Cypress.pptx
Cypress vs Selenium Choosing the Best Tool for Your Automation Needs.pdf
Getting Started With Cypress
sveltekit-en.pdf
Cypress vs Selenium WebDriver: Better, Or Just Different? -- by Gil Tayar
Boosting QA Efficiency: Benefits of Cypress for API Automation
Automated testing with Cypress
Ad

More from Maurice De Beijer [MVP] (20)

PPTX
Full-stack App in half a Day: Next.js 15 Development Bootcamp
PPTX
Production-ready Next.js App with Cursor AI
PPTX
Building Robust Web Applications with Test-Driven Development and Playwright:...
PDF
Mastering React Server Components and Server Actions in React 19
PPTX
Practice TypeScript Techniques Building React Server Components App
PPTX
A foolproof Way to Estimate a Software Project
PPTX
Building Reliable Applications Using React, .NET & Azure
PPTX
Concurrent Rendering Adventures in React 18
PPTX
Building reliable applications with React, C#, and Azure
PPTX
Building large and scalable mission critical applications with React
PPTX
Building Reliable Applications Using React, .NET & Azure
PPTX
Why I am hooked on the future of React
PPTX
Getting started with React Suspense and concurrent rendering
PPTX
React suspense, not just for Alfred Hitchcock
PPTX
From zero to hero with the Reactive extensions for JavaScript
PPTX
Why I am hooked on the future of React
PPTX
The new React
PPTX
From zero to hero with the reactive extensions for JavaScript
PPTX
Why I am hooked on the future of React
PPTX
I am hooked on React
Full-stack App in half a Day: Next.js 15 Development Bootcamp
Production-ready Next.js App with Cursor AI
Building Robust Web Applications with Test-Driven Development and Playwright:...
Mastering React Server Components and Server Actions in React 19
Practice TypeScript Techniques Building React Server Components App
A foolproof Way to Estimate a Software Project
Building Reliable Applications Using React, .NET & Azure
Concurrent Rendering Adventures in React 18
Building reliable applications with React, C#, and Azure
Building large and scalable mission critical applications with React
Building Reliable Applications Using React, .NET & Azure
Why I am hooked on the future of React
Getting started with React Suspense and concurrent rendering
React suspense, not just for Alfred Hitchcock
From zero to hero with the Reactive extensions for JavaScript
Why I am hooked on the future of React
The new React
From zero to hero with the reactive extensions for JavaScript
Why I am hooked on the future of React
I am hooked on React

Recently uploaded (20)

PDF
Become an Agentblazer Champion Challenge Kickoff
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
PDF
Build Multi-agent using Agent Development Kit
PPTX
AIRLINE PRICE API | FLIGHT API COST |
PDF
A REACT POMODORO TIMER WEB APPLICATION.pdf
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
System and Network Administraation Chapter 3
PPTX
Materi_Pemrograman_Komputer-Looping.pptx
PPTX
L1 - Introduction to python Backend.pptx
PPTX
Mastering-Cybersecurity-The-Crucial-Role-of-Antivirus-Support-Services.pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Introduction to Artificial Intelligence
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPT
Introduction Database Management System for Course Database
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PPTX
ai tools demonstartion for schools and inter college
PDF
System and Network Administration Chapter 2
PDF
The Role of Automation and AI in EHS Management for Data Centers.pdf
Become an Agentblazer Champion Challenge Kickoff
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
What to Capture When It Breaks: 16 Artifacts That Reveal Root Causes
Build Multi-agent using Agent Development Kit
AIRLINE PRICE API | FLIGHT API COST |
A REACT POMODORO TIMER WEB APPLICATION.pdf
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
System and Network Administraation Chapter 3
Materi_Pemrograman_Komputer-Looping.pptx
L1 - Introduction to python Backend.pptx
Mastering-Cybersecurity-The-Crucial-Role-of-Antivirus-Support-Services.pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
Introduction to Artificial Intelligence
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Introduction Database Management System for Course Database
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
ai tools demonstartion for schools and inter college
System and Network Administration Chapter 2
The Role of Automation and AI in EHS Management for Data Centers.pdf

Surati Tech Talks 2022 / Build reliable Svelte applications using Cypress