Git Product home page Git Product logo

coverage-360's Introduction

coverage-360

Scena 360's end-to-end (E2E) testing setup.


Join the Scena 360 Community!

Discord Shield

Features

Use cases

  • Learn how to write tests that modify entities programmatically and visually inspect them
  • Test VR interactions like hand-controls when you don't have a headset with you
  • Set up E2E tests and a CI pipeline for your A-frame projects
  • Use this repository for inspiration and make your A-frame projects more reliable!
  • Automate and run E2E tests in the cloud using Github Actions

Running the Example

  1. Make sure that you have the latest stable version of Yarn and Node.JS installed

  2. Run yarn intsall

  3. Run yarn test:e2e to run the example E2E test suite (e2e/example.test.js)

Preview

Sample test cases from e2e/example.test.js

it("loads a yellow cylinder", async () => {
  const color = await getShapeColor(page1, "a-cylinder");
  expect(color).toStrictEqual("#FFC65D");
});

it("animated entity reaches final height", async () => {
  const animatedBoxLoaded = await waitForEntityLoaded(page1, "#animated-box");
  expect(animatedBoxLoaded).toStrictEqual(true);

  await sleep(3000); // sleep for `dur` amount of ms
  const animatedBoxPosition = await page1.evaluate(() =>
    document.querySelector("#animated-box").getAttribute("position")
  );

  expect(animatedBoxPosition.x).toStrictEqual(0);
  expect(animatedBoxPosition.y).toStrictEqual(3);
  expect(animatedBoxPosition.z).toStrictEqual(-4);
});

File Structure

|_ .github
  |_ workflows/ # the Github Action configuration
|_ e2e
  |_ helpers # helpers/utilties for testing, querying/manipulating entities elements, etc.
  |_ example.test.js # example test suite
  |_ jest.config.js # Jest configuration
|_ .babelrc # Babel configuration so that imports/exports work
|_ index.html # sample Aframe application from aframe.io
|_ jest-puppeteer.config.js # https://github.com/smooth-code/jest-puppeteer/#configure-puppeteer

  • Contributions and forks are welcome!
  • Questions, suggestions, etc. can be posted in the issues tab or in the Scena 360 Community
  • More examples and resources coming soon!

coverage-360's People

Contributors

djoksimo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

djoksimo ornalabs

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.