Skip to content

Commit

Permalink
updated logger hook and added link for report
Browse files Browse the repository at this point in the history
  • Loading branch information
AEkaterina committed Oct 24, 2023
1 parent df38557 commit 6062fa3
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 33 deletions.
67 changes: 35 additions & 32 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,41 @@ jobs:
name: allure-report
path: target/site/allure-maven-plugin

# - name: Get Allure history
# uses: actions/checkout@v3
# if: always()
# continue-on-error: true
# with:
# ref: gh-pages
# path: gh-pages
- name: Get Allure history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages

# - name: Allure Report action from marketplace
# uses: simple-elf/allure-report-action@master
# if: always()
# id: allure-report
# with:
# allure_results: allure-results
# gh_pages: gh-pages
# allure_report: allure-report
# allure_history: allure-history
- name: Allure Report action from marketplace
uses: PavanMudigonda/[email protected]
if: always()
id: allure-report
with:
token: ${{ secrets.PERSONAL_TOKEN }}
WORKFLOW_ID: maven.yml
allure_results: allure-results
gh_pages: gh-pages
allure_report: allure-report
allure_history: allure-history

# - name: Deploy report to GitHub Pages
# if: always()
# uses: peaceiris/actions-gh-pages@v2
# env:
# PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
# PUBLISH_BRANCH: gh-pages
# PUBLISH_DIR: allure-history
- name: Deploy report to GitHub Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
keep_files: true

# - name: Post the link to the report
# if: always()
# uses: Sibz/github-status-action@v1
# with:
# authToken: ${{secrets.PERSONAL_TOKEN}}
# context: 'Test report'
# state: 'success'
# sha: ${{ github.event.pull_request.head.sha || github.sha }}
# target_url: https://thepalaceproject.github.io/allure-html-reporter-github-pages/${{ github.run_number }}
- name: Post the link to the report
if: always()
uses: Sibz/github-status-action@v1
with:
authToken: ${{secrets.PERSONAL_TOKEN}}
context: 'Test report'
state: 'success'
sha: ${{ github.event.pull_request.head.sha || github.sha }}
target_url: https://thepalaceproject.github.io/allure-html-reporter-github-pages/${{ github.run_number }}
2 changes: 1 addition & 1 deletion src/test/java/features/BookDetailView.feature
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ Feature: Book detail view screen
And Tap the Sign in button on Sign in screen
Then There is an alert "Invalid credentials" on Sign in screen

@smoke
@report
Scenario: Book detail view: Perform check of Get button before log in from the Settings tab
When Add library "LYRASIS Reads" on Add library screen
Then Library "LYRASIS Reads" is opened on Libraries screen
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/hooks/LoggerHooks.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ public void addLogToScenario(Scenario scenario) {
@BeforeStep
public void getStepName(Scenario scenario) throws Exception {
Field delegateField = scenario.getClass().getDeclaredField("delegate");
delegateField.setAccessible(true);
TestCaseState testCaseState = (TestCaseState) delegateField.get(scenario);

Field testCaseField = testCaseState.getClass().getDeclaredField("testCase");
testCaseField.setAccessible(true);
TestCase r1 = (TestCase) testCaseField.get(testCaseState);

List<PickleStepTestStep> stepDefinitions = r1.getTestSteps()
Expand Down

0 comments on commit 6062fa3

Please sign in to comment.