Synthetic Monitoring and e2e Testing: 2 Sides of the Same Coin

Rate this content
Bookmark

Despite the emergency of DevOp to unite development, support and SRE factions together using common processes, we still face cultural and tooling challenges that create the Dev and Ops silos. Specifically, we often use different tools to achieve similar testing: case in point validating the user experience in production using Synthetic Monitoring and in development using e2e testing. By joining forces around common tooling, we can use the same tool for both production monitoring and testing within CI. In this talk, I will discuss how Synthetic Monitoring and e2e Testing are two sides of the same coin. Furthermore, I shall show how production monitoring and development testing can be achieved using Playwright, GitHub Actions and Elastic Synthetics.

This talk has been presented at TestJS Summit 2023, check out the latest edition of this Tech Conference.

FAQ

Carly Richmond's talk at TestJS Summit focuses on end-to-end testing and synthetic monitoring, highlighting how these elements are two sides of the same coin.

Shifting left refers to the practice of detecting and fixing defects earlier in the software development lifecycle. This approach aims to improve quality and reduce costs by addressing issues before they reach production.

End-to-end testing and synthetic monitoring can be integrated by using the same scripts for both purposes. Carly Richmond demonstrates this by combining an end-to-end testing framework with GitHub Actions for CI and monitoring using Elastic Synthetics.

Empathy is important in DevOps because it fosters better collaboration and understanding between different roles such as developers, testers, and production management. Lack of empathy can lead to conflicts and inefficiencies in the workflow.

Synthetic monitoring involves running scripts against an application on a regular schedule to validate that it is up and responsive. This can range from simple pings to complex simulations of user interactions.

Carly Richmond uses Playwright for end-to-end testing, GitHub Actions for CI, and Elastic Synthetics for monitoring in her example.

Using a common toolset in DevOps allows different teams (developers, testers, SREs) to collaborate more effectively by sharing and maintaining the same scripts and configurations, leading to more reliable and maintainable systems.

The Elastic Synthetics recorder allows users to record their interactions with an application in a Chromium browser. These recordings can then be converted into test scripts, making it easier to recreate and diagnose user-reported issues.

Carly Richmond suggests that irrespective of the specific tools used, the most important aspect is to talk to each other and align on a common toolset that everyone can use for both testing and monitoring.

Playwright allows for detailed user interaction simulations, separation of styling from logic through data test IDs, and integration with CI tools like GitHub Actions, making it a versatile and powerful tool for end-to-end testing.

Carly Richmond
Carly Richmond
19 min
11 Dec, 2023

Comments

Sign in or register to post your comment.

Video Summary and Transcription

Carly Richmond discusses the importance of shifting left in testing and monitoring. She emphasizes the need for empathy and a common toolset in the software development process. The talk explores the use of end-to-end testing and synthetic monitoring, showcasing an example with Playwrights, GitHub Actions, and Elastic Synthetics. It also covers the configuration, setup, and integration of tests in the CI workflow. The talk concludes with the benefits of monitoring application and test state, and the importance of collaboration in issue recreation.

1. Introduction to Testing and Monitoring

Short description:

Hi, TestJS Summit. My name is Carly Richmond. I am a senior developer advocate at Elastic. Today, I'll talk about end-to-end testing and synthetic monitoring, showcasing an example of combining an end-to-end testing framework with GitHub actions for CI and monitoring using Elastic Synthetics.

Hi, TestJS Summit. It is so great to see you all. My name is Carly Richmond. I am a senior developer advocate at Elastic. And I'm here today to talk about testing, which you probably expected from a testing conference, let's be honest. But did you expect me to talk about monitoring as well? Potentially not. So today I'm going to leverage my prior experience as a software engineer to talk about end-to-end testing and synthetic monitoring. I'll talk about despite our thoughts, actually, these elements are two sides of the same coin. And also I'll showcase an example where we take an end-to-end testing framework, in this case and combine it with GitHub actions for CI and then monitoring using Elastic Synthetics to show how we can use the same scripts for both end-to-end testing and synthetic monitoring.

2. Understanding the Challenges

Short description:

But before all of that, we need to talk about the notion of shifting left because that's imperative to understanding this argument. My experience with that was really my early idea about why DevOps makes sense, because we were working together. We've got to talk about why this is. The first reason is empathy. We are not great at empathizing with the other sides within this equation. The other thing is a lack of common priority. And the last problem that I saw was quite often our tool sets are so disparate that it's very difficult to figure out if there's any common ground between us. And synthetic monitoring in end to end testing is the prime example of that.

