fix: 4 - Updating Jenkinsfile

This commit is contained in:
Sami 2024-09-28 18:32:03 -04:00
parent f0dfc063e1
commit 54fbd3e326

33
Jenkinsfile vendored
View File

@ -2,22 +2,35 @@ pipeline {
agent any
stages {
stage('Install Chrome and ChromeDriver') {
stage('Checkout') {
steps {
// Install Chrome and ChromeDriver if necessary (Linux environment)
sh 'sudo apt-get update'
sh 'sudo apt-get install -y google-chrome-stable'
sh 'wget https://chromedriver.storage.googleapis.com/$(curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE)/chromedriver_linux64.zip'
sh 'unzip chromedriver_linux64.zip'
sh 'sudo mv chromedriver /usr/local/bin/'
// Checkout code from version control
git 'https://gitea.zacksolutions.dev/Zakaria/ZenProject.git'
}
}
stage('Run Tests') {
stage('Build') {
steps {
// Run the tests in a headless Chrome environment
// Build your project (if needed)
sh 'mvn clean install'
}
}
stage('Test') {
steps {
// Install dependencies
sh 'mvn dependency:resolve'
// Run browser tests
sh 'mvn test'
}
}
stage('Generate Reports') {
steps {
// Generate and store test reports
sh 'mvn site'
}
}
}
}