From the course: Playwright Essential Training: Abstractions, Fixtures, and Complex Scenarios
Unlock this course with a free trial
Join today to access over 24,700 courses taught by industry experts.
Implementing an advanced fixture in Playwright - Microsoft Playwright Tutorial
From the course: Playwright Essential Training: Abstractions, Fixtures, and Complex Scenarios
Implementing an advanced fixture in Playwright
- [Instructor] In video 3, we implemented a page.fixture, shown in this graphic, where we abstracted away the login.page using the page.fixture within the login.spec. In this lesson, we're going to implement a more advanced fixture that will fail if any console error messages show up on the page. So this is what you would see if you inspect your browser, and you look at the browser console, and there's any JavaScript errors. This will require us to create a new fixture file, and we're going to use a function that Playwright provides to merge these fixtures together to add another layer of abstraction. In the end, this will simplify the implementation or adding some complexity on the backend. Before we get started, though, let's go ahead and take this login.page in our login.spec and let's go ahead and further abstract that. So as a part of the repo, I've already committed two new pages to the repository. One is an account page. So in pages, account, accounts.page, we have a new page…
Contents
-
-
-
-
(Locked)
Overview of Playwright fixtures3m 9s
-
(Locked)
Creating a fixture in Playwright3m 41s
-
(Locked)
Using a fixture in Playwright tests3m 56s
-
(Locked)
Overview of advanced fixtures in Playwright3m 16s
-
(Locked)
Implementing an advanced fixture in Playwright9m 44s
-
(Locked)
Challenge: Update message test to use fixtures37s
-
(Locked)
Solution: Update message test to use fixtures2m 12s
-
(Locked)
-
-
-
-