Skip to content

Commit 667b7fa

Browse files
committed
Added github actions
1 parent 27f7e1f commit 667b7fa

File tree

1 file changed

+4
-19
lines changed

1 file changed

+4
-19
lines changed
Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,29 @@
11
package com.serenitydojo.playwright;
22

3-
import com.microsoft.playwright.Browser;
43
import com.microsoft.playwright.Page;
5-
import com.microsoft.playwright.Playwright;
6-
import com.microsoft.playwright.impl.AssertionsTimeout;
4+
import com.microsoft.playwright.junit.UsePlaywright;
75
import org.junit.jupiter.api.Assertions;
86
import org.junit.jupiter.api.Test;
97

8+
@UsePlaywright
109
public class ASimplePlaywrightTest {
1110

1211
@Test
13-
void shouldShowThePageTitle() {
14-
Playwright playwright = Playwright.create();
15-
Browser browser = playwright.chromium().launch();
16-
Page page = browser.newPage();
17-
12+
void shouldShowThePageTitle(Page page) {
1813
page.navigate("https://practicesoftwaretesting.com");
1914
String title = page.title();
2015

2116
Assertions.assertTrue(title.contains("Practice Software Testing"));
22-
23-
browser.close();
24-
playwright.close();
2517
}
2618

2719
@Test
28-
void shouldShowSearchTermsInTheTitle() {
29-
Playwright playwright = Playwright.create();
30-
Browser browser = playwright.chromium().launch();
31-
Page page = browser.newPage();
32-
20+
void shouldShowSearchTermsInTheTitle(Page page) {
3321
page.navigate("https://practicesoftwaretesting.com");
3422
page.locator("[placeholder=Search]").fill("Pliers");
3523
page.locator("button:has-text('Search')").click();
3624

3725
int matchingProductCount = page.locator(".card-title").count();
3826

3927
Assertions.assertTrue(matchingProductCount > 0);
40-
41-
browser.close();
42-
playwright.close();
4328
}
4429
}

0 commit comments

Comments
 (0)