Skip to content

Commit 381c598

Browse files
committed
Updated dependencies to Playwright 1.57.0 and added the Address structure to the user registration API calls
1 parent 94aff11 commit 381c598

File tree

4 files changed

+27
-22
lines changed

4 files changed

+27
-22
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<dependency>
3333
<groupId>com.microsoft.playwright</groupId>
3434
<artifactId>playwright</artifactId>
35-
<version>1.48.0</version>
35+
<version>1.57.0</version>
3636
<scope>test</scope>
3737
</dependency>
3838
<dependency>

src/test/java/com/serenitydojo/playwright/toolshop/catalog/pageobjects/SearchComponent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ public void searchBy(String keyword) {
1515
page.getByPlaceholder("Search").fill(keyword);
1616
page.getByRole(AriaRole.BUTTON, new Page.GetByRoleOptions().setName("Search")).click();
1717
});
18+
page.waitForTimeout(250);
1819
}
1920

2021
public void clearSearch() {
2122
page.waitForResponse("**/products**", () -> {
2223
page.getByTestId("search-reset").click();
2324
});
25+
page.waitForTimeout(250);
2426
}
2527

2628
public void filterBy(String filterName) {
@@ -30,7 +32,7 @@ public void filterBy(String filterName) {
3032
}
3133

3234
public void sortBy(String sortFilter) {
33-
page.waitForResponse("**/products?sort=**", () -> {
35+
page.waitForResponse("**/products?page=0&sort=**", () -> {
3436
page.getByTestId("sort").selectOption(sortFilter);
3537
});
3638
page.waitForTimeout(250);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package com.serenitydojo.playwright.toolshop.domain;
2+
3+
public record Address(String street, String city, String state, String country, String postal_code) {}

src/test/java/com/serenitydojo/playwright/toolshop/domain/User.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,26 @@
66
import java.time.format.DateTimeFormatter;
77

88
/**
9-
* {
10-
* "first_name": "John",
11-
* "last_name": "Doe",
12-
* "address": "Street 1",
13-
* "city": "City",
14-
* "state": "State",
15-
* "country": "Country",
16-
* "postcode": "1234AA",
17-
* "phone": "0987654321",
18-
* "dob": "1970-01-01",
19-
* "password": "S1!uper-secret",
20-
* "email": "[email protected]"
21-
* }
9+
* {
10+
* "first_name": "John",
11+
* "last_name": "Doe",
12+
* "address": {
13+
* "street": "Street 1",
14+
* "city": "City",
15+
* "state": "State",
16+
* "country": "Country",
17+
* "postal_code": "1234AA"
18+
* },
19+
* "phone": "0987654321",
20+
* "dob": "1970-01-01",
21+
* "password": "SuperSecure@123",
22+
* "email": "[email protected]"
23+
* }
2224
*/
2325
public record User(
2426
String first_name,
2527
String last_name,
26-
String address,
27-
String city,
28-
String state,
29-
String country,
30-
String postcode,
28+
Address address,
3129
String phone,
3230
String dob,
3331
String password,
@@ -44,11 +42,13 @@ public static User randomUserNamed(String firstName) {
4442
return new User(
4543
firstName,
4644
fake.name().lastName(),
45+
new Address(
4746
fake.address().streetAddress(),
4847
fake.address().city(),
4948
fake.address().state(),
5049
fake.address().country(),
51-
fake.address().zipCode(),
50+
fake.address().zipCode()
51+
),
5252
fake.phoneNumber().phoneNumber(),
5353
formattedDate,
5454
"Az1234£!3",
@@ -57,6 +57,6 @@ public static User randomUserNamed(String firstName) {
5757
}
5858

5959
public User withPassword(String password) {
60-
return new User(first_name, last_name, address, city, state, country, postcode, phone, dob, password, email);
60+
return new User(first_name, last_name, address, phone, dob, password, email);
6161
}
6262
}

0 commit comments

Comments
 (0)