From the course: Playwright: Design Patterns
Unlock this course with a free trial
Join today to access over 24,400 courses taught by industry experts.
Implementing data-driven testing in Playwright - Microsoft Playwright Tutorial
From the course: Playwright: Design Patterns
Implementing data-driven testing in Playwright
- [Instructor] Now that we have set up our test data, let's implement data-driven testing in playwright. First we'll start with a basic login test using hard coded values, and then we'll enhance it by making it data-driven. So, what I'm going to do is create a new file inside the test and I'll call it login.spec.ts. And here we will have the import, which will be for tests and expect that will come from playwright test. Then we'll write our test to say user can log in with valid credentials, which will have a body containing, first of all, we need the builtin page fixture and the test. So, within the test, we will basically go to the page, page.goto and https binaryville.com/account. And within this page we will start filling the values, which is by locating the elements, which is first of all text box with the name email, we will fill, first of all, as I said, we will hard code the email, so test edit example.com, and same for the password. And the value is pass one, two, three. And…