├── .gitlab-ci.yml ├── LICENSE ├── README.md ├── pom-allure-cli.xml ├── pom-allure-maven-plugin.xml └── scripts ├── allure-maven-plugin.sh ├── allure.sh └── index.html /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - pages 3 | 4 | cache: 5 | paths: 6 | - public/history 7 | - public/ 8 | 9 | pages: 10 | stage: pages 11 | script: 12 | - scripts/allure.sh 13 | artifacts: 14 | paths: 15 | - public 16 | when: on_success -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Phoenix124 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Generate allure report (6 pipelines history) for gitlab pages 2 | 3 | 1. change `allure.sh` - change ``, make them script `chmod +x`. 4 | 2. add stage to your `pages`. 5 | 6 | You could make PR, to make script more comfortable 7 | -------------------------------------------------------------------------------- /pom-allure-cli.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | 3.6.0 9 | 10 | 11 | tests 12 | ios 13 | 1.0.0 14 | jar 15 | 16 | 17 | 18 | maven-central-repository 19 | Maven Central Repository 20 | http://central.maven.org/maven2/ 21 | 22 | 23 | maven-central-repository-mirror 24 | Maven Central Mirror 25 | http://repo1.maven.org/maven2/ 26 | 27 | 28 | jitpack.io 29 | https://jitpack.io 30 | 31 | 32 | 33 | 34 | UTF-8 35 | 1.8 36 | 37 | 3.0.0-M3 38 | 3.8.1 39 | 40 | 7.3.0 41 | 7.1.0 42 | 43 | 2.13.2 44 | 45 | 4.1.45.Final 46 | 3.8.1 47 | 48 | 2.13.3 49 | 2.10.0 50 | 2.7.0 51 | 1.9.5 52 | 9.4.14.v20181114 53 | 54 | 1.0.2 55 | 20190722 56 | 1.1.1 57 | 1.3 58 | 4.3.0-1 59 | 1.6.2 60 | 1.11.3 61 | 62 | 1 63 | exclude 64 | 65 | 66 | 67 | 68 | io.appium 69 | java-client 70 | ${appium.version} 71 | 72 | 73 | org.testng 74 | testng 75 | ${testng.version} 76 | 77 | 78 | org.apache.logging.log4j 79 | log4j-slf4j-impl 80 | ${log4j2.slf4j.version} 81 | 82 | 83 | io.github.bonigarcia 84 | webdrivermanager 85 | ${webdrivermanager.version} 86 | test 87 | 88 | 89 | * 90 | * 91 | 92 | 93 | 94 | 95 | io.netty 96 | netty-all 97 | ${io.netty.version} 98 | 99 | 100 | io.qameta.allure 101 | allure-testng 102 | ${allure.testng.version} 103 | 104 | 105 | org.testng 106 | testng 107 | 108 | 109 | org.slf4j 110 | * 111 | 112 | 113 | 114 | 115 | com.github.mifmif 116 | generex 117 | ${generex.version} 118 | 119 | 120 | org.openpnp 121 | opencv 122 | ${opencv.version} 123 | 124 | 125 | org.json 126 | json 127 | ${json.version} 128 | 129 | 130 | org.hamcrest 131 | hamcrest-all 132 | ${hamcrest.version} 133 | 134 | 135 | com.googlecode.json-simple 136 | json-simple 137 | ${json.simple.version} 138 | 139 | 140 | com.sun.mail 141 | javax.mail 142 | ${java.mail.version} 143 | 144 | 145 | org.jsoup 146 | jsoup 147 | ${jsoup.version} 148 | 149 | 150 | 151 | 152 | 153 | org.apache.maven.plugins 154 | maven-surefire-plugin 155 | ${maven.surefire.version} 156 | 157 | methods 158 | ${threadCount} 159 | ${threadCount} 160 | 161 | src/test/resources/testng.xml 162 | 163 | true 164 | 165 | -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" 166 | 167 | ${exclude.tag} 168 | 169 | 170 | 171 | org.aspectj 172 | aspectjweaver 173 | ${aspectj.version} 174 | 175 | 176 | 177 | 178 | org.apache.maven.plugins 179 | maven-compiler-plugin 180 | ${maven.compiler.version} 181 | 182 | ${compiler.version} 183 | ${compiler.version} 184 | ${project.build.sourceEncoding} 185 | 186 | 187 | 188 | 189 | 190 | 191 | true 192 | 193 | 194 | io.qameta.allure 195 | allure-maven 196 | ${allure.maven.plugin.version} 197 | 198 | 199 | 200 | 201 | -------------------------------------------------------------------------------- /pom-allure-maven-plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | 3.6.3 9 | 10 | 11 | ms.express 12 | tests 13 | 0.0.1-SNAPSHOT 14 | jar 15 | 16 | 17 | 18 | maven-central-repository 19 | Maven Central Repository 20 | http://central.maven.org/maven2/ 21 | 22 | 23 | maven-central-repository-mirror 24 | Maven Central Mirror 25 | http://repo1.maven.org/maven2/ 26 | 27 | 28 | 29 | 30 | UTF-8 31 | 8 32 | 33 | 3.0.0-M3 34 | 3.8.1 35 | 36 | 3.141.59 37 | 1.20.0 38 | 7.1.0 39 | 3.8.1 40 | 5.13.0 41 | 42 | 4.0.0.Alpha8 43 | 44 | 2.13.3 45 | 2.10.0 46 | 1.9.5 47 | 2.0.0-alpha1 48 | 49 | 2.11.1 50 | 1.1.1 51 | 1.3 52 | 53 | 1 54 | exclude 55 | 56 | 57 | 58 | 59 | org.seleniumhq.selenium 60 | selenium-java 61 | ${selenium.version} 62 | 63 | 64 | org.slf4j 65 | * 66 | 67 | 68 | 69 | 70 | io.github.bonigarcia 71 | webdrivermanager 72 | ${webdrivermanager.version} 73 | 74 | 75 | org.testng 76 | testng 77 | ${testng.version} 78 | 79 | 80 | org.slf4j 81 | * 82 | 83 | 84 | 85 | 86 | io.qameta.allure 87 | allure-testng 88 | ${allure.testng.version} 89 | 90 | 91 | org.testng 92 | testng 93 | 94 | 95 | 96 | 97 | org.slf4j 98 | slf4j-api 99 | ${slf4j.version} 100 | 101 | 102 | org.slf4j 103 | slf4j-log4j12 104 | ${slf4j.version} 105 | 106 | 107 | io.netty 108 | netty 109 | ${io.netty.version} 110 | 111 | 112 | com.fasterxml.jackson.dataformat 113 | jackson-dataformat-xml 114 | ${jackson.version} 115 | 116 | 117 | com.googlecode.json-simple 118 | json-simple 119 | ${json.simple.version} 120 | 121 | 122 | org.hamcrest 123 | hamcrest-all 124 | ${hamcrest.version} 125 | 126 | 127 | 128 | 129 | 130 | 131 | org.apache.maven.plugins 132 | maven-surefire-plugin 133 | ${maven.surefire.version} 134 | 135 | 2C 136 | true 137 | tests 138 | ${threadCount} 139 | true 140 | -Xmx1024m 141 | 142 | src/test/resources/testng.xml 143 | 144 | true 145 | 146 | -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar" 147 | 148 | ${exclude.tag} 149 | 150 | 151 | 152 | org.aspectj 153 | aspectjweaver 154 | ${aspectj.version} 155 | 156 | 157 | 158 | 159 | org.apache.maven.plugins 160 | maven-compiler-plugin 161 | ${maven.compiler.version} 162 | 163 | ${compiler.version} 164 | ${compiler.version} 165 | ${project.build.sourceEncoding} 166 | 167 | 168 | 169 | 170 | 171 | 172 | true 173 | 174 | 175 | io.qameta.allure 176 | allure-maven 177 | ${allure.maven.plugin.version} 178 | 179 | ${allure.testng.version} 180 | 181 | 182 | 183 | ${project.basedir}/public/${pipelineId} 184 | 185 | 186 | -------------------------------------------------------------------------------- /scripts/allure-maven-plugin.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir -p target/allure-results/history 4 | for D in public/*; do 5 | find $(find public/* -mindepth 1 -maxdepth 2 -name 'history') -mindepth 1 -maxdepth 1 -type f \( -name '*.json' \) -exec cp "{}" target/allure-results/history/ \; 6 | done 7 | if [ 4 -lt $(find public -mindepth 1 -maxdepth 1 -type d | wc -l) ]; then 8 | rm -rf "$(find public -mindepth 1 -maxdepth 1 -type d | sort -nr | tail -1)" 9 | fi 10 | mvn io.qameta.allure:allure-maven:report -DpipelineId=$CI_PIPELINE_ID 11 | 12 | mv public/$CI_PIPELINE_ID/allure-maven-plugin/* public/$CI_PIPELINE_ID/ 13 | find public/ -type d -name "allure-maven-plugin" -exec rm -rf {} + 14 | 15 | json="" 16 | for dir in $(find public -mindepth 1 -maxdepth 1 -type d); do 17 | json="${json},${dir//public\//}" 18 | done 19 | json="$(echo $json | sed 's/^,//')" 20 | cat scripts/index.html | sed "s/'%pipelines%'/$json/" >public/index.html 21 | 22 | echo "\n\n\n\n================================= ALLURE REPORT ==========================================" 23 | echo {PAGES_URL}/$CI_PIPELINE_ID 24 | echo "==========================================================================================\n\n\n\n" 25 | -------------------------------------------------------------------------------- /scripts/allure.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | #installation allure_cli required 4 | mkdir -p target/allure-results/history 5 | for D in public/*; do 6 | find $(find public/* -mindepth 1 -maxdepth 2 -name 'history') -mindepth 1 -maxdepth 1 -type f \( -name '*.json' \) -exec cp "{}" target/allure-results/history/ \; 7 | done 8 | if [ 5 -lt $(find public -mindepth 1 -maxdepth 1 -type d | wc -l) ]; then 9 | rm -rf "$(find public -mindepth 1 -maxdepth 1 -type d | sort -nr | tail -1)" 10 | fi 11 | allure generate -c target/allure-results -o public/$CI_PIPELINE_ID 12 | 13 | json="" 14 | for dir in $(find public -mindepth 1 -maxdepth 1 -type d); do 15 | json="${json},${dir//public\//}" 16 | done 17 | json="$(echo $json | sed 's/^,//')" 18 | cat scripts/index.html | sed "s/'%pipelines%'/$json/" >public/index.html 19 | 20 | echo "\n\n\n\n================================= ALLURE REPORT ==========================================" 21 | echo /$CI_PIPELINE_ID 22 | echo "==========================================================================================\n\n\n\n" 23 | -------------------------------------------------------------------------------- /scripts/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | No pipeline ID 6 | 94 | 95 | 96 | 97 | 98 |
99 |
100 |

Pipelines

101 |
102 |
103 |
104 |
105 |

Enter pipeline ID to see report.

106 |
107 | 108 | 109 |
110 |
111 | 137 | 138 | --------------------------------------------------------------------------------