Gleb Bahmutov PRO
JavaScript ninja, image processing expert, software quality fanatic
I want to show you the secret weapon I have used for the past year. The GitHub Copilot lets me write full tests quickly, fills the gaps in my knowledge of 3rd party tools, and even writes clear descriptive commit messages. But it is not a "press the button to do it all". You need to guide the AI to do the right thing, which takes experience, but most importantly, you need to decide _what_ you want the AI to do, step by step. Remember: AI is not going to replace you any time soon. But someone more productive with AI's help might get ahead. Let's learn Copilot for real-world test writing. It might change how you work. If you master it, Copilot becomes your super weapon. It is like playing Super Mario - in some games, you can dash quickly by pressing the "Y" button, but you need to be pointing in the right direction first. Presented at MaineJS 2024 video at https://www.youtube.com/watch?v=rTIwu8V2ujg
Unit testing is simple, yet it only checks small pieces of code. End-to-end testing of real web applications can potentially find a lot more problems across the entire stack. Yet E2E tests are delegated to the very tip of the testing pyramid - because the tools for controlling a large application inside a real browser are brittle, and the development experience is a mixed bag. But now we have new great tools for reliable browser automation: Cypress.io and Playwright. Both tools allow quickly writing hundreds of end-to-end, component, and even API tests. Now we have a problem: how do we run all these tests quickly when we work locally or on CI? In this presentation, Gleb will explain how to speed up Cypress test execution locally and on CI using free open-source solutions that do not require paying for 3rd party dashboards or services. We will explore using API calls, data caching, and app actions to speed up each test. We also will see how to configure CI specs to split the entire test suite into multiple machines running in parallel. This presentation will benefit anyone who wants their end-to-end and component Cypress tests to finish quickly.
JavaScript is an interesting language. It can mimic almost any style you want: procedural, object-oriented, functional, etc. In this presentation, I will take a simple problem and will solve it using different approaches. With each step, we will see the power of each approach to take the complexity away, while still being the JavaScript we all love to hate. Presented at iJS May 2024, 30 minutes
I want to show you the secret weapon I have been using for the past year. The GitHub Copilot lets me write full tests quickly, fills the gaps in my knowledge of 3rd party tools, and even writes clear descriptive commit messages. But it is not a "press the button to do it all". You need to guide the AI to do the right thing, which takes experience, but most importantly, you need to decide _what_ you want the AI to do, step by step. Remember: AI is not going to replace you any time soon. But someone being a lot more productive with AI's help might get ahead. Let's learn Copilot for real-world test writing. It might change how you work. If you master it, Copilot becomes your super weapon. It is like playing Super Mario - in some games, you can dash quickly by pressing the "Y" button, but you need to be pointing in the right direction first. Presented at iJS 2024, 30 minutes
In this presentation, Gleb will explain how to speed up Cypress test execution locally and on CI using free open-source solutions that do not require paying for 3rd party dashboards or services. We will explore using API calls, data caching, and app actions to speed up each test. We also will see how to configure CI specs to split the entire test suite into multiple machines running in parallel. This presentation will benefit anyone who wants their end-to-end and component Cypress tests to finish quickly. Video at https://youtu.be/1idlr9IE0oU
In this presentation, Gleb will explain how to speed up Cypress test execution locally and on CI using free open-source solutions that do not require paying for 3rd party dashboards or services. We will explore using API calls, data caching, and app actions to speed up each test. We also will see how to configure CI specs to split the entire test suite into multiple machines running in parallel. This presentation will benefit anyone who wants their end-to-end and component Cypress tests to finish quickly. Boston Code Camp 30 minutes
Script injection attacks can load the attacker's code and run it on your website when other users browse it. You can prevent such attacks using content security policies, but how do you ensure your defense mechanisms actually work? By testing them! In this talk, I explain the content-security-policy, the security violation reporting, and how we can write a Cypress test to verify the attacks are stopped. Boston Code Camp 30 minutes
In this presentation, Gleb will explain how to speed up Cypress test execution locally and on CI using free open-source solutions that do not require paying for 3rd party dashboards or services. We will explore using API calls, data caching, and app actions to speed up each test. We also will see how to configure CI specs to split the entire test suite into multiple machines running in parallel. This presentation will benefit anyone who wants their end-to-end and component Cypress tests to finish quickly. Video at https://youtu.be/1idlr9IE0oU
In this presentation, I will show how the two most popular modern web application testing tools, Cypress and Playwright, approach the same problem in very different ways. We will see how to write end-to-end, API, and component tests using both tools and how to execute them on a continuous integration system. While other comparisons often focus on finding a single winner, I would like to list the main advantages of each tool to help you make an informed decision depending on your use case. Presented at iJS Sept 2023 in NYC, 30 minutes.
Writing continuous integration YML scripts is a cumbersome and awkward process. What if there was a better way? GitHub Actions let you write JavaScript code to build, test, and deploy your applications. Even better, you don't have to write actions yourself. You can reuse actions written by others. Plus, integration with the GitHub repo security lets your CI code easily contribute back to the repository or trigger other steps. Presented at DevOpsCon NYC September 2023, 30 minutes
Script injection attacks can load the attacker's code and run it on your website when other users browse it. You can prevent such attacks using content security policies, but how do you ensure your defense mechanisms actually work? By testing them! In this talk, I explain the content-security-policy, the security violation reporting, and how we can write a Cypress test to verify the attacks are stopped.
We are truly living in the golden age of web testing tools. Node.js got its own built-in test runner, web developers got Cypress and Playwright, and everyone got new debugging tools like Replay.io that replay the entire browser session statement by statement. In this talk, I will show how to take advantage of these new testing and debugging tools. Shown at RefactorDX 2023, watch at https://youtu.be/b87e7k3RjOg
You can supercharge your end-to-end, component, and API Cypress tests using plugins. In this talk, I will show my favorite Cypress plugins, explain how they work, and how easy it is to write simple, elegant testing code. From accessing databases, receiving emails, and setting up data, to repeating commands and checking the page's accessibility - there is a Cypress plugin for everything!
Jest, Mocha, Ava, and other Node test runners long dominated the unit testing. Now Node.js has released its own experimental unit testing framework. Learn how it compares to other test runners, which interesting features it provides, and if you should rewrite your tests to switch to the built-in "test" module.
Jest, Mocha, Ava, and other Node test runners long dominated the unit testing. Now Node.js has released its own experimental unit testing framework. Learn how it compares to other test runners, which interesting features it provides, and if you should rewrite your tests to switch to the built-in "test" module. Shown at NERDSummit March 2023. You can read the blog post version of this presentation at https://glebbahmutov.com/blog/trying-node-test-runner/
When developers see Cypress component testing, their eyes light up. You see the component running right in your browser, you have all your debugging tools, and you can gain full confidence in how the component is working. In this talk, I will show how component tests can verify that a React Sudoku application is implemented correctly. The same testing approach can also work for Angular, Vue, and Svelte component testing.
Today JavaScript developers are enjoying a cornucopia of testing tools. In this presentation, I will look at the existing Node testing tools Jest, Ava, Mocha, and the new player on the block: the built-in Node.js test runner module. We will also consider the component and end-to-end browser testing using Playwright and Cypress.io. Everyone who writes JavaScript for a living will benefit from knowing the features of these modern testing tools.
Jest, Mocha, Ava, and other Node test runners long dominated the unit testing. Now Node.js has released its own experimental unit testing framework. Learn how it compares to other test runners, which interesting features it provides, and if you should rewrite your tests to switch to the built-in "test" module. 45 minutes, presented at ConFoo in Montreal, Canada
This session will discuss the two most popular modern web application testing tools in Cypress and Playwright. The two approach the same problems in very different ways — learn how to write end-to-end, API, and component tests using both. You'll come away understanding how to execute them on a continuous integration system. While similar comparisons of Cypress and Playwright focus on finding a winner, this session will go in-depth on the advantages of each tool to help you make an informed decision depending on your use case. Watch the video at https://youtu.be/lT9eif7YqUs
Writing continuous integration YML scripts is a cumbersome and awkward process. What if there was a better way? GitHub Actions let you write JavaScript code to build, test, and deploy your applications. Even better, you don't have to write actions yourself but reuse the actions written by others. Plus the integration with the GitHub repo security lets your CI code easily contribute back to the repository or trigger other steps.
In this talk, I will share my tips and tricks for writing frontend tests that clearly communicate the software's intent. We will look at both the end-to-end and component tests and the fuzzy boundary between those two types of tests. We will look at tricks to ensure the tests do not spuriously flake when running on the CI system. Finally, I will show my trick for making the tests useful to more people outside the QA team; if you believe like I do that the tests are a working description of the current state of the web application, then any discussion and change to that system must take the tests into the account. Watch at https://youtu.be/3Es17_P7DV8
Writing tests for your components (be it Angular, React, Vue, or Svelte components) is often a horror show. Your code in (js-dom) darkness, there are dangers behind each action, and the most beautiful tests get banged up beyond recognition when they try to cross into the CI realm. In this talk, I will show how Cypress component testing becomes a ray of hope guiding you toward testing nirvana. These tests remove most framework-specific test code while focusing on how the component behaves on the page. I will use examples from different frameworks to teach everyone how to test the modern front-end code without fear or pain.
Recently Cypress Test Runner has released v10 which adds full component testing support. Now you might have a question: when should I write an end-to-end test and when should I use a component test? If a component test runs as a "mini" web application, is it really a limited E2E test? In this talk, I will give my take on drawing the line between the types of tests to write to most effectively confirm the code is doing what it is supposed to do. Presented at QA Global Summit 2022, video at https://youtu.be/jJCDSSVyA9g
We run a LOT of end-to-end web tests at our company, and making sure the tests are quick and useful is a challenge. In this talk, I describe our approach to running the tests on each pull request, adding new tests, and running tests targeted at each feature area. If you want to see how running 500-600 end-to-end tests works day-to-day, this talk is for you.
A new online game Wordle has become very popular recently. In the game, you enter five letter words until you match the secret word. The game responds by giving you clues about each letter you have entered. How would you test this online game using an end-to-end test runner like Cypress? Could you solve it using a test? In this presentation, I will show how we can test the game using Cypress most powerful features. Presented at DevReach Boston Sept 2022, watch at https://www.youtube.com/watch?v=CwHciuR5udo
I will walk through the history of HTTP, its original design goals, and how they shape the modern Internet. We will look at the current standard, and what is coming tomorrow. Finally, I will answer the question on every web developer's mind: is it better to bundle the JavaScript files, or can HTTP efficiently serve thousands of small source files?
In this talk, Gleb Bahmutov shows how his team at MercariUS is running 500+ end-to-end front-end tests to provide developers with quick quality feedback. The keys to fast test execution are parallelization and running the changed and potentially broken tests first, something modern CIs can do with a little bit of elbow grease. From the overall flow to the individual tests, the presentation shows Gleb's tips & tricks for solid reliable end-to-end testing at scale. Watch the video at https://applitools.com/event/slice-and-dice-your-end-to-end-tests/
I will walk through the history of HTTP, its original design goals, and how they shape the modern Internet. We will look at the current standard, and what is coming tomorrow. Finally, I will answer the question on every web developer's mind: is it better to bundle the JavaScript files, or can HTTP efficiently serve thousands of small source files? Presented at CityJS Athens Greece 2022
A new online game Wordle has become very popular recently. In the game, you enter five letter words until you match the secret word. The game responds by giving you clues about each letter you have entered. How would you test this online game using an end-to-end test runner like Cypress? Could you solve it using a test? In this presentation, I will show how we can test the game using Cypress's most powerful features: access to the browser APIs, spying on the network calls, controlling the application clock. Watch at https://youtu.be/4nOI6yGalDA?t=2178
Gleb will introduce you to a very powerful way of creating and re-using data in your Cypress.io end-to-end tests. By re-using objects like users, projects, etc. that are typically very resource-intensive to create, you will make your tests much more efficient, faster, easier to read, and simpler to maintain. The key takeaways from this talk are: - How to measure and understand where your end-to-end tests spend the majority of their time. - How to make parts of the test faster by skipping the user interface and driving the application directly through its HTTP API - How to control the state of the application by resetting it before each spec file and before each individual test - How to make the application tests faster by caching and reusing test data, while keeping the tests independent from each other - The trade-offs between shared backend database vs individual databases for each test agent running in its own container on CI
Visual testing is extremely effective at confirming the application works and looks the way it did previously, and that the new commits have not accidentally broken it. In this presentation, I will show how to do visual testing using the Cypress test runner, both at the end-to-end and at the individual component levels. We will also consider the trade-offs of doing image diffing ourselves vs paying for a 3rd party service. Presented at ConFoo CA 2022
Many organizations struggle with building a reliable set of automated tests for their web applications. Yet a set of manual test plans is not an answer; testing without automation is slow, gives low confidence, and the test results provide little actionable feedback to the developers. In this presentation, I describe how a large company has built a comprehensive automated set of end-to-end test suites after two previous failed attempts. Presented at ConFoo CA 2022
This talk will introduce you to a very powerful way of creating and re-using data in your Cypress.io end-to-end tests. By re-using the expensive to create objects like users, projects, etc. you will make your tests much much faster, easier to read, and simpler to maintain. Presented at QA Global Summit'22
Many organizations struggle with building a reliable set of automated tests for their React web applications. Yet a set of manual test plans is not an answer; testing without automation is slow, gives low confidence in the software, and the test results provide little actionable feedback to the developers. Should we just write unit and component tests using Jest? You must be joking - these tests are definitely not enough to ensure the app works. In this presentation, I describe how a large company has built a comprehensive automated set of end-to-end and component test suites after two previous unsuccessful attempts. I will show how to build trust between the QA engineers and front-end developers, how to convince other stakeholders that investing time in testing is important, and how to balance the different types of tests: e2e, component, unit, and API to cover both the happy paths and the edge cases. Presented at React-Next 2021. Video at https://www.youtube.com/watch?v=VlmXhJIIOUo
Do you like writing End-to-End tests using Cypress? What if I told you that you can unlock the full power of Cypress by ... writing JavaScript code to extend the built-in Test Runner features? Be able to add more testing features, write shorter tests, have more power at your disposal? Most people only scratch the surface of the web application tests, but if you learn how to use the existing plugins (and there are lots of them!) and write your own can take your tests to the next level.
In the pursuit of building rock-solid end-to-end testing suites, there are many variables that need to be decided in order to maintain a consistent testing environment. If left undefined, these variables can lead to endless wasted cycles spent on the effects, rather than simply eliminating the root cause. Presented at EnterpriseNG Dec 2021, video at https://www.youtube.com/watch?v=_7SJ_sMAols
Many organizations struggle with building a reliable set of automated tests for their web applications. Yet a set of manual test plans is not an answer; testing without automation is slow, gives low confidence in the software, and the test results provide little actionable feedback to the developers. In this presentation, I describe how a large company has built a comprehensive automated set of end-to-end test suites after two previous unsuccessful attempts. I will show how to build trust between the QA engineers and front-end developers, how to convince other stakeholders that investing time in testing is important, and how to balance the different types of tests to cover both the happy paths and the edge cases.
The testing pyramid - the canonical shape of tests that defined what types of tests we need to write to make sure the app works - is ... obsolete. In this presentation, Roman Sandler and Gleb Bahmutov argue what the testing shape works better for today's web applications. Presented at TestJSSummit 2021, video at https://portal.gitnation.org/contents/testing-pyramid-makes-little-sense-what-we-can-use-instead
This presentation describes my personal journey to "power" blogging. Every time I solve a problem, I describe the solution in a blog post to remind myself the next time I need it how I have done this. Then I describe how I use the Algolia search index to find the blog posts, and how I now scrape the blog posts, the presentation slides, and the YouTube videos too. Presented at Hashnode Open-Source 2021
Every time a new user registers for your service, your application probably sends a confirmation email.How does that email look in the user's browser? How does it look on a mobile screen? And most importantly: does it work? In this presentation, I will show the full end-to-end open-source testing procedure for validating HTML emails. We will test the email functionality, accessibility, and visual look and style to ensure that our users are not silently dropping out due to a broken email subsystem. Presented at InfobipShift 2021, video at https://youtu.be/igj8OQhY0Jg
My unpopular opinion is that testing is ... important. How do you test your React Native apps? In this presentation, I will show how to run full integrations tests using Cypress while the RN app is running in the browser. This method can cover most of the application's code and be effective at finding logical errors and mistakes when calling the server APIs. Presented at ReactFinland 2021. Find the video at https://www.youtube.com/watch?v=PIxaFbMBez0
A test deck for practicing scraping slides.
The testing pyramid - the canonical shape of tests that defined what types of tests we need to write to make sure the app works - is ... obsolete. In this presentation, Roman Sandler and Gleb Bahmutov argue what the testing shape works better for today's web applications. Presented at Mercari Dev meetup.
In this presentation, I will show how to write realistic end-to-end Cypress tests for a real-time chat web application implemented using WebSockets. We will see how the test runner can act as a second chat user, and how to truly control two test runners to "talk" to each other during the test. Everyone learning to write tests for the modern web can benefit from this presentation. Presented at QA Global Summit V2
Everyone’s talking about Cypress. But they don’t know what they don’t know… Get the inside scoop on Cypress from Distinguished Engineer Gleb Bahmutov. He’ll be joined by Eran Kinsbruner, DevOps Chief Evangelist at Perforce. Together, they’ll dive into how dev teams are testing, learning, and optimizing with one of the fastest-growing front-end automation frameworks. You’ll Learn: - Most advanced features for automating with Cypress. - Best practices for scaling & optimizing with Cypress. - When and how to use Cypress with commercial tools. - What to expect on the roadmap for Cypress.
This presentation discusses how Angular developers can take advantage of Cypress Test Runner to write simple and powerful end-to-end tests. We will look at the custom commands, page objects, using fixtures and mocks, dynamic waits, and migrating from Protractor to Cypress.
Introduction to Cypress. This 1-hour presentation gives an introduction to the Cypress Test Runner, its architecture, and the problems it is solving. We will cover end-to-end testing, accessing the application’s internal state, component testing, API testing, visual testing, and collecting code coverage from tests. We will also look at network stubbing and the trade-offs between the full stubbing and spying on the network traffic. The presentation will be followed by questions and answers. Video at https://commited.tech/events/session-introduction-to-cypress/
Visual testing is extremely effective at confirming the application works and looks the way it did previously, and that the new commits have not accidentally broken it. In this presentation, I will show how to do visual testing using Cypress test runner, both at the end-to-end and at the individual component levels. We will also consider the trade-offs of doing image diffing ourselves vs paying for a 3rd party service. Video available at https://youtu.be/KX6Xb5oIaH0
In this presentation, Gleb will show how every commit and every pull request can run the full set of realistic end-to-end tests, ensuring the web application is going to work for the user. He will look at the modern CI setup, benefits of clean data environments, and parallelization speed-ups. Anyone looking to learn how awesome the modern automated testing pipeline can be would benefit from this presentation. Presented at BrightTALK 2021
Keeping the documentation up-to-date with the web application is hard. The screenshots and the videos showing the user how to perform some task quickly fall out of sync with the latest design and logic changes. In this presentation, I will show how to use end-to-end tests to generate the documentation. By keeping the tests in sync with the application, and by running them on every commit, we will update the documentation, ensuring our users never get confused by the obsolete docs. Presented at TestingStage 2021, video at https://youtu.be/H9VqsTZ9NME