|
| 1 | +name: Run Selenium Tests with Allure Reports |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: null |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-and-test: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + # Checkout code |
| 14 | + - name: Checkout code |
| 15 | + uses: actions/checkout@v4 |
| 16 | + |
| 17 | + # Set up JDK 20 |
| 18 | + - name: Set up JDK 20 |
| 19 | + uses: actions/setup-java@v4 |
| 20 | + with: |
| 21 | + java-version: "20" |
| 22 | + distribution: temurin |
| 23 | + |
| 24 | + # Cache Maven dependencies |
| 25 | + - name: Cache Maven dependencies |
| 26 | + uses: actions/cache@v4 |
| 27 | + with: |
| 28 | + path: ~/.m2/repository |
| 29 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/cucumber-archetype-parallel-advance/pom.xml') }} |
| 30 | + restore-keys: | |
| 31 | + ${{ runner.os }}-maven- |
| 32 | + |
| 33 | + # Execute tests |
| 34 | + - name: Execute Tests |
| 35 | + working-directory: ./cucumber-archetype-parallel-advance |
| 36 | + run: | |
| 37 | + export ENVIRONMENTS=QA |
| 38 | + export PASSWORD=Carolina123. |
| 39 | + export PASSWORD_SUPERADMIN=Carolina123. |
| 40 | + export PLATFORM_GOAL_EXECUTION_TEST=LOCAL |
| 41 | + mvn test -Dcucumber.filter.tags="@Logins" |
| 42 | + |
| 43 | + # Debug: Check feature files |
| 44 | + - name: Debug Check Features Directory |
| 45 | + run: | |
| 46 | + ls -R ./cucumber-archetype-parallel-advance/src/test/resources/ |
| 47 | + ls -R ./cucumber-archetype-parallel-advance/src/test/java/ |
| 48 | + |
| 49 | + # Generate Allure report |
| 50 | + - name: Generate Allure Report |
| 51 | + working-directory: ./cucumber-archetype-parallel-advance |
| 52 | + run: mvn io.qameta.allure:allure-maven:2.10.0:report |
| 53 | + |
| 54 | + # Copy Allure Report to docs Folder |
| 55 | + - name: Copy Allure Report to docs Folder |
| 56 | + run: | |
| 57 | + mkdir -p ./docs |
| 58 | + cp -R ./cucumber-archetype-parallel-advance/target/site/allure-maven-plugin/* ./docs/ |
| 59 | +
|
| 60 | + # Commit and Push Allure Report to docs |
| 61 | + - name: Commit and Push Allure Report |
| 62 | + run: | |
| 63 | + git config --local user.name "github-actions[bot]" |
| 64 | + git config --local user.email "github-actions[bot]@users.noreply.github.com" |
| 65 | + git add ./docs |
| 66 | + git commit -m "Update Allure Report" |
| 67 | + git push |
| 68 | + env: |
| 69 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 70 | + |
| 71 | + # Publish Allure Report (optional artifact upload) |
| 72 | + - name: Publish Allure Report |
| 73 | + uses: actions/upload-artifact@v3 |
| 74 | + with: |
| 75 | + name: allure-report |
| 76 | + path: cucumber-archetype-parallel-advance/target/site/allure-maven-plugin/ |
0 commit comments