Giter Site home page Giter Site logo

manual-tests's People

Contributors

cmumford avatar gsinafirooz avatar nondebug avatar outofambit avatar reillyeon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

manual-tests's Issues

Create pull request template

Create a template for external pull requests. This should include guidelines for development and formatting - best practices which cannot be caught by automated tests.

Document test coverage status

Currently the Web Bluetooth manual test coverage is listed in the internal document. We can consider to move the test coverage in the internal document to https://github.com/WebBluetoothCG/manual-tests/blob/main/README.md or create a new one called ROADMAP.md or TEST_COVERAGE.md. This way the information is easier to discover when browsing the test code files.

For each row entry in the test coverage list, in addition to show status and the API like currently we have in the internal document.

Status Function/Attribute
โœ… BluetoothCharacteristicProperties.read

We can consider add another column to indicate that can be tested in what test directory in the repo or point to the test page (ex: https://webbluetoothcg.github.io/manual-tests/characteristic_read/)

Status Function/Attribute Test link
โœ… BluetoothCharacteristicProperties.read https://webbluetoothcg.github.io/manual-tests/characteristic_read/

Automate Running Tests

Hi! My team at @bocoup is working on automating these bluetooth API tests for Chrome. We'd like to take a more general approach so other browsers can benefit from these tests once they have implemented the Web Bluetooth API. I want to outline our proposed approach here to get any preliminary feedback y'all might have.

Implementation overview

Browser agnostic implementation

  • Implement a script for running the existing tests with tap.
    • Takes command line arguments to specify
      • the bluetooth device name to connect to (by either a string for exact match or a regex) and
      • the browser environment to test under.
    • This script will iterate through the tests in this repo, wrapping them in a basic tap test script that asserts the test passed.
    • Prints the debug information currently shown at the bottom of the test pages.
    • All tests will be run serially
  • An interface that mocks necessary browser-specific implementations to complete these tests automatedly. Where possible we'll write browser non-specific implementations.
    • Utility to initialize the driver
    • Utility to create session/target
    • Utility to upload espruino code
    • Utility to run JS test code
    • Utility to teardown or reset session/target
    • Utility to shut down the driver

Chrome-specific driver implementation

After this, we will proceed to implement the mocked utilities functionality for Chrome. This will primarily entail implementing the above utilities with puppeteer.

Usage

$ cd run_tests/
$ npm install
$ npm run test -- --device [device name regex] --browser [browser name]

Folder structure

/run_tests/
  index.js (cli file)
  package.json (dependencies needed to run automated test suite)
  test.js (wrapper for existing html tests)
  driver-mock.js (interface mock)
  shared/
    shared.js (shared utilities not specific to any browser)
  chrome/
    driver.js (chrome implementations)
    ... (other chrome implementation files)

Questions for feedback

  • Should we use TypeScript for the code written as part of this work? This adds some complexity, but is fairly small since currently no JavaScripst in the repo is run outside of a browser and there would be a clear division between TS and JS files in the folder structure.
  • Should we use a different folder or path to contain the file structure outlined above? (for example /scripts/run_tests/ instead of /run_tests/)

Please let me know if there's anything I can further clarify!

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.