├── .github
└── workflows
│ └── allure-history.yml
├── .gitignore
├── .gitlab-ci.yml
├── README.md
├── allure-history-action
└── action.yml
├── allure-report-action
├── Dockerfile
├── README.md
├── action.yml
└── entrypoint.sh
├── allure-template.yml
├── build.gradle
├── generate.bat
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── old.workflow.yml
├── settings.gradle
└── src
├── main
└── java
│ └── io
│ └── qameta
│ └── allure
│ └── examples
│ ├── JiraIssue.java
│ ├── JiraIssues.java
│ ├── Layer.java
│ ├── Lead.java
│ ├── PagePath.java
│ ├── RestSteps.java
│ ├── UrlPath.java
│ └── WebSteps.java
└── test
├── java
└── io
│ └── qameta
│ └── allure
│ └── examples
│ └── junit5
│ ├── IssuesRestTest.java
│ ├── IssuesWebTest.java
│ └── PullRequestsWebTest.java
└── resources
└── index.html
/.github/workflows/allure-history.yml:
--------------------------------------------------------------------------------
1 | name: Allure Reports with history
2 |
3 | on:
4 | #schedule:
5 | # - cron: '*/5 * * * *' # every 5 minutes
6 | push:
7 | branches-ignore:
8 | - '!master' # ignore gh-pages
9 | paths:
10 | - '!.gitlab-ci.yml'
11 | - '!allure-template.yml'
12 | - '**/allure-history.yml'
13 | - 'allure-report-action/*'
14 |
15 | jobs:
16 | autotests:
17 | name: Upload allure results to Allure EE
18 | runs-on: ubuntu-latest
19 | steps:
20 | - uses: actions/checkout@v2
21 |
22 | - uses: actions/cache@v1
23 | with:
24 | path: |
25 | ~/.m2/repository
26 | ~/.gradle/caches
27 | key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
28 | restore-keys: |
29 | ${{ runner.os }}-gradle-
30 |
31 | - name: Set up JDK
32 | uses: actions/setup-java@v1
33 | with:
34 | java-version: 1.8
35 |
36 | - name: Install dependencies
37 | run: ./gradlew compileTestJava
38 |
39 | - name: Run Test
40 | if: always()
41 | run: ./gradlew test
42 | continue-on-error: true
43 |
44 | - name: Get Allure history
45 | uses: actions/checkout@v2
46 | if: always()
47 | continue-on-error: true
48 | with:
49 | ref: gh-pages
50 | path: gh-pages
51 |
52 | - name: Allure Report action
53 | uses: simple-elf/allure-report-action@master
54 | #uses: ./allure-report-action
55 | if: always()
56 | #id: allure-report
57 | with:
58 | allure_results: build/allure-results
59 | allure_history: allure-history/allure-history
60 | keep_reports: 5
61 |
62 | - name: Deploy report to Github Pages
63 | if: always()
64 | uses: peaceiris/actions-gh-pages@v2
65 | env:
66 | PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67 | PUBLISH_BRANCH: gh-pages
68 | PUBLISH_DIR: allure-history/allure-history
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Project exclude paths
2 | /.gradle/
3 | /.idea/
4 | /build/
5 | /.allure/
6 |
--------------------------------------------------------------------------------
/.gitlab-ci.yml:
--------------------------------------------------------------------------------
1 | include:
2 | - local: 'allure-template.yml'
3 |
4 | workflow:
5 | rules:
6 | - if: '$CI_COMMIT_BRANCH != "gh-pages"'
7 | - changes:
8 | - '**/allure-history.yml'
9 | when: never
10 |
11 | cache:
12 | policy: pull-push
13 | paths:
14 | - .m2/repository
15 | - .gradle/caches
16 |
17 | stages:
18 | - build
19 | - test
20 | - history
21 | - allure
22 | - deploy
23 |
24 | build:
25 | stage: build
26 | image: gradle:alpine
27 | script: ./gradlew compileTestJava
28 | cache:
29 | key: "$CI_COMMIT_REF_NAME"
30 | policy: push
31 | paths:
32 | - build
33 | - .gradle
34 |
35 | test:
36 | stage: test
37 | image: gradle:alpine
38 | script: ./gradlew test
39 | cache:
40 | key: "$CI_COMMIT_REF_NAME"
41 | policy: pull
42 | paths:
43 | - build
44 | - .gradle
45 | artifacts:
46 | when: always
47 | paths:
48 | - build/allure-results
49 | expire_in: 1 day
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # github-allure-history
2 | Example project using GitHub Actions for Allure report with history on GitHub Pages
3 |
4 | You can see [Allure Report](https://simple-elf.github.io/github-allure-history/) on GitHub Pages
5 |
6 | ## GitHub Actions
7 | Learn how to use GitHub Actions on [official docs](https://docs.github.com/en/actions)
8 |
9 | Here is my advices:
10 | 1. You need to enable actions in '/settings/actions', choosing 'Enable local and third party Actions for this repository'
11 | 2. Create a workflow '*.yml' file in '.gradle/workflows' directory. Example workflow [allure-history.yml](https://github.com/simple-elf/github-allure-history/blob/master/.github/workflows/allure-history.yml)
12 | 3. This workflow uses some GitHub Actions, especially 'allure-report-action'. You can see more about this action on [Marketplace](https://github.com/marketplace/actions/allure-report-with-history)
13 |
14 | ## GitHub Pages
15 | Learn how to use GitHub Pages on [official docs](https://docs.github.com/en/github/working-with-github-pages)
16 |
17 | Here is my advices:
18 | 1. Go to your repository '/settings', scroll down to 'GitHub Pages' section
19 | 2. By default, 'Source' is set to 'None'
20 | 3. Set it to 'gh-pages' branch and '/root' folder
21 | 4. If you don't have 'gh-pages' branch - you can't set it. You need to run workflow even once, and then you have this branch.
22 | 5. After changing settings you can see URL link in 'GitHub Pages' section like this 'Your site is published at ...'
23 | 6. Copy this link to repository details (in 'About' section on repo main page) in WebSite field
24 |
25 | ## Allure Report with history on GitHub Pages
26 | Here is how this works:
27 |
28 | 1. Step 'Get Allure history' in workflow gets previous 'gh-pages' branch state (there is no error if it doesn't exist yet)
29 | 2. Step 'Allure Report action':
30 | 1. Creates temp folder 'allure-history' with a copy of all 'gh-pages' branch files (previous reports)
31 | 2. Get folder 'last-history' from 'gh-pages' branch to 'allure-results' of current build
32 | 3. Generate report with Allure Commandline
33 | 4. Get 'history' folder of current Allure Report to 'last-history' folder for the next build
34 | 5. Copy current Allure Report to folder with current build number
35 | 6. Creates 'index.html' file in root of 'allure-history', that will be redirecting to folder with current build number
36 | 3. Step 'Deploy report to Github Pages' do 'git push' of 'allure-history' folder to 'gh-pages' branch
37 | 4. And then just magic of GitHub Pages deploy happens, you can open root link of GitHub Pages and always see redirect to the last Allure Report
--------------------------------------------------------------------------------
/allure-history-action/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Allure Report with history'
2 | description: 'Generate Allure Report with history'
3 | inputs:
4 | allure_results:
5 | description: 'Allure test result data dir'
6 | required: true
7 | default: 'allure-results'
8 | allure_report:
9 | description: 'Allure report target dir'
10 | required: true
11 | default: 'allure-report'
12 | branch:
13 | description: 'Branch of GitHub Pages'
14 | required: true
15 | default: 'gh-pages'
16 | runs:
17 | using: composite
18 | steps:
19 | - name: Step 1
20 | run: echo 'Composite action'
21 | shell: bash
22 | - name: Step2
23 | run: echo 'Composite action 2'
24 | shell: bash
25 | - id: test_1
26 | name: : test_1
27 | run: ''
28 | shell: ''
29 | uses: actions/checkout@v2
30 |
31 | # - name: Get Allure history
32 | # uses: actions/checkout@v2
33 | # if: always()
34 | # continue-on-error: true
35 | # with:
36 | # ref: ${{ inputs.branch }}
37 | # path: gh-pages
38 | #
39 | # - name: Allure Report action from marketplace
40 | # uses: simple-elf/allure-report-action@v1.1
41 | # if: always()
42 | # #id: allure-report
43 | # with:
44 | # allure_results: ${{ inputs.allure-results }}
45 | # allure_report: allure-report
46 | #
47 | # - name: Deploy report to Github Pages
48 | # if: always()
49 | # uses: peaceiris/actions-gh-pages@v2
50 | # env:
51 | # PERSONAL_TOKEN: ${{ secrets.ACCESS_TOKEN }}
52 | # PUBLISH_BRANCH: ${{ inputs.branch }}
53 | # PUBLISH_DIR: allure-report
54 |
55 |
56 | # - name: Composite Allure Action
57 | # uses: ./allure-history-action
58 | # if: always()
59 | # with:
60 | # allure_results: build/allure-results
61 | # #allure_report: allure-report
62 | # branch: gh-pages
--------------------------------------------------------------------------------
/allure-report-action/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM openjdk:8-jre-alpine
2 |
3 | ARG RELEASE=2.13.9
4 | RUN echo $RELEASE
5 | ARG ALLURE_REPO=https://repo.maven.apache.org/maven2/io/qameta/allure/allure-commandline
6 |
7 | RUN apk update
8 | RUN apk add bash
9 | RUN apk add wget
10 | RUN apk add unzip
11 |
12 | RUN wget --no-verbose -O /tmp/allure-$RELEASE.tgz $ALLURE_REPO/$RELEASE/allure-commandline-$RELEASE.tgz \
13 | && tar -xf /tmp/allure-$RELEASE.tgz \
14 | && rm -rf /tmp/*
15 |
16 | RUN rm -rf /var/cache/apk/*
17 |
18 | RUN chmod -R +x /allure-$RELEASE/bin
19 |
20 | ENV ROOT=/app
21 | ENV PATH=$PATH:/allure-$RELEASE/bin
22 |
23 | RUN mkdir -p $ROOT
24 |
25 | WORKDIR $ROOT
26 | COPY ./entrypoint.sh /entrypoint.sh
27 |
28 | ENTRYPOINT ["/entrypoint.sh"]
--------------------------------------------------------------------------------
/allure-report-action/README.md:
--------------------------------------------------------------------------------
1 | # Allure Report with history action
2 |
3 | Generates Allure Report with history.
4 |
5 | Example workflow file [allure-report](https://github.com/simple-elf/allure-report-action/blob/master/.github/workflows/allure-report.yml)
6 |
7 | ## Inputs
8 |
9 | ### `allure_results`
10 |
11 | **Required** The relative path to the Allure results directory.
12 |
13 | Default `allure-results`
14 |
15 | ### `allure_report`
16 |
17 | **Required** The relative path to the directory where Allure will write the generated report.
18 |
19 | Default `allure-report`
20 |
21 | ### `gh_pages`
22 |
23 | **Required** The relative path to the `gh-pages` branch folder. On first run this folder can be empty.
24 | Also, you need to do a checkout of `gh-pages` branch, even it doesn't exist yet.
25 |
26 | Default `gh-pages`
27 |
28 | ```yaml
29 | - name: Get Allure history
30 | uses: actions/checkout@v2
31 | if: always()
32 | continue-on-error: true
33 | with:
34 | ref: gh-pages
35 | path: gh-pages
36 | ```
37 |
38 | ### `allure_history`
39 |
40 | **Required** The relative path to the folder, that will be published to GitHub Pages.
41 |
42 | Default `allure-history`
43 |
44 | ### `subfolder`
45 |
46 | The relative path to the project folder, if you have few different projects in the repository.
47 | This relative path also will be added to GitHub Pages link. Example project [allure-examples](https://github.com/simple-elf/allure-examples).
48 |
49 | Default ``
50 |
51 | ## Example usage (local action)
52 |
53 | ```yaml
54 | - name: Test local action
55 | uses: ./allure-report-action
56 | if: always()
57 | id: allure-report
58 | with:
59 | allure_results: build/allure-results
60 | gh_pages: gh-pages
61 | allure_report: allure-report
62 | allure_history: allure-history
63 | ```
64 |
65 | ## Example usage (github action)
66 |
67 | ```yaml
68 | - name: Test marketplace action
69 | uses: simple-elf/allure-report-action@master
70 | if: always()
71 | id: allure-report
72 | with:
73 | allure_results: build/allure-results
74 | gh_pages: gh-pages
75 | allure_report: allure-report
76 | allure_history: allure-history
77 | ```
78 |
79 | ## Finally you need to publish on GitHub Pages
80 |
81 | ```yaml
82 | - name: Deploy report to Github Pages
83 | if: always()
84 | uses: peaceiris/actions-gh-pages@v2
85 | env:
86 | PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87 | PUBLISH_BRANCH: gh-pages
88 | PUBLISH_DIR: allure-history
89 | ```
90 |
91 | ## Also you can post the link to the report in the checks section
92 |
93 | ```yaml
94 | - name: Post the link to the report
95 | if: always()
96 | uses: Sibz/github-status-action@v1
97 | with:
98 | authToken: ${{secrets.GITHUB_TOKEN}}
99 | context: 'Test report'
100 | state: 'success'
101 | sha: ${{ github.event.pull_request.head.sha }}
102 | target_url: simple-elf.github.io/github-allure-history/${{ github.run_number }}
103 | ```
104 |
--------------------------------------------------------------------------------
/allure-report-action/action.yml:
--------------------------------------------------------------------------------
1 | name: 'Allure Report with history'
2 | description: 'Generate Allure Report with history'
3 | author: 'simple-elf'
4 | branding:
5 | icon: 'layout'
6 | color: 'green'
7 | inputs:
8 | allure_results:
9 | description: 'Allure test result data dir'
10 | required: true
11 | default: 'allure-results'
12 | allure_report:
13 | description: 'Allure report target dir'
14 | required: true
15 | default: 'allure-report'
16 | gh_pages:
17 | description: 'Folder with gh-pages branch'
18 | required: true
19 | default: 'gh-pages'
20 | allure_history:
21 | description: 'Folder for allure history'
22 | required: true
23 | default: 'allure-history'
24 | subfolder:
25 | description: 'subfolder'
26 | required: false
27 | default: ''
28 | keep_reports:
29 | description: 'Keep X last reports'
30 | required: false
31 | default: '20'
32 | github_run_num:
33 | description: 'GitHub Actions build number'
34 | required: true
35 | default: ${{ github.run_number }}
36 | github_run_id:
37 | description: 'GitHub Actions run id'
38 | required: true
39 | default: ${{ github.run_id }}
40 | github_repo:
41 | description: 'GitHub repository'
42 | required: true
43 | default: ${{ github.repository }}
44 | github_repo_owner:
45 | description: 'GitHub repository owner'
46 | required: true
47 | default: ${{ github.repository_owner }}
48 | runs:
49 | using: 'docker'
50 | image: 'Dockerfile'
--------------------------------------------------------------------------------
/allure-report-action/entrypoint.sh:
--------------------------------------------------------------------------------
1 | #! /usr/bin/env bash
2 |
3 | unset JAVA_HOME
4 |
5 | mkdir -p ./${INPUT_GH_PAGES}
6 | mkdir -p ./${INPUT_ALLURE_HISTORY}
7 | cp -r ./${INPUT_GH_PAGES}/. ./${INPUT_ALLURE_HISTORY}
8 |
9 | REPOSITORY_OWNER_SLASH_NAME=${INPUT_GITHUB_REPO}
10 | REPOSITORY_NAME=${REPOSITORY_OWNER_SLASH_NAME##*/}
11 | GITHUB_PAGES_WEBSITE_URL="https://${INPUT_GITHUB_REPO_OWNER}.github.io/${REPOSITORY_NAME}"
12 | #echo "Github pages url $GITHUB_PAGES_WEBSITE_URL"
13 |
14 | if [[ ${INPUT_SUBFOLDER} != '' ]]; then
15 | INPUT_ALLURE_HISTORY="${INPUT_ALLURE_HISTORY}/${INPUT_SUBFOLDER}"
16 | INPUT_GH_PAGES="${INPUT_GH_PAGES}/${INPUT_SUBFOLDER}"
17 | echo "NEW allure history folder ${INPUT_ALLURE_HISTORY}"
18 | mkdir -p ./${INPUT_ALLURE_HISTORY}
19 | GITHUB_PAGES_WEBSITE_URL="${GITHUB_PAGES_WEBSITE_URL}/${INPUT_SUBFOLDER}"
20 | echo "NEW github pages url ${GITHUB_PAGES_WEBSITE_URL}"
21 | fi
22 |
23 | COUNT=$( ( ls ./${INPUT_ALLURE_HISTORY} | wc -l ) )
24 | echo "count folders in allure-history: ${COUNT}"
25 | echo "keep reports count ${INPUT_KEEP_REPORTS}"
26 | INPUT_KEEP_REPORTS=$((INPUT_KEEP_REPORTS+1))
27 | echo "if ${COUNT} > ${INPUT_KEEP_REPORTS}"
28 | if (( COUNT > INPUT_KEEP_REPORTS )); then
29 | cd ./${INPUT_ALLURE_HISTORY}
30 | echo "remove index.html last-history"
31 | rm index.html last-history -rv
32 | echo "remove old reports"
33 | ls | sort -n | head -n -$((${INPUT_KEEP_REPORTS}-2)) | xargs rm -rv;
34 | cd ${GITHUB_WORKSPACE}
35 | fi
36 |
37 | #echo "index.html"
38 | echo "" > ./${INPUT_ALLURE_HISTORY}/index.html # path
39 | echo "" >> ./${INPUT_ALLURE_HISTORY}/index.html
40 | #cat ./${INPUT_ALLURE_HISTORY}/index.html
41 |
42 | #echo "executor.json"
43 | echo '{"name":"GitHub Actions","type":"github","reportName":"Allure Report with history",' > executor.json
44 | echo "\"url\":\"${GITHUB_PAGES_WEBSITE_URL}\"," >> executor.json # ???
45 | echo "\"reportUrl\":\"${GITHUB_PAGES_WEBSITE_URL}/${INPUT_GITHUB_RUN_NUM}/\"," >> executor.json
46 | echo "\"buildUrl\":\"https://github.com/${INPUT_GITHUB_REPO}/actions/runs/${INPUT_GITHUB_RUN_ID}\"," >> executor.json
47 | echo "\"buildName\":\"GitHub Actions Run #${INPUT_GITHUB_RUN_ID}\",\"buildOrder\":\"${INPUT_GITHUB_RUN_NUM}\"}" >> executor.json
48 | #cat executor.json
49 | mv ./executor.json ./${INPUT_ALLURE_RESULTS}
50 |
51 | #environment.properties
52 | echo "URL=${GITHUB_PAGES_WEBSITE_URL}" > environment.properties
53 | mv ./environment.properties ./${INPUT_ALLURE_RESULTS}
54 |
55 | echo "keep allure history from ${INPUT_GH_PAGES}/last-history to ${INPUT_ALLURE_RESULTS}/history"
56 | cp -r ./${INPUT_GH_PAGES}/last-history/. ./${INPUT_ALLURE_RESULTS}/history
57 |
58 | echo "generating report from ${INPUT_ALLURE_RESULTS} to ${INPUT_ALLURE_REPORT} ..."
59 | #ls -l ${INPUT_ALLURE_RESULTS}
60 | allure generate --clean ${INPUT_ALLURE_RESULTS} -o ${INPUT_ALLURE_REPORT}
61 | #echo "listing report directory ..."
62 | #ls -l ${INPUT_ALLURE_REPORT}
63 |
64 | echo "copy allure-report to ${INPUT_ALLURE_HISTORY}/${INPUT_GITHUB_RUN_NUM}"
65 | cp -r ./${INPUT_ALLURE_REPORT}/. ./${INPUT_ALLURE_HISTORY}/${INPUT_GITHUB_RUN_NUM}
66 | echo "copy allure-report history to /${INPUT_ALLURE_HISTORY}/last-history"
67 | cp -r ./${INPUT_ALLURE_REPORT}/history/. ./${INPUT_ALLURE_HISTORY}/last-history
--------------------------------------------------------------------------------
/allure-template.yml:
--------------------------------------------------------------------------------
1 | allure-history:
2 | stage: history
3 | image: storytel/alpine-bash-curl
4 | script:
5 | - apk add unzip
6 | - 'curl --location --output artifacts.zip "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/jobs/artifacts/master/download?job=pages&job_token=${CI_JOB_TOKEN}"'
7 | - unzip artifacts.zip
8 | - chmod -R 777 public
9 | - cp -r ./public/history ./build/allure-results
10 | - echo '{"name":"GitLab CI","type":"gitlab"}' > ./build/allure-results/executor.json
11 | - echo "URL=${CI_PAGES_URL}" > ./build/allure-results/environment.properties
12 | allow_failure: true
13 | artifacts:
14 | paths:
15 | - ./build/allure-results
16 | expire_in: 1 day
17 | rules:
18 | - when: always
19 |
20 | allure-report:
21 | stage: allure
22 | #image: frankescobar/allure-docker-service
23 | image: simple1elf/allure-docker
24 | script:
25 | - allure generate -c ./build/allure-results -o ./allure-report
26 | artifacts:
27 | paths:
28 | - ./build/allure-results
29 | - ./allure-report
30 | expire_in: 1 day
31 | rules:
32 | - when: always
33 |
34 | pages:
35 | stage: deploy
36 | script:
37 | - mv ./allure-report/ public/
38 | artifacts:
39 | paths:
40 | - public
41 | rules:
42 | - when: always
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | plugins {
2 | id 'java'
3 | id 'maven'
4 | id 'io.qameta.allure' version '2.8.1'
5 | }
6 |
7 | group 'io.qameta.allure.examples'
8 | version '1.1'
9 |
10 | def allureVersion = "2.13.5"
11 | def junit5Version = "5.6.2"
12 |
13 | compileJava.options.encoding = "UTF-8"
14 | compileTestJava.options.encoding = "UTF-8"
15 |
16 | allure {
17 | autoconfigure = true
18 | aspectjweaver = true
19 | version = allureVersion
20 |
21 | clean = true
22 |
23 | useJUnit5 {
24 | version = allureVersion
25 | }
26 | }
27 |
28 | test {
29 | ignoreFailures = true
30 | useJUnitPlatform {
31 |
32 | }
33 |
34 | systemProperty("junit.jupiter.execution.parallel.enabled", "true")
35 | systemProperty("junit.jupiter.execution.parallel.config.strategy", "dynamic")
36 | systemProperty("junit.jupiter.extensions.autodetection.enabled", "true")
37 | }
38 |
39 | repositories {
40 | mavenCentral()
41 | mavenLocal()
42 | }
43 |
44 | dependencies {
45 | implementation('commons-io:commons-io:2.6')
46 |
47 | implementation("io.qameta.allure:allure-java-commons:$allureVersion")
48 | implementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
49 | implementation("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
50 | implementation("org.junit.jupiter:junit-jupiter-params:$junit5Version")
51 | }
52 |
--------------------------------------------------------------------------------
/generate.bat:
--------------------------------------------------------------------------------
1 | .allure/allure-2.13.3/bin/allure.bat generate -c build/allure-results -o build/reports/allure-report
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/simple-elf/github-allure-history/991ff9f2e4d729d053e26eb00441497e30c80bb0/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env sh
2 |
3 | #
4 | # Copyright 2015 the original author or authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | ##
21 | ## Gradle start up script for UN*X
22 | ##
23 | ##############################################################################
24 |
25 | # Attempt to set APP_HOME
26 | # Resolve links: $0 may be a link
27 | PRG="$0"
28 | # Need this for relative symlinks.
29 | while [ -h "$PRG" ] ; do
30 | ls=`ls -ld "$PRG"`
31 | link=`expr "$ls" : '.*-> \(.*\)$'`
32 | if expr "$link" : '/.*' > /dev/null; then
33 | PRG="$link"
34 | else
35 | PRG=`dirname "$PRG"`"/$link"
36 | fi
37 | done
38 | SAVED="`pwd`"
39 | cd "`dirname \"$PRG\"`/" >/dev/null
40 | APP_HOME="`pwd -P`"
41 | cd "$SAVED" >/dev/null
42 |
43 | APP_NAME="Gradle"
44 | APP_BASE_NAME=`basename "$0"`
45 |
46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
48 |
49 | # Use the maximum available, or set MAX_FD != -1 to use that value.
50 | MAX_FD="maximum"
51 |
52 | warn () {
53 | echo "$*"
54 | }
55 |
56 | die () {
57 | echo
58 | echo "$*"
59 | echo
60 | exit 1
61 | }
62 |
63 | # OS specific support (must be 'true' or 'false').
64 | cygwin=false
65 | msys=false
66 | darwin=false
67 | nonstop=false
68 | case "`uname`" in
69 | CYGWIN* )
70 | cygwin=true
71 | ;;
72 | Darwin* )
73 | darwin=true
74 | ;;
75 | MINGW* )
76 | msys=true
77 | ;;
78 | NONSTOP* )
79 | nonstop=true
80 | ;;
81 | esac
82 |
83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
84 |
85 |
86 | # Determine the Java command to use to start the JVM.
87 | if [ -n "$JAVA_HOME" ] ; then
88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
89 | # IBM's JDK on AIX uses strange locations for the executables
90 | JAVACMD="$JAVA_HOME/jre/sh/java"
91 | else
92 | JAVACMD="$JAVA_HOME/bin/java"
93 | fi
94 | if [ ! -x "$JAVACMD" ] ; then
95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
96 |
97 | Please set the JAVA_HOME variable in your environment to match the
98 | location of your Java installation."
99 | fi
100 | else
101 | JAVACMD="java"
102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
103 |
104 | Please set the JAVA_HOME variable in your environment to match the
105 | location of your Java installation."
106 | fi
107 |
108 | # Increase the maximum file descriptors if we can.
109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
110 | MAX_FD_LIMIT=`ulimit -H -n`
111 | if [ $? -eq 0 ] ; then
112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
113 | MAX_FD="$MAX_FD_LIMIT"
114 | fi
115 | ulimit -n $MAX_FD
116 | if [ $? -ne 0 ] ; then
117 | warn "Could not set maximum file descriptor limit: $MAX_FD"
118 | fi
119 | else
120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
121 | fi
122 | fi
123 |
124 | # For Darwin, add options to specify how the application appears in the dock
125 | if $darwin; then
126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
127 | fi
128 |
129 | # For Cygwin or MSYS, switch paths to Windows format before running java
130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133 |
134 | JAVACMD=`cygpath --unix "$JAVACMD"`
135 |
136 | # We build the pattern for arguments to be converted via cygpath
137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
138 | SEP=""
139 | for dir in $ROOTDIRSRAW ; do
140 | ROOTDIRS="$ROOTDIRS$SEP$dir"
141 | SEP="|"
142 | done
143 | OURCYGPATTERN="(^($ROOTDIRS))"
144 | # Add a user-defined pattern to the cygpath arguments
145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
147 | fi
148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
149 | i=0
150 | for arg in "$@" ; do
151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
153 |
154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
156 | else
157 | eval `echo args$i`="\"$arg\""
158 | fi
159 | i=`expr $i + 1`
160 | done
161 | case $i in
162 | 0) set -- ;;
163 | 1) set -- "$args0" ;;
164 | 2) set -- "$args0" "$args1" ;;
165 | 3) set -- "$args0" "$args1" "$args2" ;;
166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
172 | esac
173 | fi
174 |
175 | # Escape application args
176 | save () {
177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
178 | echo " "
179 | }
180 | APP_ARGS=`save "$@"`
181 |
182 | # Collect all arguments for the java command, following the shell quoting and substitution rules
183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
184 |
185 | exec "$JAVACMD" "$@"
186 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto init
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto init
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :init
68 | @rem Get command-line arguments, handling Windows variants
69 |
70 | if not "%OS%" == "Windows_NT" goto win9xME_args
71 |
72 | :win9xME_args
73 | @rem Slurp the command line arguments.
74 | set CMD_LINE_ARGS=
75 | set _SKIP=2
76 |
77 | :win9xME_args_slurp
78 | if "x%~1" == "x" goto execute
79 |
80 | set CMD_LINE_ARGS=%*
81 |
82 | :execute
83 | @rem Setup the command line
84 |
85 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
86 |
87 |
88 | @rem Execute Gradle
89 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
90 |
91 | :end
92 | @rem End local scope for the variables with windows NT shell
93 | if "%ERRORLEVEL%"=="0" goto mainEnd
94 |
95 | :fail
96 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
97 | rem the _cmd.exe /c_ return code!
98 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
99 | exit /b 1
100 |
101 | :mainEnd
102 | if "%OS%"=="Windows_NT" endlocal
103 |
104 | :omega
105 |
--------------------------------------------------------------------------------
/old.workflow.yml:
--------------------------------------------------------------------------------
1 | - run: mkdir -p allure-history #
2 | - name: executor.json #
3 | run: |
4 | REPOSITORY_OWNER_SLASH_NAME="${{ github.repository }}"
5 | REPOSITORY_NAME=${REPOSITORY_OWNER_SLASH_NAME##*/}
6 | GITHUB_PAGES_WEBSITE_URL="https://${{ github.repository_owner }}.github.io/${REPOSITORY_NAME}"
7 | echo '{"name":"GitHub Actions","type":"github","reportName":"Allure Report with history",' > executor.json
8 | echo "\"url\":\"${GITHUB_PAGES_WEBSITE_URL}\"," >> executor.json
9 | echo '"buildName":"GitHub Actions Run #${{ github.run_id }}","buildOrder":"${{ github.run_number }}",' >> executor.json
10 | echo "\"reportUrl\":\"${GITHUB_PAGES_WEBSITE_URL}/${{ github.run_number }}\"," >> executor.json
11 | echo '"buildUrl":"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' >> executor.json
12 | cat executor.json
13 | echo "" > index.html
14 | cat index.html
15 |
16 | - run: mv $(pwd)/executor.json $(pwd)/build/allure-results #
17 | - name: Keep Allure history
18 | run: cp -r $(pwd)/gh-pages/history/. $(pwd)/build/allure-results/history
19 | continue-on-error: true
20 |
21 | # for next action
22 | - run: mv $(pwd)/build/allure-results $(pwd)/allure-results
23 | - name: Generate Allure report
24 | if: always()
25 | uses: afiore/action-allure-report@v0.1.0
26 | continue-on-error: true
27 |
28 | - run: cp -r $(pwd)/gh-pages/. $(pwd)/allure-history #
29 | #- run: cp -r $(pwd)/allure-report/. $(pwd)/allure-history
30 | - run: cp -r $(pwd)/allure-report/. $(pwd)/allure-history/${{ github.run_number }} #
31 | - run: cp -r $(pwd)/allure-report/history/. $(pwd)/allure-history/history #
32 | - run: cp -r $(pwd)/index.html $(pwd)/allure-history #
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'github-allure-history'
2 |
3 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/JiraIssue.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import io.qameta.allure.LabelAnnotation;
4 |
5 | import java.lang.annotation.*;
6 |
7 | /**
8 | * @author eroshenkoam (Artem Eroshenko).
9 | */
10 | @Documented
11 | @Inherited
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target({ElementType.METHOD, ElementType.TYPE})
14 | @Repeatable(io.qameta.allure.examples.JiraIssues.class)
15 | @LabelAnnotation(name = "jira")
16 | public @interface JiraIssue {
17 |
18 | String value();
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/JiraIssues.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import java.lang.annotation.*;
4 |
5 | /**
6 | * @author eroshenkoam (Artem Eroshenko).
7 | */
8 | @Documented
9 | @Inherited
10 | @Retention(RetentionPolicy.RUNTIME)
11 | @Target({ElementType.METHOD, ElementType.TYPE})
12 | public @interface JiraIssues {
13 |
14 | JiraIssue[] value();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/Layer.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import io.qameta.allure.LabelAnnotation;
4 |
5 | import java.lang.annotation.*;
6 |
7 | /**
8 | * @author eroshenkoam (Artem Eroshenko).
9 | */
10 | @Documented
11 | @Inherited
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target({ElementType.METHOD, ElementType.TYPE})
14 | @LabelAnnotation(name = "layer")
15 | public @interface Layer {
16 |
17 | String value();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/Lead.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import io.qameta.allure.LabelAnnotation;
4 |
5 | import java.lang.annotation.*;
6 |
7 | /**
8 | * @author eroshenkoam (Artem Eroshenko).
9 | */
10 | @Documented
11 | @Inherited
12 | @Retention(RetentionPolicy.RUNTIME)
13 | @Target({ElementType.METHOD, ElementType.TYPE})
14 | @LabelAnnotation(name = "lead")
15 | public @interface Lead {
16 |
17 | String value();
18 |
19 | }
20 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/PagePath.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import io.qameta.allure.LabelAnnotation;
4 |
5 | import java.lang.annotation.*;
6 |
7 | @Documented
8 | @Inherited
9 | @Retention(RetentionPolicy.RUNTIME)
10 | @Target({ElementType.METHOD, ElementType.TYPE})
11 | @LabelAnnotation(name = "page")
12 | public @interface PagePath {
13 |
14 | String value();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/RestSteps.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import io.qameta.allure.Step;
4 |
5 | import static io.qameta.allure.Allure.step;
6 |
7 | public class RestSteps {
8 |
9 | @Step("Create issue with title `{title}`")
10 | public void createIssueWithTitle(final String owner, final String repo, final String title) {
11 | step(String.format("POST /repos/%s/%s/issues", owner, repo));
12 | }
13 |
14 | @Step("Close issue with title `{title}`")
15 | public void closeIssueWithTitle(final String owner, final String repo, final String title) {
16 | step(String.format("GET /repos/%s/%s/issues?text=%s", owner, repo, title));
17 | step(String.format("PATCH /repos/%s/%s/issues/%s", owner, repo, 10));
18 | }
19 |
20 | @Step("Check note with content `{title}` exists")
21 | public void shouldSeeIssueWithTitle(final String owner, final String repo, final String title) {
22 | step(String.format("GET /repos/%s/%s/issues?text=%s", owner, repo, title));
23 | step(String.format("GET /repos/%s/%s/issues/%s", owner, repo, 10));
24 | }
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/UrlPath.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import io.qameta.allure.LabelAnnotation;
4 |
5 | import java.lang.annotation.*;
6 |
7 | @Documented
8 | @Inherited
9 | @Retention(RetentionPolicy.RUNTIME)
10 | @Target({ElementType.METHOD, ElementType.TYPE})
11 | @LabelAnnotation(name = "url")
12 | public @interface UrlPath {
13 |
14 | String value();
15 |
16 | }
17 |
--------------------------------------------------------------------------------
/src/main/java/io/qameta/allure/examples/WebSteps.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples;
2 |
3 | import io.qameta.allure.Attachment;
4 | import io.qameta.allure.Step;
5 | import org.apache.commons.io.IOUtils;
6 |
7 | import java.io.IOException;
8 | import java.io.InputStream;
9 | import java.nio.charset.Charset;
10 | import java.util.Random;
11 |
12 | import static org.junit.jupiter.api.Assertions.assertEquals;
13 |
14 | /**
15 | * @author eroshenkoam (Artem Eroshenko).
16 | */
17 | public class WebSteps {
18 |
19 | @Step("Starting web driver")
20 | public void startDriver() {
21 | maybeThrowSeleniumTimeoutException();
22 | }
23 |
24 | @Step("Stopping web driver")
25 | public void stopDriver() {
26 | maybeThrowSeleniumTimeoutException();
27 | }
28 |
29 | @Step("Open issues page `{owner}/{repo}`")
30 | public void openIssuesPage(final String owner, final String repo) {
31 | attachPageSource();
32 | maybeThrowElementNotFoundException();
33 | }
34 |
35 | @Step("Open pull requests page `{owner}/{repo}`")
36 | public void openPullRequestsPage(final String owner, final String repo) {
37 | attachPageSource();
38 | maybeThrowElementNotFoundException();
39 | }
40 |
41 | @Step("Create pull request from branch `{branch}`")
42 | public void createPullRequestFromBranch(final String branch) {
43 | maybeThrowElementNotFoundException();
44 | }
45 |
46 | @Step("Create issue with title `{title}`")
47 | public void createIssueWithTitle(String title) {
48 | maybeThrowAssertionException(title);
49 | }
50 |
51 | @Step("Close pull request for branch `{branch}`")
52 | public void closePullRequestForBranch(final String branch) {
53 | maybeThrowAssertionException(branch);
54 | }
55 |
56 | @Step("Close issue with title `{title}`")
57 | public void closeIssueWithTitle(final String title) {
58 | maybeThrowAssertionException(title);
59 | }
60 |
61 | @Step("Check pull request for branch `{branch}` exists")
62 | public void shouldSeePullRequestForBranch(final String branch) {
63 | maybeThrowAssertionException(branch);
64 | }
65 |
66 | @Step("Check issue with title `{title}` exists")
67 | public void shouldSeeIssueWithTitle(final String title) {
68 | maybeThrowAssertionException(title);
69 | }
70 |
71 | @Step("Check pull request for branch `{branch}` not exists")
72 | public void shouldNotSeePullRequestForBranch(final String branch) {
73 | maybeThrowAssertionException(branch);
74 | }
75 |
76 | @Step("Check issue with title `{title}` not exists")
77 | public void shouldNotSeeIssueWithTitle(final String title) {
78 | maybeThrowAssertionException(title);
79 | }
80 |
81 | @Attachment(value = "Page", type = "text/html", fileExtension = "html")
82 | public byte[] attachPageSource() {
83 | try {
84 | final InputStream stream = ClassLoader.getSystemResourceAsStream("index.html");
85 | return IOUtils.toString(stream, Charset.forName("UTF-8")).getBytes();
86 | } catch (IOException e) {
87 | throw new RuntimeException(e);
88 | }
89 | }
90 |
91 | private void maybeThrowSeleniumTimeoutException() {
92 | if (isTimeToThrowException()) {
93 | throw new RuntimeException("Selenium timeout: selenium unavailable now");
94 | }
95 | }
96 |
97 | private void maybeThrowElementNotFoundException() {
98 | try {
99 | Thread.sleep(1000);
100 | if (isTimeToThrowException()) {
101 | throw new RuntimeException("Element not found for xpath [//div[@class='something']]");
102 | }
103 | } catch (InterruptedException e) {
104 | //do nothing, it's dummy test
105 | }
106 | }
107 |
108 | private void maybeThrowAssertionException(String text) {
109 | if (isTimeToThrowException()) {
110 | assertEquals(text, "another text");
111 | }
112 | }
113 |
114 | private boolean isTimeToThrowException() {
115 | return new Random().nextBoolean()
116 | && new Random().nextBoolean()
117 | && new Random().nextBoolean()
118 | && new Random().nextBoolean();
119 | }
120 | }
121 |
--------------------------------------------------------------------------------
/src/test/java/io/qameta/allure/examples/junit5/IssuesRestTest.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples.junit5;
2 |
3 | import io.qameta.allure.Feature;
4 | import io.qameta.allure.Owner;
5 | import io.qameta.allure.Story;
6 | import io.qameta.allure.examples.*;
7 | import org.junit.jupiter.api.Tag;
8 | import org.junit.jupiter.api.Tags;
9 | import org.junit.jupiter.params.ParameterizedTest;
10 | import org.junit.jupiter.params.provider.ValueSource;
11 |
12 | import static io.qameta.allure.Allure.parameter;
13 |
14 | @Layer("rest")
15 | @Owner("baev2")
16 | @Feature("Issues")
17 | @UrlPath("/repos/{owner}/{repo}/issues")
18 | public class IssuesRestTest {
19 |
20 | private static final String OWNER = "allure-framework";
21 | private static final String REPO = "allure2";
22 |
23 | private final RestSteps steps = new RestSteps();
24 |
25 | @Story("Create new issue")
26 | @Tags({@Tag("api"), @Tag("smoke")})
27 | @ParameterizedTest(name = "Create issue via api")
28 | @ValueSource(strings = {"First Note", "Second Note"})
29 | public void shouldCreateUserNote(String title) {
30 | parameter("owner", OWNER);
31 | parameter("repo", REPO);
32 | parameter("title", title);
33 |
34 | steps.createIssueWithTitle(OWNER, REPO, title);
35 | steps.shouldSeeIssueWithTitle(OWNER, REPO, title);
36 | }
37 |
38 | @Story("Close existing issue")
39 | @Tags({@Tag("web"), @Tag("regress")})
40 | @JiraIssues({@JiraIssue("AE-1")})
41 | @ParameterizedTest(name = "Close issue via api")
42 | @ValueSource(strings = {"First Note", "Second Note"})
43 | public void shouldDeleteUserNote(String title) {
44 | parameter("owner", OWNER);
45 | parameter("repo", REPO);
46 | parameter("title", title);
47 |
48 | steps.createIssueWithTitle(OWNER, REPO, title);
49 | steps.closeIssueWithTitle(OWNER, REPO, title);
50 | }
51 |
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/test/java/io/qameta/allure/examples/junit5/IssuesWebTest.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples.junit5;
2 |
3 | import io.qameta.allure.Feature;
4 | import io.qameta.allure.Owner;
5 | import io.qameta.allure.Story;
6 | import io.qameta.allure.examples.*;
7 | import org.junit.jupiter.api.*;
8 |
9 | /**
10 | * @author eroshenkoam (Artem Eroshenko).
11 | */
12 | @Layer("web")
13 | @Owner("eroshenkoam")
14 | @Feature("Issues")
15 | @PagePath("/{org}/{repo}/issues")
16 | public class IssuesWebTest {
17 |
18 | private static final String OWNER = "allure-framework";
19 | private static final String REPO = "allure2";
20 |
21 | private static final String ISSUE_TITLE = "Some issue title here";
22 |
23 | private final WebSteps steps = new WebSteps();
24 |
25 | @BeforeEach
26 | public void startDriver() {
27 | steps.startDriver();
28 | }
29 |
30 | @Test
31 | @Story("Create new issue")
32 | @JiraIssues({@JiraIssue("AE-2")})
33 | @Tags({@Tag("web"), @Tag("critical")})
34 | @DisplayName("Create new issue authorized user")
35 | public void shouldCreateIssue() {
36 | steps.openIssuesPage(OWNER, REPO);
37 | steps.createIssueWithTitle(ISSUE_TITLE);
38 | steps.shouldSeeIssueWithTitle(ISSUE_TITLE);
39 | }
40 |
41 | @Test
42 | @Story("Create new issue")
43 | @Tags({@Tag("web"), @Tag("regress")})
44 | @JiraIssues({@JiraIssue("AE-1")})
45 | @DisplayName("Create new issue with labels")
46 | public void shouldAddLabelToIssue() {
47 | steps.openIssuesPage(OWNER, REPO);
48 | steps.createIssueWithTitle(ISSUE_TITLE);
49 | steps.shouldSeeIssueWithTitle(ISSUE_TITLE);
50 | }
51 |
52 | @Test
53 | @Story("Close existing issue")
54 | @Tags({@Tag("web"), @Tag("regress")})
55 | @JiraIssues({@JiraIssue("AE-1")})
56 | @DisplayName("Close new issue for authorized user")
57 | public void shouldCloseIssue() {
58 | steps.openIssuesPage(OWNER, REPO);
59 | steps.createIssueWithTitle(ISSUE_TITLE);
60 | steps.closeIssueWithTitle(ISSUE_TITLE);
61 | steps.shouldNotSeeIssueWithTitle(ISSUE_TITLE);
62 | }
63 |
64 | @AfterEach
65 | public void stopDriver() {
66 | steps.stopDriver();
67 | }
68 |
69 | }
--------------------------------------------------------------------------------
/src/test/java/io/qameta/allure/examples/junit5/PullRequestsWebTest.java:
--------------------------------------------------------------------------------
1 | package io.qameta.allure.examples.junit5;
2 |
3 | import io.qameta.allure.Feature;
4 | import io.qameta.allure.Owner;
5 | import io.qameta.allure.Story;
6 | import io.qameta.allure.examples.*;
7 | import org.junit.jupiter.api.*;
8 |
9 | /**
10 | * @author eroshenkoam (Artem Eroshenko).
11 | */
12 | @Layer("web")
13 | @Owner("eroshenkoam")
14 | @Feature("Pull Requests")
15 | @PagePath("/{org}/{repo}/pulls")
16 | public class PullRequestsWebTest {
17 |
18 | private static final String OWNER = "allure-framework";
19 | private static final String REPO = "allure2";
20 |
21 | private static final String BRANCH = "new-feature";
22 |
23 | private final WebSteps steps = new WebSteps();
24 |
25 | @BeforeEach
26 | public void startDriver() {
27 | steps.startDriver();
28 | }
29 |
30 | @Test
31 | @Story("Create new pull request")
32 | @Tags({@Tag("web"), @Tag("regress"), @Tag("smoke")})
33 | @JiraIssues({@JiraIssue("AE-1"), @JiraIssue("AE-2")})
34 | @DisplayName("Create new pull request for authorized user")
35 | public void shouldCreatePullRequest() {
36 | steps.openPullRequestsPage(OWNER, REPO);
37 | steps.createPullRequestFromBranch(BRANCH);
38 | steps.shouldSeePullRequestForBranch(BRANCH);
39 | }
40 |
41 | @Test
42 | @JiraIssue("AE-2")
43 | @Story("Close existing pull request")
44 | @Tags({@Tag("web"), @Tag("regress")})
45 | @DisplayName("Close existing pull request for authorized user")
46 | public void shouldClosePullRequest() {
47 | steps.openPullRequestsPage(OWNER, REPO);
48 | steps.createPullRequestFromBranch(BRANCH);
49 | steps.closePullRequestForBranch(BRANCH);
50 | steps.shouldNotSeePullRequestForBranch(BRANCH);
51 | }
52 |
53 | @AfterEach
54 | public void stopDriver() {
55 | steps.stopDriver();
56 | }
57 |
58 | }
--------------------------------------------------------------------------------
/src/test/resources/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Test Cases
5 |
7 |
8 |
9 |
10 |
11 |
Test Cases
12 |
AE-5 Добавление в избранное после создания заметки
13 |
14 | - Features
15 | - "Favorites", "Notes"
16 | - Stories
17 | - "Add to favorites after adding note"
18 |
19 |
Scenario
20 |
21 | - Открываем главную страницу
22 | - Открываем страницу машины марки {mark}
23 | - Добавляем заметку {text} к машине
24 | - Открываем страницу избранного
25 | - Проверяем что марка {mark} находится в избранных
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------