GithubHelp home page GithubHelp logo

isabella232 / bedrock Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tinymce/bedrock

0.0 0.0 0.0 2.21 MB

Test runner for browser-based JavaScript tests

License: Other

JavaScript 2.11% HTML 0.51% CSS 0.79% AppleScript 0.20% TypeScript 96.30% Dockerfile 0.10%

bedrock's Introduction

Description

bedrock is a test runner for JavaScript projects. Its primary use is to test Javascript projects, but it also has a qunit wrapper. It can run manually (where the user navigates to the browser themselves), or automatically (where bedrock starts the browser and runs the tests automatically). Note, in order to run the tests automatically, the appropriate web-drivers need to be installed and available. For more information on setting up web-drivers, see here.

Installation

bedrock is available as an npm package. You can install it via the npm package @ephox/bedrock or from source

Global Install

A global install will put the bedrock commands (e.g. bedrock-auto) automatically on your path.

Install from npm

$ npm install -g @ephox/bedrock

Install from source (start in source directory)

$ npm install -g .

Local Install

A local install will not put the bedrock commands automatically on your path. After installing locally, you can access the commands via:

  1. adding node_modules/.bin to your path
  2. using npm run ${command} from the bedrock source directory

Install from npm

npm install @ephox/bedrock.

Install from source (start in source directory)

$ npm install .

Usage

Bedrock has two main modes: test and server. These are available through the commands bedrock-auto and bedrock.

Test mode (bedrock-auto)

Test mode allows the user to run tests in an automated fashion. Bedrock will spin up the browser itself (assuming the user has the right web-drivers on the path), establish a web-driver connection with this browser and close the browser once the tests have completed. Information on installing web-drivers can be found here.

BROWSER: chrome | firefox | safari | MicrosoftEdge | ie | phantomjs

e.g. run automated bedrock tests in chrome against test directory src/test/js/browser

bedrock-auto --browser chrome --testdir src/test/js/browser

Use bedrock-auto --help to see all arguments possible.

Server mode (bedrock)

Server mode allows the user to host the tests on localhost:{port} where port is the first free port found between 8000 and 20000. It is the most commonly used mode, and therefore is the default bedrock executable.

bedrock --files src/test/js/browser/TwoTest.ts

Use bedrock --help to see all arguments possible.

Tests

You can run bedrock's tests by executing:

$ npm run test

This will not run test-samples-fail which will need to be run and verified manually. (All should fail)

If you just want to run the basic tests (not property-based), use $ npm run test-atomic. If you want to run only the property-based tests, use $ npm run test-props. If you want to run the sample tests use $ npm run test-samples-pass and $ npm run test-samples-fail.

Docker

The dockerfile is just to test the no-sandbox option for chrome-headless. We should build automated tests for it.

FAQ

Why is the junit XML output not pretty-printed?

It's to do with "escaping" CDATA end tokens ("]]>") in the output. If we pretty-print it, we get extraneous whitespace in the junit output rendered in Jenkins.

See the comment in modules/server/src/main/ts/bedrock/core/Reporter.ts

Contributing

See CONTRIBUTING.md

bedrock's People

Contributors

ephox-mogran avatar lnewson avatar thespyder avatar spocke avatar tiny-james avatar techtangents avatar simonfc avatar dependabot[bot] avatar tinydylan avatar metricjs avatar jhaines avatar mimo84 avatar

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.