Skip to main content
This guide walks you through setting up a complete development environment for the Makers BTG Tests framework, including Java, Gradle, IDE configuration, and dependency management.

System Requirements

Before you begin, ensure your system meets these requirements:
ComponentMinimum VersionRecommended
Java21 (LTS)21.0.3 or later
RAM4 GB8 GB or more
Disk Space2 GB5 GB (including IDE)
Operating SystemWindows 10, macOS 10.15, Ubuntu 20.04Latest stable versions
Chrome Browser100+Latest stable

Installing Java 21

1

Download Java 21

Java 21 is a Long-Term Support (LTS) release required by this framework.
Download from Adoptium:
  1. Select OpenJDK 21 (LTS)
  2. Choose Windows x64
  3. Download the MSI installer
  4. Run the installer and follow the wizard
  5. Ensure “Set JAVA_HOME variable” is checked
2

Verify Java Installation

Open a new terminal and verify the installation:
java -version
Expected output:
openjdk version "21.0.3" 2024-04-16 LTS
OpenJDK Runtime Environment Temurin-21.0.3+9 (build 21.0.3+9-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.3+9 (build 21.0.3+9-LTS, mixed mode)
Also verify the Java compiler:
javac -version
Expected output:
javac 21.0.3
If the version shows Java 8, 11, or 17, check your JAVA_HOME environment variable and ensure Java 21 is in your system PATH.
3

Configure JAVA_HOME (if needed)

If Java isn’t recognized, set the JAVA_HOME environment variable:
  1. Open System PropertiesEnvironment Variables
  2. Add new system variable:
    • Variable name: JAVA_HOME
    • Variable value: C:\Program Files\Eclipse Adoptium\jdk-21.x.x
  3. Edit Path variable and add: %JAVA_HOME%\bin
  4. Open a new terminal to test

Gradle Setup

The Makers BTG Tests project includes Gradle Wrapper, so you don’t need to install Gradle separately. The wrapper ensures everyone uses the same Gradle version.
Gradle Wrapper files (gradlew, gradlew.bat, gradle/wrapper/) are included in the repository. These files manage Gradle installation automatically.

Using Gradle Wrapper

# Make wrapper executable (first time only)
chmod +x gradlew

# Run Gradle tasks
./gradlew --version
./gradlew tasks
./gradlew clean test
Always use the wrapper (./gradlew) instead of a system-installed Gradle to ensure consistency across development environments.

Project Dependencies

The framework’s dependencies are managed via Gradle and defined in build.gradle:
build.gradle
plugins {
    id 'java'
    id 'net.serenity-bdd.serenity-gradle-plugin' version '4.0.46'
}

group = 'org.btg.practual'
version = '1.0.0-SNAPSHOT'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(21)
    }
}

ext {
    serenityVersion = '4.0.46'
    junitVersion = '5.10.1'
}

dependencies {
    // Serenity BDD Core & Cucumber
    implementation "net.serenity-bdd:serenity-core:${serenityVersion}"
    implementation "net.serenity-bdd:serenity-cucumber:${serenityVersion}"

    // Screenplay Pattern
    implementation "net.serenity-bdd:serenity-screenplay:${serenityVersion}"
    implementation "net.serenity-bdd:serenity-screenplay-webdriver:${serenityVersion}"

    // JUnit 5
    testImplementation "org.junit.jupiter:junit-jupiter-api:${junitVersion}"
    testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"

    // AssertJ for assertions
    testImplementation "org.assertj:assertj-core:3.24.2"

    // Cucumber JUnit Platform Engine
    testImplementation "io.cucumber:cucumber-junit-platform-engine:7.14.0"
}

Key Dependencies

Core framework providing:
  • Living documentation and rich HTML reports
  • Screenshot capture and step logging
  • Requirements coverage tracking
  • Integration with Cucumber and JUnit
Screenplay pattern implementation:
  • User-centric test design
  • Tasks, Actions, Questions
  • WebDriver integration for UI testing
BDD framework supporting:
  • Gherkin syntax for feature files
  • Step definitions in multiple languages (Spanish supported)
  • Scenario outlines with examples
Modern test engine with:
  • Platform Suite API for Cucumber integration
  • Parallel test execution
  • Flexible test configuration
Fluent assertion library for:
  • Readable, chainable assertions
  • Rich error messages
  • Type-safe validations

Downloading Dependencies

