From the course: Learning Playwright
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
Solution: Create three automated tests - Microsoft Playwright Tutorial
From the course: Learning Playwright
Solution: Create three automated tests
(upbeat music) - [Instructor] Hopefully you were able to solve the challenge or get very close on your own. I'll walk through my solution and explain my whys on the decisions I made when writing the code. You also may pick up on a few features we haven't talked about as well. So I started off by creating a challenge.spec.ts, and I have two different describe blocks. So I'm going to go ahead and collapse these down. So I've got a describe, this is the, "Checkout Challenge," and a describe, this is the, "API Challenge." We'll start with the, "Checkout Challenge," first. The first thing I do within the describe block is I go ahead and use the storageState from the .auth/customer01. This is what gets generated in our setup file. I then have a beforeEach block that goes to the practicesoftwaretesting page So if I add more tests, I've already got the browser going there. And I've written my test down here. I'm passing in headless, which we'll use a little later. But page is the main thing…
Contents
-
-
-
- (Locked) Overview of the website under test5m 3s
- Generating tests with codegen4m 31s
- (Locked) Overview of locator strategies in Playwright5m 39s
- (Locked) Overview of assertions in Playwright12m 56s
- Structuring Playwright tests9m 8s
- (Locked) Handling cookie authentication in Playwright12m 4s
- (Locked) Visual testing in Playwright10m 58s
- (Locked) API testing in Playwright13m 31s
- (Locked) Automating the right things with Playwright2m 24s
- (Locked) Challenge: Create three automated tests1m 29s
- (Locked) Solution: Create three automated tests10m 2s
- (Locked)
-
-