DEV Community

abigail armijo
abigail armijo

Posted on

Practice Real-World Testing Scenarios for QA: Challenge 1 - Login with Different Users

Welcome to Abi's testing dojo challenges.

A cinematic 3D illustration for 'Abi's Testing Dojo' featuring a female 'QA Ninja' in a futuristic martial arts hall, interacting with holographic screens showing code, dashboard charts, and automated test results.

I am thrilled to finally launch this series of testing challenges designed to help you learn and practice testing with real-world scenarios.

As QA professionals, we know that nothing replaces the experience of tackling real scenarios on actual applications. That's why I've built a website to serve as your training ground for API Testing, E2E Automation, performance testing, accessibility testing, and more. It contains a dashboard, grids, different users, and languages.

I'll be publishing a new QA Challenge. These aren't just "dummy" or standalone exercises. They are designed to simulate the complex workflows that you face when you are working as QA.

To keep the website available to everyone, it automatically resets all the info. It redeploys the basic data every Sunday at 00:00 UTC.

The website is an accounts receivable dashboard for different companies. One server can have one or more companies, and each company can have different users with different levels of access.

An admin user can register new servers, companies, and users.

A standard user can only see the dashboard, reports, and config parameters for the dashboard.

Challenge 1: Log in with different users

A login is about more than just a username and password. To test professional applications, you need to understand some main concepts:

  • Authentication: The system verifies who you are by checking your credentials and issuing an AccessToken.
  • Authorization: Once you are logged in, the system checks what you are allowed to do. and which companies you can access based on your role.
  • Internationalization (i18n): Testing that the application supports multiple languages (the language switcher at the top of the page).
  • Localization (l10n): Testing that the application is correctly translated for a specific region (switching to Spanish or Japanese).

In this challenge, we will automate both using an Admin account and a Standard User account.

The Scenarios to test

You need to verify the login functionality for two different user with different roles:

  1. The Admin (John Doe)
    User: jdoe 
    Password: Admin+123
    Companies: Northwind, Contoso, or Adventure Works

  2. The Standard User (Jane Doe)
    User: janedoe
    Password: User+123
    Company: Northwind

The Dojo Challenge

  • API Challenge:
  1. Perform a POST request to the login endpoint. Verify you receive a 200 OK and a valid AccessToken.
  2. Perform a post with invalid user and password.
  • E2E Challenge:
  1. Automate the UI flow (Company, User, Pass), click Login, and verify the redirection to the dashboard. The menu is different for an admin and a standard user.

Pro Tips for this Challenge

  • Role-Based Access: Users shouldn't be able to log into a company without access.
  • Wait for the Dashboard: The dashboard loads data from multiple APIs. Ensure your E2E test waits for the charts to appear before declaring victory!
  • Save that Token: You’ll need the AccessToken for future challenges. Keep it handy!
  • Internalization: Log in by selecting a different language. You can use the Google option to translate to your preferred language

My Solution

I’ll be sharing my own implementation for this challenge on https://github.com/apis3445/TestingDojo.

  • Postman (API Collections)
  • C# / .NET (API Automation)
  • Playwright (E2E Masterclass)

If you complete this challenge, share your repository or a screenshot of your passing tests and tag it!

Top comments (0)