Test automation
Автоматизация тестирования
Test automation uses code and tools to run software checks, compare what happened with what was expected, and report failures without someone repeating the steps by hand.
Also known as: автотесты, Selenium, Playwright
What test automation does
Suppose a checkout change accidentally removes the discount from an order. An automated test can catch that regression by applying a discount and checking the resulting total. Someone still has to decide what behavior matters and what result counts as correct. Automation makes those decisions repeatable; it doesn't decide what to test for you.
Selenium and Playwright are tools for driving browsers, not names for test automation as a whole. Automated tests can also call functions directly, send requests to an API, or check how a service interacts with a database.
From test code to a useful result
A typical test starts from a known state, performs an action, and checks the outcome with an assertion. A test runner such as pytest runs the tests and reports which checks passed or failed. Teams often run a fast suite on pull requests through continuous integration (CI), with longer suites running on a schedule or before release.
A good failure report tells you what was expected and what actually happened. Browser traces and service logs can provide additional context. A failed check is a signal to investigate, not proof of a product bug: bad test data, an unavailable dependency, or a mistaken assertion can also cause a failure.
Example: checking a discount
Assume the cart calculates prices in cents and apply_discount takes a whole-number percentage. A 10% discount on $10.00 should leave $9.00:
from cart import apply_discount
def test_ten_percent_discount():
assert apply_discount(1000, 10) == 900
This unit test can catch a calculation error without starting the application. It can't tell you whether a shopper can enter a promo code or see the updated total. A browser test can check that journey, but it doesn't need to repeat every calculation case.
Choosing what to automate
Start with checks the team runs repeatedly and failures that would matter to users. Use the least complex test that can catch the failure you're concerned about. For checkout, unit tests can cover pricing rules, integration tests can check whether the order service saves the right total, and an end-to-end test can cover the purchase flow. Keep exploratory testing for questions you haven't yet turned into explicit checks.
Watch out for tests that depend on each other or share mutable data. That can make a suite pass in one order and fail in another. In browser tests, wait for a meaningful condition, such as the updated total being visible, rather than sleeping for a fixed number of seconds. Retries can help diagnose a flaky test, but a passing retry doesn't fix it.
What interviewers look for
You may be asked to design a test suite for a feature or debug a failure that happens only in CI. Explain why each check belongs at its chosen level, how you'd control test data, and what evidence you'd collect to distinguish a product defect from a test or environment problem.