void publishBootstrapReport() {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'allure-bootstrap-report',
reportFiles: 'index.html',
reportName: 'Allure Bootstrap Report'
])
}
void publishFunctionalReport() {
publishHTML([
allowMissing: true,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'allure-functional-report',
reportFiles: 'index.html',
reportName: 'Allure Functional Report'
])
}
boolean setupPassed=true
boolean flowInterrupted = false
stage('Test setup') {
try {
yarnBuilder.yarn('test:setup:playwright-install')
yarnBuilder.yarn('test:setup:ci')
} catch (Exception error) {
if (error instanceof
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException) {
flowInterrupted = true
}
setupPassed =
false unstable(message
: "${STAGE_NAME} is unstable: " + error.toString())
} finally {
yarnBuilder.yarn('test:bootstrap:generate-report') publishBootstrapReport()
}
}
if (setupPassed) {
stage('Chrome full functional test') {
try {
if (flowInterrupted) {
throw new org.jenkinsci.plugins.workflow.steps
.FlowInterruptedException()
}
yarnBuilder.yarn('test:functional:chrome:ci')
} catch (Exception error) {
if (error instanceof
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException) {
flowInterrupted = true
}
unstable(message : "${STAGE_NAME} is unstable: " + error.toString())
} finally {
yarnBuilder.yarn('test:functional:generate-report')
publishFunctionalReport()
}
}
stage('Firefox full functional test') {
try {
if (flowInterrupted) {
throw new org.jenkinsci.plugins.workflow.steps
.FlowInterruptedException()
}
yarnBuilder.yarn('test:functional:firefox:ci')
} catch (Exception error) {
if (error instanceof
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException) {
flowInterrupted = true
}
unstable(message : "${STAGE_NAME} is unstable: " + error.toString())
} finally {
yarnBuilder.yarn('test:functional:generate-report')
publishFunctionalReport()
}
}
stage('Edge full functional test') {
try {
if (flowInterrupted) {
throw new org.jenkinsci.plugins.workflow.steps
.FlowInterruptedException()
}
yarnBuilder.yarn('test:functional:edge:ci')
} catch (Exception error) {
if (error instanceof
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException) {
flowInterrupted = true
}
unstable(message : "${STAGE_NAME} is unstable: " + error.toString())
} finally {
yarnBuilder.yarn('test:functional:generate-report')
publishFunctionalReport()
}
}
stage('Safari full functional test') {
try {
if (flowInterrupted) {
throw new org.jenkinsci.plugins.workflow.steps
.FlowInterruptedException()
}
yarnBuilder.yarn('test:functional:safari:ci')
} catch (Exception error) {
if (error instanceof
org.jenkinsci.plugins.workflow.steps.FlowInterruptedException) {
flowInterrupted = true
}
unstable(message : "${STAGE_NAME} is unstable: " + error.toString())
} finally {
yarnBuilder.yarn('test:functional:generate-report')
publishFunctionalReport()
}
}
}
stage('Test teardown') {
try {
yarnBuilder.yarn('test:teardown:ci')
} catch (Exception error) {
unstable(message : "${STAGE_NAME} is unstable: " + error.toString())
} finally {
yarnBuilder.yarn('test:bootstrap:generate-report') publishBootstrapReport()
}
}