That allows you to extend existing functionality to provide custom installations. In this section you will write a fixture that allows you to provide a class for each test. The login page fixture starts from the root of Create a new folder in the named Copy and then in that new folder create a file named Copy at the very top of the file using the name Import the function Copy from The variables imported here are You will use the default function of the custom fixture extension. However before extending this function you need definitions to describe the fixtures you will add. Add the following to describe a fixture named Copy. This fixture provides an instance of the class for your tests. You can now extend the type of the function using Copy. In the object parameter of the function you will now find that there is a Description property. Login Page IntelliSense You will define a new custom device in this property.
The value will be an asynchronous function object wi photo editing servies th two arguments containing all available means of the function. A function that takes the desired instance as its only argument. This function provides an instance of the class for all tests. Test success Invalid login attempt Next use the function of the class Fill in the login form using a set of invalid login credentials Copy Finally use the function of the object Click the login button Wait for the request to complete and verify if the popup appears Copy Run the end-to-end test You should now Show another set of successful tests Copy the test twice Verify that the user receives a warning when trying to submit an empty form This test is very similar to the previous test It will start from the login page and submit the login form. The only difference is that the form should be empty and the error message should contain text. Add the following test to .
Verify that the expected error message is n is accessed through a property. This is done purely to eliminate warnings that appear when the variable is not used. Running the end-to-end test should now show a third set of successful tests. Copy the three sets of tests successfully. Verify that the user is directed to the homepage after creating a new account. The tests you have written so far assume that the user is not logged in or cannot log in. In this test you will verify that the user is redirected to the home page after successfully creating a new account through the registration form. Adding a new test to your suite The first thing you need to do to introduce and replicate the test is to fill out the registration form with your unique user credentials. This fixture has data specific to this test so you will use these values. Add the following code snippet to fill out the registration form and submit it. At this point the test will fill in the registration form and click on the register button. When this happens the browser should be redirected to the homepage and the user details should be available in local storage under a key named. Add the .