But before all of that, we need to talk about the notion of shifting left because that's imperative to understanding this argument. So for me, shifting left was something that actually made perfect sense. Tried to pick up defects earlier in the cycle. And also it made sense to me because actually, I'll let you in on a little secret, I used to be more than just an engineer. My first ever role as a software engineer, I also had to do everything else. I had to do production management, I had to deal with user issues, and given it was a regulatory system, there was always a rather quick turnaround required for those ones. And we also dealt with deployment, testing, and coordinating user testing. We did everything on that application because of the size of the team and the expertise that we had.

And it was only really when we started to try and hand over some of the support responsibilities to a dedicated production management team that I actually realised that these activities are more commonly done by different groups. But my experience with that was really my early idea about why DevOps makes sense, because we were working together. They set up the ticketing system, for example. I worked with them to document all the knowledge, get it out of my head, so that people could react to issues and try and help users where they could. And then if they tried to fix an issue and it didn't quite work out, they would call me in to help and we would update the knowledge article with the additional information. But I also got to learn from them as well because we talked about testing, we talked about how we could make the application easier to monitor. All these things that really as a developer you don't get a lot of exposure to and I was really fortunate for that. And I thought it was normal until I moved to my first web dev role and realized that that's actually a very rare experience. And even speaking to devops engineers and SREs now, I see that actually the relationship even despite the emergence of devops is more akin to a game of rock. And we've got to talk about why this is.

The first reason is empathy. We are not great at empathizing with the other sides within this equation. Developers are not empathizing well and collaborating with testers who they feel might be throwing features back at them that they thought were perfect. Production management are receiving regular new features that are built in small increments that mean they are overloaded often with features that they don't know much about. And everyone is just really feeling like the other side doesn't really get what their role is and what they are trying to do. The other thing is a lack of common priority. This sign here on the seat we all pretty much know what this means. It's very clear who this seat is intended for. But if we think about backlog prioritization within the recent agile world it's not always as clear cut as that and my experience of working with product owners was often that new features were regularly prioritized over small toil enhancements, additions such as enhanced monitoring capabilities and even sometimes minor bug fixes were all put towards the bottom of the backlog in comparison to new features that they could understand. And the last problem that I saw was quite often our tool sets are so disparate that it's very difficult to figure out if there's any common ground between us. And synthetic monitoring in end to end testing is the prime example of that. So test for anyone who's not familiar are basically tests that allow you to test and validate the user experience.

Check out more articles and videos

We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career

Testing Web Applications with Playwright
TestJS Summit 2022TestJS Summit 2022
20 min
Testing Web Applications with Playwright
Top Content
Testing web applications with Playwright, a reliable end-to-end testing tool. Playwright offers fast execution, powerful tooling, and support for multiple languages. It provides precise selectors, web-first assertions, and code generation for easy testing. Playwright also offers features like live debugging, tracing, and running tests on CI. The future of Playwright aims to make testing easy and fun, with a focus on creating frustration-free web experiences.
Full-Circle Testing With Cypress
TestJS Summit 2022TestJS Summit 2022
27 min
Full-Circle Testing With Cypress
Top Content
Cypress is a powerful tool for end-to-end testing and API testing. It provides instant feedback on test errors and allows tests to be run inside the browser. Cypress enables testing at both the application and network layers, making it easier to reach different edge cases. With features like AppActions and component testing, Cypress allows for comprehensive testing of individual components and the entire application. Join the workshops to learn more about full circle testing with Cypress.
Automating All the Code & Testing Things with GitHub Actions
React Advanced Conference 2021React Advanced Conference 2021
19 min
Automating All the Code & Testing Things with GitHub Actions
Top Content
We will learn how to automate code and testing with GitHub Actions, including linting, formatting, testing, and deployments. Automating deployments with scripts and Git hooks can help avoid mistakes. Popular CI-CD frameworks like Jenkins offer powerful orchestration but can be challenging to work with. GitHub Actions are flexible and approachable, allowing for environment setup, testing, deployment, and custom actions. A custom AppleTools Eyes GitHub action simplifies visual testing. Other examples include automating content reminders for sharing old content and tutorials.
Everyone Can Easily Write Tests
TestJS Summit 2023TestJS Summit 2023
21 min
Everyone Can Easily Write Tests
Playwright is a reliable end-to-end testing tool for modern web apps that provides one API, full isolation, fast execution, and supports multiple languages. It offers features like auto-weighting, retrying assertions, seamless testing of iframes and shadow DOM, test isolation, parallelism, and scalability. Playwright provides tools like VS Code extension, UiMode, and Trace Viewer for writing, debugging, and running tests. Effective tests prioritize user-facing attributes, use playwright locators and assertions, and avoid testing third-party dependencies. Playwright simplifies testing by generating tests, providing code generation and UI mode, and allows for easy running and debugging of tests. It helps in fixing failed tests and analyzing DOM changes, fixing locator mismatches, and scaling tests. Playwright is open source, free, and continuously growing.
Tiny Tests, Large Results
TestJS Summit 2022TestJS Summit 2022
21 min
Tiny Tests, Large Results
Automated atomic tests are a great way to improve UI tests by making them less brittle and faster. The tests focus on testing a single feature or component and have minimal UI interactions. The Talk explores examples of automated atomic tests and their implementation on web applications. It also discusses the analysis of atomic tests, login tests, and working with JSON Web Tokens for authentication and authorization. The Talk concludes by highlighting the use of UI and web requests in automated atomic testing.
We May Not Need Component Testing
Vue.js Live 2024Vue.js Live 2024
26 min
We May Not Need Component Testing
Component testing is a gray area between integration and unit testing. The demo app focuses on the cart component and writing test cases for Playwright component test and VTest. The first cart test encounters a bug with the invisible method in View Test.

