Skip to content

repo initialized with test cases #1

repo initialized with test cases

repo initialized with test cases #1

name: End to End Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
run-e2e-tests:
timeout-minutes: 6
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Create .env file
run: |
echo "EMAIL=${{ secrets.EMAIL }}" >> .env
echo "PASSWORD=${{ secrets.PASSWORD }}" >> .env
echo "CLIENT_ID=${{ secrets.CLIENT_ID }}" >> .env
echo "CLIENT_SECRET=${{ secrets.CLIENT_SECRET }}" >> .env
- name: Add test dependencies to pom.xml
run: |
sed -i '/<dependencies>/a <dependency> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.3.1</version> <scope>test</scope> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-engine</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>org.junit.jupiter</groupId> <artifactId>junit-jupiter-api</artifactId> <version>5.8.1</version> <scope>test</scope> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>com.microsoft.playwright</groupId> <artifactId>playwright</artifactId> <version>1.18.0</version> </dependency>' pom.xml
sed -i '/<dependencies>/a <dependency> <groupId>io.github.cdimascio</groupId> <artifactId>dotenv-java</artifactId> <version>2.2.0</version> </dependency>' pom.xml
sed -i '/<plugins>/a <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>3.3.1</version> <configuration> <!-- Add any specific configuration for Surefire here --> </configuration> </plugin>' pom.xml
- name: Build & Install
run: mvn -B install -D skipTests --no-transfer-progress
- name: Install Playwright
run: mvn exec:java -e -D exec.mainClass=com.microsoft.playwright.CLI -D exec.args="install --with-deps"
- name: Run tests
run: mvn test -Dtest=**/com/paypal/api/e2e/**/*