SJC Test Framework (Simple Java Cucumber-based Test Framework) is a Java-based test automation framework built around Cucumber, Selenide, RestAssured, JUnit Platform, and Allure.
The current implementation includes readable browser-based UI scenarios and a minimal REST API testing layer using the same BDD approach.
English Version | Русская версия
This repository is an evolving test automation framework for writing readable BDD scenarios for UI and REST API checks.
SauceDemo is used as the example UI target because it is a public practice resource commonly used for UI test automation scenarios.
JSONPlaceholder is used as the example REST API target because it is a public fake API commonly used for API testing and prototyping.
The framework is built around a simple idea: feature files should describe test intent in readable language, while framework internals hide technical implementation details.
For the current UI layer, the main flow is:
Feature step -> Step definition -> Action executor -> Page object -> Selenide element
UI scenario:
Scenario: Successful login
* user is on page "Page Swag Labs"
* user (fills field) "Username" with value "standard_user"
* user (fills field) "Password" with value "secret_sauce"
* user (press button) "Login"
* user is on page "Products"API scenario:
Scenario: Get post by id
* api (sends GET request) to endpoint "/posts/1"
* api (checks response status code) equals "200"
* api (checks response field value) "id" equals "1"
* api (checks response field is not empty) "title"- Cucumber feature files with readable test steps.
- Page Object structure for UI pages.
- Annotation-based page, action, and element registration.
- Shared actions for common UI operations: filling fields, clicking elements, checking lists, checking text values.
- Selenide-based browser interaction and waits.
- Basic REST API checks with RestAssured.
- Allure integration with screenshots attached on failed scenarios.
- Configurable browser settings via
config.propertiesand-Dsystem properties. - No local WebDriver binary is required by default.
- Language: Java 21
- Build System: Gradle 8
- Test Runner: JUnit Platform
- BDD: Cucumber JVM
- UI Automation: Selenide / Selenium WebDriver
- API Testing: RestAssured
- Reporting: Allure
- Logging: Logback
src/test/java/io/github/royalspirit/sjctestframework/
├── RunCucumberTest.java # Cucumber suite entry point
├── core/
│ ├── annotations/ # Framework annotations
│ ├── api/ # REST API request, response, and specification helpers
│ ├── stepdefs/ # Cucumber step definitions
│ ├── Setup.java # Browser and scenario hooks
│ ├── FrameworkPage.java # Base page action executor
│ ├── PageContextRegistry.java # Current page and page object registry
│ ├── ElementsObjectRegistry.java # Element title registry
│ └── FrameworkRegistryValidator.java # Startup validation for framework annotations
└── pages/ # Page objects and common page actions
src/test/resources/
├── features/ # Cucumber feature files
├── configuration/config.properties # Test execution configuration
├── junit-platform.properties # Cucumber/JUnit configuration
├── allure.properties # Allure results configuration
└── logback.xml # Logging configuration
- JDK 21+
- Gradle wrapper from this repository
- Chrome or Firefox installed locally
./gradlew test./gradlew test -Dbrowser.headless=true./gradlew test -Dcucumber.filter.tags=@TEST-003./gradlew test -Dcucumber.filter.tags=@api./gradlew test -Dbrowser.name=firefoxDefault configuration is stored in:
src/test/resources/configuration/config.properties
Supported properties:
starting.url=https://www.saucedemo.com
browser.name=chrome
browser.size=1920x1200
browser.version=null
browser.headless=false
path.to.webdriver=null
api.base.url=https://jsonplaceholder.typicode.com
logs.color.enabled=trueSystem properties passed with -D have priority over values from config.properties.
Disable colored console log values:
./gradlew test -Dlogs.color.enabled=falseTest execution writes Allure results to:
build/allure-results
Generate and open the report:
./gradlew allureServeSJC Test Framework (Simple Java Cucumber-based Test Framework) — фреймворк автоматизации тестирования на Java, построенный на Cucumber, Selenide, RestAssured, JUnit Platform и Allure.
Текущая реализация включает читаемые браузерные UI-сценарии и минимальный слой для REST API-тестирования с тем же BDD-подходом.
Это развивающийся фреймворк автоматизации тестирования для написания читаемых BDD-сценариев для UI и REST API-проверок.
В качестве UI-ресурса для примеров выбран SauceDemo — публичный тренировочный сайт, который часто используют для отработки сценариев UI-автоматизации.
В качестве REST API-ресурса для примеров выбран JSONPlaceholder — публичный fake API, который часто используют для тестирования и прототипирования API.
Фреймворк построен вокруг простой идеи: feature-файлы должны описывать намерение теста читаемым языком, а внутренние механизмы фреймворка скрывают технические детали реализации.
Сейчас для UI-тестов цепочка выглядит так:
Feature step -> Step definition -> Action executor -> Page object -> Selenide element
UI-сценарий:
Сценарий: Успешная авторизация пользователя
* открывается страница "Page Swag Labs"
* пользователь (заполняет поле) "Username" значением "standard_user"
* пользователь (заполняет поле) "Password" значением "secret_sauce"
* пользователь (нажимает кнопку) "Login"
* открывается страница "Products"API-сценарий:
Сценарий: Проверка ответа сервиса по идентификатору
* api (отправляет GET запрос) на endpoint "/posts/1"
* api (проверяет статус ответа) равен "200"
* api (проверяет значение поля ответа) "id" равно "1"
* api (проверяет что поле ответа не пустое) "title"- Cucumber feature-файлы с читаемыми шагами.
- Page Object структура для UI-страниц.
- Регистрация страниц, действий и элементов через аннотации.
- Общие действия: заполнение полей, клики, проверки списков, проверки текстовых значений.
- Работа с браузером через Selenide.
- Базовые REST API-проверки через RestAssured.
- Интеграция с Allure и прикрепление скриншота при падении сценария.
- Настройка браузера через
config.propertiesи-Dпараметры. - Локальный WebDriver binary по умолчанию не требуется.
- Java 21
- Gradle 8
- JUnit Platform
- Cucumber JVM
- Selenide / Selenium WebDriver
- RestAssured
- Allure
- Logback
- JDK 21+
- Gradle wrapper из репозитория
- Установленный Chrome или Firefox
./gradlew test./gradlew test -Dbrowser.headless=true./gradlew test -Dcucumber.filter.tags=@TEST-003./gradlew test -Dcucumber.filter.tags=@api./gradlew test -Dbrowser.name=firefoxОсновной конфиг находится здесь:
src/test/resources/configuration/config.properties
Поддерживаемые параметры:
starting.url=https://www.saucedemo.com
browser.name=chrome
browser.size=1920x1200
browser.version=null
browser.headless=false
path.to.webdriver=null
api.base.url=https://jsonplaceholder.typicode.com
logs.color.enabled=trueЗначения, переданные через -D, имеют приоритет над значениями из файла.
Отключить цветные значения в консольных логах:
./gradlew test -Dlogs.color.enabled=falseРезультаты Allure сохраняются в:
build/allure-results
Сгенерировать и открыть отчет:
./gradlew allureServeIf you found a bug or want to suggest an improvement, feel free to create an Issue or Pull Request.