Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
4d45c19
first initial
Jul 13, 2026
01182e0
Section3 lesson
Jul 13, 2026
ca252f9
Merge pull request #1 from ErhanBatu/feature/Section3
ErhanBatu Jul 13, 2026
f9de268
Section4 lesson part1
Jul 13, 2026
ffc9dcb
Merge pull request #2 from ErhanBatu/feature/Section4
ErhanBatu Jul 13, 2026
a49d1d3
Section4 lesson part2
Jul 13, 2026
3757ecf
Merge pull request #3 from ErhanBatu/feature/Section4
ErhanBatu Jul 13, 2026
d96b4aa
Section5 part1
Jul 14, 2026
82dfab8
Merge pull request #4 from ErhanBatu/feature/Section5
ErhanBatu Jul 14, 2026
fc5cd6c
Section5 part2
Jul 15, 2026
20ae82b
Merge pull request #5 from ErhanBatu/feature/Section5
ErhanBatu Jul 15, 2026
61497b3
Section6
Jul 15, 2026
7ba1299
Merge pull request #6 from ErhanBatu/feature/section6
ErhanBatu Jul 15, 2026
049baf2
Section7
Jul 27, 2026
6d09019
Merge pull request #7 from ErhanBatu/feature/section7
ErhanBatu Jul 27, 2026
5bd0c24
API
Jul 31, 2026
27b5a3a
Merge pull request #8 from ErhanBatu/feature/section7
ErhanBatu Jul 31, 2026
6dc56bb
Mock out API
Jul 31, 2026
3c457f4
Merge pull request #9 from ErhanBatu/feature/section11
ErhanBatu Jul 31, 2026
b6da19b
Section12
Jul 31, 2026
abd7375
Merge pull request #10 from ErhanBatu/feature/section12
ErhanBatu Jul 31, 2026
12a01a4
Tracing
Jul 31, 2026
c582feb
Merge pull request #11 from ErhanBatu/feature/section13
ErhanBatu Jul 31, 2026
4d130ec
Section 15 parallel execution
Aug 1, 2026
87291d4
Merge pull request #12 from ErhanBatu/feature/section14
ErhanBatu Aug 1, 2026
3e8ef63
Allure reporting
Aug 2, 2026
f683501
Merge pull request #13 from ErhanBatu/feature/section15
ErhanBatu Aug 2, 2026
99a7fb7
Cucumber
Aug 7, 2026
b2d2472
Merge pull request #14 from ErhanBatu/feature/section16
ErhanBatu Aug 7, 2026
bfafe9f
github
Aug 8, 2026
3310e51
Merge pull request #15 from ErhanBatu/feature/section16
ErhanBatu Aug 8, 2026
b51682c
Docker
Aug 8, 2026
c54c289
Merge pull request #16 from ErhanBatu/feature/section16
ErhanBatu Aug 8, 2026
c547868
Serenity
Aug 8, 2026
431ece7
Merge pull request #17 from ErhanBatu/feature/section20
ErhanBatu Aug 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions .github/workflows/playwright-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ jobs:
node-version: '20'

# Step 2: Set up JDK 17 (adjust if you're using a different version)
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '17'
java-version: '21'
distribution: 'adopt'

# Step 3: Install Maven 3.9.9
- name: Setup Maven Action
uses: s4u/setup-maven-action@v1.7.0
with:
checkout-fetch-depth: 0
java-version: 17
java-version: 21
java-distribution: temurin
maven-version: 3.9.9
maven-version: 3.9.16

# Step 4: Verify Maven installation
- name: Verify Maven version
Expand All @@ -57,4 +57,20 @@ jobs:

# Step 6: Run Maven to execute Playwright tests
- name: Run Playwright Tests
run: mvn verify
run: mvn verify

