Skip to content

Selenium/Appium + JUnit + Extent Reports framework for no-boilerplate E2E tests

License

Notifications You must be signed in to change notification settings

giulong/spectrum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Spectrum is a e2e test automation framework that leverages JUnit 5 and Selenium 4 to simplify tests development providing these features automatically:

  • Driver instantiation
  • Html report generation
  • Execution video generation
  • Coverage report generation by reading a testbook
  • Mail/Slack notifications with reports as attachments

Spectrum manages all the boilerplate code to get these features and many more, allowing you to focus on test logic.

  • Auto-waits before interacting with elements, to highly reduce flakiness
  • 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
  • supports browsers automation via Selenium
  • supports mobile and desktop applications automation via Appium

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 in target/spectrum/reports/spectrum-report-<TIMESTAMP>/spectrum-report-<TIMESTAMP>.html.

⚠️ Tests run on Chrome by default. You can change this running with:
-Dspectrum.driver=firefox, -Dspectrum.driver=edge or -Dspectrum.driver=safari

Usage

If you'd rather add Spectrum manually to an existing project, you just need to add its dependency.

Maven

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

Gradle

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

Here's a quick overview of the project created by the archetype, along with the generated report:

login-form  report

And here's the generated video:

video-readme.mp4

Additionally, you can configure Spectrum to automatically produce summary and coverage reports like these:

summary  html testbook

For all the available reports, how to customise them, and many more, please refer to the full documentation.

Contributing

Contributions to Spectrum are welcome! If you're interested, please check out the CONTRIBUTING.md.

If you're using Spectrum, please consider giving it a GitHub Star ⭐

Contacts

Creator GitHub Linkedin Email
Giulio Longfils giulong Giulio Longfils [email protected]

Acknowledgments

Spectrum leverages these projects you should definitely check out!