Skip to content

johnorrsauce/web-testing-22

 
 

Repository files navigation

web testing with javascript workshop

#testing4good

In this workshop you will learn some of the latest tools and techniques to improve your ability to test modern web applications.

You will analyze risks and how to prevent those risks with e2e testing, component testing, and Github Actions.

Before we start, open this in a new tab and let the container load.

Try in Gitpod

🧠 You will learn

✅ how to test a React web app using different types of tests

✅ E2E ui tests w/ Cypress 10

✅ Visual testing w/ Cypress 10 and Happo.io

✅ Performance and accessibility testing

😉 And maybe more...

🔧 Prerequisites

  1. Experience JavaScript + Node.js

🔧Technologies you will use

  1. ReactJS
  2. Cypress 10
  3. Happo.io
  4. cypress-audit
  5. Gitpod

Table Of Contents

Testing for Good

#testing4good

🌎Testing for Good enables great test automation engineering while shaping a more equitable society.👩‍💻

Today, we're asking for donations for Environmental Working Group

We're advocates who won't quit. We're scientists that find solutions. We're people trying to make the safest choices for our health. At the Environmental Working Group, we believe that you should have easy access to the information you need to make smart, healthy choices. It’s this belief that inspired our president and co-founder, Ken Cook, to create EWG.

Since 1993, we've worked tirelessly to protect public health. Whether it's spotlighting harmful industry standards, speaking out against outdated government legislation or empowering consumers with breakthrough education and research, we're in this fight.

And we're not going anywhere.

👉 While the event is free, Sauce Labs encourages all attendees to

👉 donate

Anything helps!

100% of donations go to support the cause.

Key

💡 this is a tip

🏋️‍♀️ this is an exercise for you to do

❓ this is a question for us to think and talk about. Try not to scroll beyond this question before we discuss

Your Instructor: Nikolay Advolodkin

api-testing

TA 1

⚙️ Setup

The safest way to ensure that we all have the same environment is for us to use Gitpod for our workshop. However, if you are comfortable doing so, you are free to setup the environment on your machine as well.

Sign up for accounts

  1. Free Happo.io account
  2. Free Github account

Gitpod setup

ℹ️ Gitpod lets you run an entire Dev environment from a browser! You can use this approach if you don't know how to setup a local environment.

Fork the repo

  1. Sign up for a free Github account
  2. Fork this respository
  • Make sure you are logged into Github
  • click the Fork in the upper right of the Github.
  • Give the repo a ⭐ or you can't participate in the workshop😝
  1. Click here

Open in Gitpod

  1. Once the Gitpod.io URL is loaded, you will need to sign in with the GitHub account you created earlier

✅ A new tab open with a simple ReactJS application should open

ℹ️ Keep the app running, we will need it to run some sanity tests

Set your env variables

In a new terminal, run the following commands in that Terminal to set your HAPPO_API_KEY, HAPPO_API_SECRET:

Happo api keys

eval $(gp env -e HAPPO_API_KEY=<key>)
eval $(gp env -e HAPPO_API_SECRET=<secret>)

Once you have run those 3 commands, you can run the following commands to test your environment variables:

echo $HAPPO_API_KEY
echo $HAPPO_API_SECRET

✅ Your values should come back as expected

Run tests

Run sanity tests

If your tests run in US Datacenter

npm run test:sanity

✅👏Environment setup is complete if tests passed


Local setup

1. Install Node LTS

  1. Use NVM for this installation by following instructions
    • It should be just a single command to run in our terminal
      • !Don't forget to restart your terminal!
    • After installation, confirm install with nvm --version
  2. Intall Node 16 with nvm install --lts
  • Confirm node installation with node --version and seeing v16.x or similar
  • Confirm NVM is set to 16 for default by running the following commands:
nvm list #will show all versions
nvm use 16 #to use 16
nvm alias default 16.14.x #to set it to the default

2.Clone and fork the repo

  1. Sign up for a free Github account
  2. Fork this respository
  • Make sure you are logged into Github
  • click the Fork in the upper right of the Github.
  1. Clone your fork of the repository to your machine. Must have Git installed
git clone URL_OF_YOUR_FORK

✅👏Congratulations, your local environment is ready!

Prizes

Prizes will be given away for participation (tshirts, stickers...)

At the end, one lucky winner will get a backpack!

Rules of engagement

api-testing

  • I'm here to serve you, your education, and your experience
  • Be kind, respectful, no judgment
  • Have fun

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 70.6%
  • HTML 19.1%
  • CSS 10.3%