From the course: Playwright Python and Pytest for Web Automation Testing: Master Modern Web Testing with Playwright and Pytest in Python

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

Implement steps

Implement steps

In the previous lesson, we defined our login feature. It has a scenario that is success for login, and we have defined the steps for the same. And now we can implement the steps using Python code. To do that, we will create a Python module inside of the steps directory with the same name as our feature file. is login in this case so let's go ahead and do that i'll create login.py first of all we'll import the behave package so from behave import everything now to implement the steps we define functions so i can define a function and then the function will receive the feature context given by behave so we'll take the same as an argument and then we can implement the step for now i can pass the block now to mark this function as this given step we will decorate it with the given decorator which is being imported from the behave package and then we have to provide this decorator the step we are implementing. That is given username and pwd password. So I will copy it and paste it like…

Contents