Skip to content

Commit

Permalink
jenkins: Add Jenkinsfile (#10)
Browse files Browse the repository at this point in the history
* jenkins: Add Jenkinsfile

* jenkins: Update Jenkinsfile

* jenkins: Add Jenkins pipeline in README.md

* jenkins: Update README.md
  • Loading branch information
Diegocortes15 committed Apr 24, 2023
1 parent f8468e3 commit f9a75fc
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"liveServer.settings.port": 5501
}
34 changes: 34 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* groovylint-disable SpaceAfterClosingBrace */
pipeline {
agent any

tools {
nodejs 'NodeJS 17.5.0'
}
stages {
stage('Dependencies') {
steps {
bat 'npm ci'
bat 'npm install rimraf'
}
}
stage('e2e Tests') {
steps {
bat 'npm run test:execute'
}
}
stage('Deploy Test Reports') {
steps {
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: false,
reportDir: 'target/site/serenity',
reportFiles: 'index.html',
reportName: 'Serenity Report',
reportTitles: '',
useWrapperFileDirectly: true])
}
}
}
}
46 changes: 44 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# habi-automation-challenge
# Habi Automation Challenge

Habi Automation Challenge - Screenplay

Expand Down Expand Up @@ -40,7 +40,7 @@ Run, the following command to set some depencies needed after install like `rimr
npm run postinstall
```

## Running the tests
## Running Tests

To run all tests and open serenity report

Expand Down Expand Up @@ -93,3 +93,45 @@ Tags that you can use
| 3️⃣ @hb-0011 | | |
| 3️⃣ @hb-0012 | | |
| 3️⃣ @hb-0013 | | |

## Jenkins Pipeline

```bash
pipeline {
agent any

tools {
nodejs 'NodeJS 17.5.0'
}
stages {
stage('Dependencies') {
steps {
bat 'npm ci'
bat 'npm install rimraf'
}
}
stage('e2e Tests') {
steps {
bat 'npm run test:execute'
}
}
stage('Deploy Test Reports') {
steps {
publishHTML([
allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: false,
reportDir: 'target/site/serenity',
reportFiles: 'index.html',
reportName: 'Serenity Report',
reportTitles: '',
useWrapperFileDirectly: true])
}
}
}
}
```

### Pipeline in Jenkins

![image](https://user-images.githubusercontent.com/60171460/233922016-90c5e823-4ca6-4c9a-97b2-d8d97b54b8f2.png)

0 comments on commit f9a75fc

Please sign in to comment.