What can be used as an alternative to `yield` in pytest fixtures?
QA / QA Automation
Have you worked with Selenium and Playwright?
# Create a list of three functions, where each function returns its number when called. # The first function should return - 0, the second - 1, the third - 2: funcs = [lambda: i for i in range(3)] print([f() for f in funcs]) # Answer:
Is it good to use XPath for finding elements?
Two tests pass separately, but when running the entire file, the second test fails. What does this indicate and how to fix it?
What is the difference between the `is` operator and the equality operator `==` in Python?
How to find an element if it doesn't have an `id` or class?
What is the difference between HTTP response codes 401 and 403?
Fix the `add_user` function that uses a mutable list as a default argument directly in the code.
Is it possible to mix explicit and implicit waits, as well as fixed-time waits, in a single test?
Can we say that tests are not isolated if they influence each other?
What testing design techniques do you know?
What will happen if you call the function `add_user` three times in a row with `print`?
What is the difference between HTTP response codes 200 and 204?
What does a decorator do in Python?
Why is the POST method usually not idempotent?
How do explicit waits differ from implicit waits in UI testing?
Did you have experience working with SQL at your previous job, and how did you work with it?
A test requires a UPP user who must be deleted after the test. How to ensure user cleanup even if the test fails?
# Python - identify the problem in the code and rewrite it without errors # Add a user to the list and return this list. # If the second argument is not specified during the call, return the user in the response. def add_user(user, users=[]): users.append(user) return users print(add_user("User")) # Create a list of three functions, where each function returns its number when called. # The first function should return - 0, the second - 1, the third - 2: funcs = [lambda: i for i in range(3)] print([f() for f in funcs])