Skip to content

Latest commit

 

History

History
140 lines (108 loc) · 6.34 KB

File metadata and controls

140 lines (108 loc) · 6.34 KB

Table of Contents
  1. About
  2. Getting Started
  3. Usage
  4. Contributing
  5. Acknowledgments

About

Spectrum is an e2e test automation framework that leverages JUnit 5 and Selenium 4 to provide these features automatically:

  • Driver management
  • Auto-waiting before interacting with elements, to highly reduce flakiness
  • Html report generation with the execution video
  • Coverage report generation by reading a testbook
  • Mail/Slack notifications with reports as attachments
  • It is fully configurable via a declarative yaml file
  • It provides out-of-the-box defaults to let you run tests with no additional configuration
  • It supports browsers automation via Selenium
  • It supports mobile and desktop applications automation via Appium
  • It supports WebDriver BiDi protocol
  • It generates several additional reports that are fully customisable

Spectrum manages all the boilerplate code, allowing you to focus on test logic: you just need to write a JUnit test using the native Selenium API as you would do in a vanilla Selenium test, and Spectrum will enrich your suite transparently. Be sure to check the full documentation to see all the available features.

Getting Started

⚠️ Spectrum requires Java 21 or newer.

The easiest way is to take the three steps listed below, as shown in this video:

Spectrum.project.creation.mp4
  1. Generate a new project leveraging the Spectrum Archetype:

    mvn archetype:generate -DarchetypeGroupId=io.github.giulong -DarchetypeArtifactId=spectrum-archetype
    
  2. Run the LoginFormIT demo test.

  3. Check the report generated under target/spectrum/reports.

⚠️ Tests run on Chrome by default. As shown in the video above, you can change this with:
-Dspectrum.driver=firefox, -Dspectrum.driver=edge or -Dspectrum.driver=safari

If you like Spectrum, please consider giving it a GitHub Star ⭐

Usage

If you'd rather add Spectrum manually to your project, you just need to add its dependency:

Maven

<dependency>
    <groupId>io.github.giulong</groupId>
    <artifactId>spectrum</artifactId>
    <version>1.24.0</version>
    <scope>test</scope>
</dependency>

Gradle

dependencies {
  implementation group: 'io.github.giulong', name: 'spectrum', version: '1.24.0'
}

Here's an overview of the project created by the archetype, along with the generated report and video:

login-form  report

video-readme.mp4

You can also configure Spectrum to produce additional reports, such as summary and coverage:

summary  html testbook

Contributing

Contributions to Spectrum are welcome! Please check out the CONTRIBUTING.md and the open issues.

Acknowledgments

Spectrum leverages these projects you should definitely check out!