Resources for Learning Atomic Testing
Tags: javascript, webdev, beginners, programming
Published: 2022-05-05 15:11:20

We had an amazing turn out of engineers to my [Comprehensive Testing with JavaScript Workshop](https://t.co/fmgn6PHWWC) from Sauce Con! We accomplished a number of amazing outcomes. I'll talk about those below. However, a major question that came from this was how to create tests that are more atomic. I'm going to provide my best resources to answer this.

First and foremost, the net profits from the workshop will be used to buy [Trees that Empower Women from Ecosia](https://plant.ecosia.org/products/trees-that-empower-women?variant=41734794018990). By my back of the napkin estimations, we will be able to buy and plant at least 1,000 trees👏🌳 (I will provide final numbers after I have them). Beyond the great environmental impact, we're also providing jobs to women in countries like Kenya, Brazil, and India 👏 (I'm passionate about the environment and equality, so this is important).

Second, we learned a ton of really cool topics such as
✅ API testing w/ Cypress
✅ how to test a React web app using different types of tests
✅ E2E ui tests w/ Cypress
✅ visual cross-browser + cross-platform tests
✅ CICD with Github Actions 

Finally, a major question that came out of the workshop was how to deconstruct large UI tests into smaller atomic tests. This is a great and complicated topic. I'm going to provide my favorite resources to help you get some ideas.

## [1. Automated Atomic Tests Blog post](https://ultimateqa.com/automation-patterns-antipatterns/#Best_Practice_Tests_Should_Be_Atomic)
This is a blog post that I've worked on for years. It covers
- What is an atomic automated test? (w/ code examples)
- Case studies of atomic tests
- How to break up giant end-to-end UI tests?
- How to manipulate test data for UI automation?
- [How To Control App State Using JavaScript?](https://ultimateqa.com/automation-patterns-antipatterns/#How_To_Control_App_State_Using_JavaScript) (code and video included)
- [How To Coordinate API and UI Interactions In One Test?](https://ultimateqa.com/automation-patterns-antipatterns/#How_To_Coordinate_API_and_UI_Interactions_In_One_Test)
- [Coordinating API and UI interactions in one test by Titus Fortner](https://github.com/saucelabs-training/advanced-selenium/blob/saucecon_2022/src/test/java/com/saucelabs/advancedselenium/saucedemo/SauceDemoApp.java#L26-L44)

## [2. Automated Atomic Tests (Definitive Guide)](https://ultimateqa.com/automated-atomic-tests)
Since I get this question so often, I tried to create a single source for all the information related to automated atomic tests.
Some topics covered here include

- [Code for testing an HTML button](https://ultimateqa.com/automated-atomic-tests#Testing_an_HTML_button)
- [Testing for valid links](https://ultimateqa.com/automated-atomic-tests#Testing_for_valid_links_with_E2E_tests)
- [When is automated atomic testing inappropriate?](https://ultimateqa.com/automated-atomic-tests#When_is_automated_atomic_testing_inappropriate)

## 3. Building and testing a Github User Search Web App Youtube Tutorial

{% embed https://youtu.be/EvZ6pjgYA38?t=3088 %}

## 4. Software testing with java youtube tutorial
This is a Premiere that's coming up where I'll show you how to use Selenium + Java to bypass login authentication using Cookies and JavaScript injection for [this web app](https://www.saucedemo.com/)
{% embed https://youtu.be/HfuPX6x6MM8 %}

I'm not the only one talking about these topics. There are also a few great resources that are focused around programmatic authentication.

## [5. Auth0 Authentication](https://docs.cypress.io/guides/testing-strategies/auth0-authentication#What-you-ll-learn)

## [6. Amazon Cognito Authentication](https://docs.cypress.io/guides/testing-strategies/amazon-cognito-authentication)

## [7. Okta Authentication](https://docs.cypress.io/guides/testing-strategies/okta-authentication)

## [8. Google Authentication](https://docs.cypress.io/guides/testing-strategies/google-authentication)

Alright, I hope that this is enough resources to get you started 🤣 Atomic testing is a deep and complicated topic. I'm here for you if you got questions. 
Reach out to me here, [Twitter](https://twitter.com/Nikolay_A00), or [LinkedIn](https://www.linkedin.com/in/nikolayadvolodkin/)