When you first run Gradle, it automatically downloads all dependencies:
./gradlew build --refresh-dependencies
Dependencies are cached in:
  • Linux/macOS: ~/.gradle/caches/
  • Windows: C:\Users\<username>\.gradle\caches\
The initial download may take 5-10 minutes depending on your internet connection. Subsequent builds will be much faster as dependencies are cached.

IDE Setup

IntelliJ IDEA provides excellent support for Java, Gradle, and Cucumber.
1

Install IntelliJ IDEA

Download from JetBrains:
  • Community Edition (free) - sufficient for this project
  • Ultimate Edition (paid) - includes additional features
Install and launch IntelliJ IDEA.
2

Open the Project

  1. Click Open or File → Open
  2. Navigate to the mkrs-btg-tests directory
  3. Select build.gradle and click Open
  4. Choose Open as Project
  5. IntelliJ will import the Gradle project automatically
Wait for Gradle sync to complete (watch the progress bar at the bottom).
3

Install Required Plugins

Go to File → Settings → Plugins (or IntelliJ IDEA → Preferences → Plugins on macOS):Install these plugins:
  • Cucumber for Java - Gherkin syntax highlighting and navigation
  • Gherkin - Feature file support
Restart IntelliJ after installing plugins.
4

Configure Project SDK

  1. Go to File → Project Structure → Project
  2. Set SDK to Java 21
  3. Set Language level to “21 - Pattern matching for switch”
  4. Click Apply and OK
5

Verify Setup

Test the configuration:
  1. Open src/test/java/org/btg/practual/runners/CucumberRunner.java
  2. Right-click in the editor
  3. Select Run ‘CucumberRunner’
  4. Tests should execute and results appear in the Run window
IntelliJ IDEA can navigate between Gherkin steps and their Java implementations. Hold Ctrl (or Cmd on macOS) and click on a step in a .feature file to jump to the step definition.

Visual Studio Code

If you prefer VS Code:
1

Install Extensions

Install these extensions from the VS Code marketplace:
  • Extension Pack for Java (Microsoft)
  • Cucumber (Gherkin) Full Support
  • Gradle for Java
2

Open the Project

cd mkrs-btg-tests
code .
VS Code will detect the Gradle project and Java files automatically.
3

Configure Java Home

Add to .vscode/settings.json:
{
  "java.configuration.runtimes": [
    {
      "name": "JavaSE-21",
      "path": "/path/to/java-21",
      "default": true
    }
  ]
}

Environment Verification

Verify your complete setup:
1

Check Java and Gradle

java -version
./gradlew --version
Both should show Java 21 and Gradle 8.x.
2

Build the Project

./gradlew clean build
Expected output:
BUILD SUCCESSFUL in 30s
3

Run Tests

./gradlew test aggregate
Tests should execute and generate a report in target/site/serenity/index.html.
4

Verify Report Generation

Open the Serenity report:
open target/site/serenity/index.html
You should see test results, requirements, and execution details.
If all steps complete successfully, your environment is ready for test development!

Chrome Browser Setup

The framework uses Chrome for UI testing with automatic driver management.

Install Chrome

Download from google.com/chrome and install.

Selenium Manager

The framework uses Selenium Manager for automatic ChromeDriver management. No manual driver download is needed! Configuration in serenity.conf:
webdriver {
  driver = chrome
  autodownload = true  # Enables Selenium Manager
}
Selenium Manager automatically downloads and manages the correct ChromeDriver version for your Chrome browser. This eliminates version mismatch issues.

Next Steps

Your development environment is now ready! Continue with:

Quickstart Guide

Run your first test and explore the framework

Writing Tests

Learn how to create new test scenarios

Project Structure

Understand the codebase organization

Configuration

Customize the framework for your needs

Troubleshooting

  1. Go to File → Invalidate Caches → Invalidate and Restart
  2. Delete .gradle and .idea folders from the project
  3. Re-import the project by opening build.gradle
Set JAVA_HOME explicitly:
export JAVA_HOME=/path/to/java-21
Or configure in IntelliJ: File → Project Structure → SDKs
  1. Check internet connection
  2. Clear Gradle cache: rm -rf ~/.gradle/caches/
  3. Retry with: ./gradlew build --refresh-dependencies
  4. If behind a proxy, configure in ~/.gradle/gradle.properties
Ensure Chrome is installed and in your system PATH. For Linux headless environments, install Chrome or configure for remote execution.
Make the wrapper executable:
chmod +x gradlew

Build docs developers (and LLMs) love