Skip to content

Commit 3b4e172

Browse files
committed
Updated dependencies to Playwright 1.57.0 and JUnit 6.0.1
2 parents aaebfb8 + 1ebecfa commit 3b4e172

File tree

5 files changed

+117
-1
lines changed

5 files changed

+117
-1
lines changed

.github/workflows/playwright-tests.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,20 @@ jobs:
2525
java-version: '17'
2626
distribution: 'adopt'
2727

28-
# Step 3: Cache Maven dependencies to speed up future builds
28+
# Step 3: Install Maven 3.9.9
29+
- name: Setup Maven Action
30+
31+
with:
32+
checkout-fetch-depth: 0
33+
java-version: 17
34+
java-distribution: temurin
35+
maven-version: 3.9.9
36+
37+
# Step 4: Verify Maven installation
38+
- name: Verify Maven version
39+
run: mvn --version
40+
41+
# Step 5: Cache Maven dependencies
2942
- name: Cache Maven dependencies
3043
uses: actions/cache@v3
3144
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ buildNumber.properties
1515
.project
1616
# JDT-specific (Eclipse Java Development Tools)
1717
.classpath
18+
.idea
19+
.allure

pom.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
<version>6.0.1</version>
2828
<scope>test</scope>
2929
</dependency>
30+
<dependency>
31+
<groupId>org.assertj</groupId>
32+
<artifactId>assertj-core</artifactId>
33+
<version>3.27.6</version>
34+
<scope>test</scope>
35+
</dependency>
3036
</dependencies>
3137

3238
</project>

push-all-branches.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
# List of branch names to process
4+
BRANCHES=(
5+
"sample-code/start-here"
6+
"sample-code/module-3-my-first-playwright-test"
7+
"sample-code/module-4-interacting-with-elements"
8+
"sample-code/module-5-refactoring"
9+
"sample-code/module-6-browser-options"
10+
"sample-code/module-7-browser-contexts"
11+
"sample-code/module-8-locators"
12+
"sample-code/module-9-forms"
13+
"sample-code/module-10-assertions"
14+
"sample-code/module-11-waits"
15+
"sample-code/module-12-api-interactions"
16+
"sample-code/module-12-mocking-api-calls"
17+
"sample-code/module-13-page-objects"
18+
"sample-code/module-14-allure-reporting"
19+
"sample-code/module-14-organizing-your-tests"
20+
"sample-code/module-14-parallel-execution"
21+
"sample-code/module-15-parallel-execution"
22+
"sample-code/module-16-allure-reporting"
23+
"sample-code/module-17-cucumber"
24+
)
25+
26+
# Iterate over each branch
27+
for BRANCH_NAME in "${BRANCHES[@]}"; do
28+
echo "Processing branch $BRANCH_NAME..."
29+
30+
# Check if the branch already exists locally
31+
if git branch --list | grep -q "$BRANCH_NAME"; then
32+
echo "Branch $BRANCH_NAME already exists locally. Checking it out..."
33+
git checkout "$BRANCH_NAME"
34+
else
35+
echo "Creating and checking out branch $BRANCH_NAME..."
36+
git checkout -b "$BRANCH_NAME"
37+
fi
38+
39+
# Add and commit changes (if any)
40+
git add .
41+
git commit -m "Add or update code for $BRANCH_NAME" || echo "No changes to commit for $BRANCH_NAME"
42+
43+
# Push the branch to the origin remote
44+
echo "Pushing branch $BRANCH_NAME to GitHub..."
45+
git push -u origin "$BRANCH_NAME"
46+
47+
echo "Branch $BRANCH_NAME processed successfully."
48+
done
49+
50+
echo "All branches have been processed!"

scripts/update-playwright.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
# Fetch all remote branches to ensure the list is up-to-date
4+
git fetch --all
5+
6+
# Get a list of all branches starting with "sample-code/"
7+
branches=$(git branch -r | grep "origin/sample-code/" | sed 's/origin\///')
8+
9+
# Loop through each branch and perform the update
10+
for branch in $branches; do
11+
echo "Processing branch: $branch"
12+
13+
# Check out the branch
14+
git checkout $branch
15+
if [ $? -ne 0 ]; then
16+
echo "Failed to check out branch: $branch. Skipping..."
17+
continue
18+
fi
19+
20+
# Update Playwright dependency
21+
mvn versions:use-latest-versions -Dincludes=com.microsoft.playwright:playwright
22+
if [ $? -ne 0 ]; then
23+
echo "Failed to update Playwright in branch: $branch. Skipping..."
24+
continue
25+
fi
26+
27+
# Stage and commit changes
28+
git add pom.xml
29+
git commit -m "Updated Playwright version to the latest version"
30+
if [ $? -ne 0 ]; then
31+
echo "Failed to commit changes in branch: $branch. Skipping..."
32+
continue
33+
fi
34+
35+
# Push changes to GitHub
36+
git push origin $branch
37+
if [ $? -ne 0 ]; then
38+
echo "Failed to push changes for branch: $branch. Skipping..."
39+
continue
40+
fi
41+
42+
echo "Successfully updated branch: $branch"
43+
done
44+
45+
echo "All branches starting with 'sample-code/' have been processed."

0 commit comments

Comments
 (0)