/opentest

Open source test automation tool for web applications, mobile apps and APIs

Primary LanguageJavaMIT LicenseMIT

OpenTest

OpenTest is a free and open source functional test automation tool for web applications, mobile apps and APIs.

Why another test automation tool?

We know there’s a lot of stuff out there already, both established commercial products and open source projects. We looked for the proper tool for a long time, and gave a fair try to quite a few of them, with results that did not exactly meet our expectations. We were looking for a tool that we could standardize on, that would allow us to unify the test automation efforts across multiple internal and external teams with various sizes, skill sets, budgets and geographic locations. This tool would have to incorporate the latest best practices in the industry and, ideally, be released under an open source license so we can eliminate lengthy processes and reduce costs. Given these considerations, as well as other requirements, we decided that building from scratch was the responsible choice.

OpenTest aims to offer all the features of a modern test automation tool while following a set of healthy principles. We are aiming to democratize functional test automation and create a great community that is empowered to build upon itself. While nothing in life is perfect and no piece of software is ever complete, we promise that every feature that went into this product was thoroughly thought out and carefully implemented to achieve the best balance between power and flexibility on one side, and usability on the other.

Features

  • Web testing, with Selenium. All browsers supported. Run tests on your local machine or using a cloud provider.

  • Mobile testing for Android and iOS apps with Appium. Run tests on your local machine or using a cloud provider.

  • API testing, built on top of the Apache HttpClient library.

  • Keyword-driven testing. Assemble your tests using higher-level building blocks which hide the complexity of the underlying technology and let you express yourself in a concise and readable manner.

  • Scripting support. Cover complex test scenarios using JavaScript code, embedded organically within your keyword-driven test to keep things clean and readable.

  • Parallel testing. The number of test sessions you can run in parallel is only limited by the resources of the machine you’re running on (but there’s always more machines in the cloud).

  • Distributed testing. Write tests that execute seamlessly across multiple machines, networks and technologies. Write integration tests that span mobile, web, API and anything in between.

  • Data-driven testing. Run a test multiple times, over a set of data records maintained in a separate data file.

  • Extensible. Integrate with any technology by creating your own custom test actions (keywords).

  • Source control-friendly by design. Work with confidence, knowing that Git has your back. Perfect for large or geographically distributed teams.

  • Environments. Build your tests once and run against multiple environments or using different sets of test data.

  • Works well with others. Use the simple HTTP API to take control of starting and monitoring test sessions, collecting test results, etc.

  • Cross-platform, running on macOS, Windows and Linux.

(and we had to skip a lot of really cool features to keep this brief)

Installation

Prerequisites: Node.js 8 or greater; Java runtime 8 or greater.

Install from npm:

npm install opentest -g

Video tutorial: https://getopentest.org/docs/installation.html (recorded on Windows)

Quick start

  1. Create a directory named "opentest" in your home directory to use as a playground for this guide, and cd into that directory.

    cd ~
    mkdir opentest
    cd opentest
    Note
    On Windows, use md instead of mkdir.
  2. Run the command below

    opentest quick-start

    You should now have these files and directories in your current path:

    server
    └── server.yaml
    
    actor1
    └── actor.yaml
    
    test-repo
    ├── macros
    │   └── ...
    ├── scripts
    │   └── ...
    ├── templates
    │   └── ...
    └── tests
        └── ...

    The server and the actor1 directories are going to be used as the working directories for the OpenTest server and test actor, respectively. The test-repo directory is a sample test repository that demonstrates some basic features of OpenTest.

  3. Open a new terminal window, cd to the server’s working directory and start the OpenTest server:

    cd ~/opentest/server
    opentest server

    The OpenTest server (aka the sync server) is a Node.js application who’s main functions are to orchestrate test execution and to provide a web-based UI.

  4. Open a new terminal window, cd to the actor’s working directory and start the test actor:

    cd ~/opentest/actor1
    opentest actor

    The test actor is a Java application that runs on the system under test and executes test steps as instructed by the sync server.

  5. Open a web browser and navigate to http://localhost:3000.

  6. From the menu, select Session > Create Session From Template. Select the template Quick start tests and click Create session. Wait a few seconds and refresh your browser to view the result of the test session.

High-level architecture

There are three components to OpenTest:

  • The sync server, a Node.js application that mainly performs three functions:

    • Orchestrates test execution.

    • Exposes a web UI that can be used to create test sessions, examine test results, etc.

    • Exposes a friendly API that can be leveraged for roughly the same purposes as the UI.

  • The test actor, a Java application responsible with executing tests, as instructed by the sync server. There can be multiple actors participating in the same test and actors can be deployed on any machine in any network, including in the cloud. The only requirement is that the test actor can communicate with the HTTP API exposed by the sync server. There is no requirement that the sync server can initiate communication with the actor, which greatly simplifies the setup in scenarios where the actor is running in a lab that is behind a firewall or in a network that is not accessible from the machine running the sync server.

  • The test repository, a directory with a predefined, required structure, under source control, containing the various test assets (test files, scripts, test session templates, etc.).

OpenTest high-level architecture
Figure 1. OpenTest high-level architecture


License

OpenTest is open source software released under the MIT license.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted by you for inclusion in this repository shall be licensed as above, without any additional terms or conditions.

For more information please see the contributing guidelines document.

Thanks

  • Thanks to BrowserStack for providing an open-source account for testing & development!

  • Cross-browser Testing Platform and Open Source ❤️ provided by Sauce Labs