# Step 7: Archive any trace files
- name: Archive trace files
if: always()
uses: actions/upload-artifact@v4
with:
name: traces
path: target/traces/*.zip

# Step 8: Deploy Allure report to GitHub Pages
- name: Deploy Allure Report to GitHub Pages
if: always() # Ensure this step runs even if tests fail
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/site/allure-maven-plugin
241 changes: 237 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,257 @@
<version>1.0-SNAPSHOT</version>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<allure.version>2.35.2</allure.version>
<allure.maven.version>2.15.2</allure.maven.version>
<playwright.version>1.60.0</playwright.version>
<aspectj.version>1.9.24</aspectj.version>
<junit.version>5.14.2</junit.version>
<cucumber.version>7.34.4</cucumber.version>
<serenity.version>5.3.11</serenity.version>
</properties>

<dependencies>
<dependency>
<groupId>com.microsoft.playwright</groupId>
<artifactId>playwright</artifactId>
<version>1.60.0</version>
<version>${playwright.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-cucumber7-jvm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.11.3</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-suite</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit-platform-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.27.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-jupiter</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>net.datafaker</groupId>
<artifactId>datafaker</artifactId>
<version>2.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.18.0</version>
</dependency>

<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-core</artifactId>
</dependency>

<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-junit5</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-ensure</artifactId>
</dependency>

<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-playwright</artifactId>
<scope>test</scope>
</dependency>

</dependencies>


<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>${junit.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-bom</artifactId>
<version>${cucumber.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>

<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-bom</artifactId>
<version>${serenity.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>


<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-bom</artifactId>
<version>${allure.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.14.0</version>

<configuration>
<release>${maven.compiler.release}</release>

<compilerArgs>
<arg>-parameters</arg>
</compilerArgs>

<fork>true</fork>

<executable>
/Users/erhanbatu/Library/Java/JavaVirtualMachines/temurin-21.0.11/Contents/Home/bin/javac
</executable>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.6</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.6</version>

<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>

<configuration>
<jvm>
/Users/erhanbatu/Library/Java/JavaVirtualMachines/temurin-21.0.11/Contents/Home/bin/java
</jvm>

<!-- <argLine>-->
<!-- -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar-->
<!-- </argLine>-->

<includes>
<include>**/*Test.java</include>
<include>**/*Tests.java</include>
</includes>

<!-- <systemPropertyVariables>-->
<!-- <allure.results.directory>-->
<!-- ${project.build.directory}/allure-results-->
<!-- </allure.results.directory>-->
<!-- </systemPropertyVariables>-->
</configuration>
</plugin>

<plugin>
<groupId>net.serenity-bdd.maven.plugins</groupId>
<artifactId>serenity-maven-plugin</artifactId>
<version>${serenity.version}</version>

<executions>
<execution>
<id>serenity-reports</id>
<phase>post-integration-test</phase>
<goals>
<goal>aggregate</goal>
</goals>
</execution>
</executions>
</plugin>

<!-- <plugin>-->
<!-- <groupId>io.qameta.allure</groupId>-->
<!-- <artifactId>allure-maven</artifactId>-->
<!-- <version>${allure.maven.version}</version>-->
<!-- <configuration>-->
<!-- <reportVersion>2.44.0</reportVersion>-->
<!-- <resultsDirectory>${project.build.directory}/allure-results</resultsDirectory>-->
<!-- </configuration>-->
<!-- <executions>-->
<!-- <execution>-->
<!-- <id>allure-reports</id>-->
<!-- <phase>post-integration-test</phase>-->
<!-- <goals>-->
<!-- <goal>report</goal>-->
<!-- </goals>-->
<!-- </execution>-->
<!-- </executions>-->
<!-- </plugin>-->
</plugins>
</build>


</project>
7 changes: 7 additions & 0 deletions react-todomvc/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM node:16
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 7002
CMD ["npm","run","serve"]
Original file line number Diff line number Diff line change
@@ -1,15 +1,67 @@
package com.serenitydojo.playwright;

import com.microsoft.playwright.Browser;
import com.microsoft.playwright.Page;
import com.microsoft.playwright.Playwright;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import com.microsoft.playwright.*;
import com.microsoft.playwright.junit.UsePlaywright;
import org.junit.jupiter.api.*;

import java.util.Arrays;

//This annotation allows you to do test without creating playwright environment and browser
//@UsePlaywright
public class ASimplePlaywrightTest {

private static Playwright playwright;
private static Browser browser;
private static BrowserContext browserContext;
Page page;

@BeforeAll
public static void setUpBrowser(){
playwright = Playwright.create();
browser = playwright.chromium().launch(
new BrowserType.LaunchOptions()
.setHeadless(false)
.setArgs(Arrays.asList("--no-sandbox", "--disable-extensions","--disable-gpu"))
);
//this allows paralel execution
browserContext = browser.newContext();

}

@BeforeEach
public void setUp(){
page = browser.newPage();
}

@AfterAll
public static void tearDown(){
browser.close();
playwright.close();
}

@Test
void shouldShowThePageTitle() {
// TODO: Write your first playwright test here

page.navigate("https://practicesoftwaretesting.com/");
String title = page.title();
Assertions.assertTrue(title.contains("Practice Software Testing"));

}

@Test
void shouldSearchByKeyword(){

page.navigate("https://practicesoftwaretesting.com/");
page.locator("[placeholder=Search]").fill("Pliers");
//this is basically sort of xpath
page.locator("button:has-text('Search')").click();

//this will look for the element with card
int matchingSearchResults = page.locator(".card").count();
System.out.println(matchingSearchResults);

Assertions.assertTrue(matchingSearchResults>0);

}
}
Loading