Workshops on related topic

Detox 101: How to write stable end-to-end tests for your React Native application
React Summit 2022React Summit 2022
117 min
Detox 101: How to write stable end-to-end tests for your React Native application
Top Content
WorkshopFree
Yevheniia Hlovatska
Yevheniia Hlovatska
Compared to unit testing, end-to-end testing aims to interact with your application just like a real user. And as we all know it can be pretty challenging. Especially when we talk about Mobile applications.
Tests rely on many conditions and are considered to be slow and flaky. On the other hand - end-to-end tests can give the greatest confidence that your app is working. And if done right - can become an amazing tool for boosting developer velocity.
Detox is a gray-box end-to-end testing framework for mobile apps. Developed by Wix to solve the problem of slowness and flakiness and used by React Native itself as its E2E testing tool.
Join me on this workshop to learn how to make your mobile end-to-end tests with Detox rock.
Prerequisites- iOS/Android: MacOS Catalina or newer- Android only: Linux- Install before the workshop
Testing Web Applications Using Cypress
TestJS Summit - January, 2021TestJS Summit - January, 2021
173 min
Testing Web Applications Using Cypress
WorkshopFree
Gleb Bahmutov
Gleb Bahmutov
This workshop will teach you the basics of writing useful end-to-end tests using Cypress Test Runner.
We will cover writing tests, covering every application feature, structuring tests, intercepting network requests, and setting up the backend data.
Anyone who knows JavaScript programming language and has NPM installed would be able to follow along.
Building out a meaningful test suite that's not all E2E
TestJS Summit 2023TestJS Summit 2023
89 min
Building out a meaningful test suite that's not all E2E
Workshop
David Burns
David Burns
We're all taught to follow the Testing Pyramid but the reality is that we build out the Testing Christmas Tree. In this workshop, David will talk you through how to break down projects and put the tests where they need to be. By the end of the workshop you will be able to update your projects so that anyone and everyone can start contributing and truly living up to "Quality is everyone job".
He will walk you through:- Component Testing- API Testing- Visual Regression Testing- A11Y testing
He will also talk you through how to get these all setup in your CI/CD pipeline so that you can get shorter and faster feedback loops.
Powering your CI/CD with GitHub Actions
DevOps.js Conf 2022DevOps.js Conf 2022
155 min
Powering your CI/CD with GitHub Actions
Workshop
David Rubio Vidal
David Rubio Vidal
You will get knowledge about GitHub Actions concepts, like:- The concept of repository secrets.- How to group steps in jobs with a given purpose.- Jobs dependencies and order of execution: running jobs in sequence and in parallel, and the concept of matrix.- How to split logic of Git events into different workflow files (on branch push, on master/main push, on tag, on deploy).- To respect the concept of DRY (Don't Repeat Yourself), we will also explore the use of common actions, both within the same repo and from an external repo.
Automate WebApp Security Testing using GitHub Actions (from StackHawk team)
TestJS Summit 2022TestJS Summit 2022
87 min
Automate WebApp Security Testing using GitHub Actions (from StackHawk team)
WorkshopFree
Zachary Conger
Zachary Conger
Software development has changed - Frequent deployments, APIs, GraphQL, Cloud Architecture and CI/CD Automation are the norm. So why is security testing the same way it was a decade ago?
Leading teams are realizing that periodical penetration testing and security audits is not enough when code is being shipped daily. Instead, these teams are using developer-centric tools to run automated security testing in a CI/CD pipeline. Join Zachary Conger as he walks through how to automate application JS security testing using GitHub actions.
JS Security Testing in GitHub Actions
JSNation 2022JSNation 2022
101 min
JS Security Testing in GitHub Actions
WorkshopFree
Zachary Conger
Zachary Conger
This workshop will focus on automating software composition analysis, static application security testing and dynamic application security testing using GitHub Actions. After a brief introduction covering the different types of application security and the importance of finding security vulnerabilities before they hit production, we'll dive into a hands-on session where users will add three different security testing tool to their build pipelines.