All Projects → researchgate → gemini-react

researchgate / gemini-react

Licence: MIT license
Plugin, which simplifies writing gemini tests for react components

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to gemini-react

Gemini
💀💀💀[DEPRECATED] Use hermione
Stars: ✭ 1,505 (+6740.91%)
Mutual labels:  gemini, visual-regression
Crypto Exchange
Pulls together list of crypto exchanges to interact with their API's in a uniform fashion.
Stars: ✭ 241 (+995.45%)
Mutual labels:  gemini
Algo Coin
Python library for algorithmic trading cryptocurrencies across multiple exchanges
Stars: ✭ 365 (+1559.09%)
Mutual labels:  gemini
Ncgopher
A gopher and gemini client for the modern internet
Stars: ✭ 53 (+140.91%)
Mutual labels:  gemini
Ucx
Unified Communication X (mailing list - https://elist.ornl.gov/mailman/listinfo/ucx-group)
Stars: ✭ 471 (+2040.91%)
Mutual labels:  gemini
Amfora
A fancy terminal browser for the Gemini protocol.
Stars: ✭ 395 (+1695.45%)
Mutual labels:  gemini
gemini-python
A python client for the Gemini API and Websocket
Stars: ✭ 71 (+222.73%)
Mutual labels:  gemini
dollar
Gemini dollar contract source code
Stars: ✭ 79 (+259.09%)
Mutual labels:  gemini
Geoportal Server
Geoportal Server is a standards-based, open source product that enables discovery and use of geospatial resources including data and services.
Stars: ✭ 210 (+854.55%)
Mutual labels:  gemini
Cryptex
Gemini, GDAX, Bitfinex, Poloniex, Binance, Kraken, Cryptopia, Koinex, BitGrail and CoinMarketCap cryptocurrency exchange API clients in Swift / iOS SDK. Check prices and account balances using Sample iOS app.
Stars: ✭ 51 (+131.82%)
Mutual labels:  gemini
Trading Indicator
provide trading technical indicator values based on data of almost crypto currency exchanges
Stars: ✭ 31 (+40.91%)
Mutual labels:  gemini
Exchangesharp
ExchangeSharp is a powerful, fast and easy to use .NET/C# API for interfacing with many crypto currency exchanges. REST and web sockets are supported.
Stars: ✭ 489 (+2122.73%)
Mutual labels:  gemini
Thenextquant
Asynchronous driven quantitative trading framework.
Stars: ✭ 172 (+681.82%)
Mutual labels:  gemini
Lagrange
A Beautiful Gemini Client
Stars: ✭ 238 (+981.82%)
Mutual labels:  gemini
Cryptofeed
Cryptocurrency Exchange Websocket Data Feed Handler
Stars: ✭ 643 (+2822.73%)
Mutual labels:  gemini
Awesome Gemini
A collection of awesome things regarding the gemini protocol ecosystem.
Stars: ✭ 269 (+1122.73%)
Mutual labels:  gemini
Geoportal Server Catalog
Geoportal Server next generation search application and metadata catalog, based on elasticsearch.
Stars: ✭ 53 (+140.91%)
Mutual labels:  gemini
nightwatch-vrt
Visual Regression Testing tools for nightwatch.js
Stars: ✭ 59 (+168.18%)
Mutual labels:  visual-regression
gemget
Command line downloader for the Gemini protocol.
Stars: ✭ 66 (+200%)
Mutual labels:  gemini
Aioquant
Asynchronous event I/O driven quantitative trading framework.
Stars: ✭ 188 (+754.55%)
Mutual labels:  gemini

gemini-react

Build Status codecov

gemini plugin for simplifying visual regression testing on React + webpack stack.

WARNING: Right now plugin is pretty much at the proof-of-concept stage, do not use in production.

Configuring

  1. Install plugin using npm:

    npm install gemini-react
    
  2. Enable it in your gemini config file:

system:
  plugins:
    react:
      webpackConfig: <PATH>
      hostname: <HOST NAME>
      port: <PORT NUMBER> ```

Options

  • webpackConfig (required) – path to your webpack config. Plugin will use loaders from this file to build test pages.

  • listenHost (default: 127.0.0.1) - hostname to run reference test server on.

  • port (default: 5432) - port to run test server on.

  • replaceRootUrl (default: true) - automatically sets rootUrl of every browser to http://<listenHost>:<port>. Set to false if rootUrl should be something else.

  • staticRoot - directory, which contains your static asset files. Will be mounted by your test server automatically.

  • cssFiles - list of CSS files to include in every test page. Requires staticRoot option to be set.

  • jsModules - list of additional js modules to include in the test pages. Relative to project root. This modules will be included into your client bundle before the rest files.

  • customizeServer - path to js file, used to customize the express server. The file should have a single export, which is function of (app, express).

    Example:

    module.exports = function(app, express) {
      app.use(function myMiddleware(req, res, next) {
          ...
      });
    }
  • webpackLazyMode - switches webpack dev middleware to lazy mode, which means javascript will be recompiled on each request.

Writing the tests

Use geminiReact variable instead of gemini and render(<ReactComponent />) instead of setUrl and setCaptureElements. The rest is the same as vanilla gemini:

const MyComponent = require('./path/to/my/component');
geminiReact.suite('my react test', suite => {
    suite.render(<MyComponent prop="value" />)
        .capture('initial');
});

TIP: To use JSX in your tests, you might need gemini-babel plugin.

You don't need to create the reference pages or run the server, plugin will do everything for you.

If you want to interact with rendered component, use this.renderedComponent inside your test:

suite.capture('clicked', function(actions) {
    actions.click(this.renderedComponent);
});

If you have any test-specific stylesheets, you can include them into the test page by calling suite.includeCss:

suite.includeCss('/my-component.css');

By default, geminiReact will capture rendered at mounting point element. If you want to add some extra elements, use setExtraCaptureElements:

suite.setExtraCaptureElements(['.popup']);

Viewing the example page

If you want to view example pages without actually running the tests, you can use gemini-react-server binary, provided by this package:

./node_modules/.bin/gemini-react-server

It will run the server on the host and port, specified in plugin configuration in .gemini.yml.

The url of each example is a series of ulr-encoded suite names. For example, this suite:

geminiReact.suite('parent', () => {
    geminiReact.suite('child', () => {
       ...
    });
})

will be served at http://HOST:PORT/parent/child url.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].