Code Monkey home page Code Monkey logo

sim360's Introduction

Sim 360

Sim 360 diagram

Sim 360 is the evolution of Scena 360's testing framework โ€“ coverage360. The main difference between the two projects is this one uses Playwright instead of Puppeteer w/ Jest.

This repository serves as an example for configuring an E2E testing system or simulation environment for your web application, particularly 3D ones that rely on technologies like A-Frame and Three.js.

Getting started

Installing dependencies

  1. Make sure you have the latest version of the following installed:
    1. Yarn: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable
    2. NodeJS: Install here ๐Ÿ‘‰ https://nodejs.org/en
  2. Clone the sim360 repo
  3. Run yarn install to install the yarn dependencies / node modules

Compiling and running the project

You can build-and-run the simulation environment with one command:

yarn build:run

You can also...

  1. Compile using yarn run build
  2. Run a clean build using yarn run build:clean
  3. Start the simulation after compilation using yarn start

Adding a new simulation

  1. create a <simulation-name>.ts file in src/simulations/
  2. add the following boilerplate to your new simulation file
export const yourSimulationName = async () => {
  await Promise.all(
    // specify browser types which you wish to launch
    [playwright.chromium].map(async browserType => {
      const { browser, page } = (await launchPage(browserType))!;
      try {
        await joinRoom({ browser, page });

        // do stuff once avatar has entered the room
      } finally {
        browser.close();
      }
    }),
  );
};
  1. register your simulation in src/simulations/index.ts by adding it to the sims/ map.
  2. (temporary) pass in the name of the simulation you wish to run in src/index.ts:
(async () => {
  await startSim('yourSimulationName'); // update
})();
  1. Run yarn build:run to run your simulation.

TODOs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.