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.
- Make sure you have the latest version of the following installed:
- Yarn: https://classic.yarnpkg.com/lang/en/docs/install/#mac-stable
- NodeJS: Install here 👉 https://nodejs.org/en
- Clone the sim360 repo
- Run
yarn install
to install the yarn dependencies / node modules
You can build-and-run the simulation environment with one command:
yarn build:run
You can also...
- Compile using
yarn run build
- Run a clean build using
yarn run build:clean
- Start the simulation after compilation using
yarn start
- create a
<simulation-name>.ts
file insrc/simulations/
- 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();
}
}),
);
};
- register your simulation in
src/simulations/index.ts
by adding it to thesims/
map. - (temporary) pass in the name of the simulation you wish to run in
src/index.ts
:
(async () => {
await startSim('yourSimulationName'); // update
})();
- Run
yarn build:run
to run your simulation.
- Setup example with Playwright Test Runner
- Document Docker set up and deployment to AWS instructions
- Add documentation video and audio mocking