npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@times-components/fructose

v3.12.0

Published

[![Build Status](https://app.bitrise.io/app/3038aa161f140118/status.svg?token=xtX-Hi2JSI7S3zQIGHI0EQ&branch=master)](https://app.bitrise.io/app/3038aa161f140118)

Downloads

90

Readme

Build Status

Fructose - Functional React (native) UI Tester

Brought to you by The Times Tooling team  🛠

Fructose is a testing library that enables the loading of react native and react native web components on a device.

We have used this to

  • Enable automated functional black and grey box testing of components.
  • Enable automated visual regression of components with Dextrose

Overview

Fructose has 3 components:

The App

The Fructose app allows for the loading of arbitrary components at runtime. Once the app is started you are able to load the components in either manual or automated fashions.

The Server

The fructose server is how we proxy commands from the client to the app via websockets.

The Client

The fructose client is how we communicate to the server via websockets

Getting Started

We are actively working on this to become easier.

Running and understanding the examples

The best way to see what fructose does is to run the end to end tests.

Running

From the root of the project run yarn and then either...

yarn e2e:test:web

yarn e2e:test:ios

yarn e2e:test:android

You will need a (simulator | emulator | chrome) to run these examples.

Understanding the examples

In the e2e Test folder you will find examples of how to consume fructose. We suggest first looking at the scripts folder to understand the steps required for running tests with Fructose.

Then look at the examples folder.

The .showcase file is a description of how a component should be rendered. Showcase files came around because originally fructose consumed storybook files. This eventually resulted in numerous issues so we created an abstraction layer which decouples components from storybook. You can see a working example of how showcase to storybook works here.

Times-Components-storybook

Showcase files are then loaded into the app index via react-native-showcase-loader function.

The test file is an example of how to load a component ready for grey or black box testing.

Finally, the fructose folder is where all of the different platform indexes live.

Below are examples of iOS and Web e2eTests running and asserting that the app emits the component has loaded:

React Native Web

React Native IOS

Consuming Fructose

From your project

yarn add @times-components/fructose --dev
yarn add react-native-showcase-loader --dev

Create a folder fructose in your project root directory.

Create an index.*.js in this folder for your platform of choice: ios, android, or web.

Register the component to the name that your app binary expects.

Use react native showcase loader function to require in your showcase files.

See the examples below:

Ios Index Example

Run Ios Tests.sh Example

Writing tests

In a before, hook import setup from fructose and await on.

fructose.hooks.mobile.setup();
fructose.hooks.web.setup();

Ios setup Example

Once the setup promise resolves a fructoseClient. Use this client to tell your app to load components defined in your showcase files.

fructoseClient.loadComponent('your component name')

Your component is now ready for interrogation by the testing library of your choice. We have successfully used both appium and detox

Notes

We currently have Fructose running in a CI environment with...

Future

  1. Fructose cli to initialise and run tests