Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maxnowack/spaceshow
Wrapper for easily testing meteor apps with puppeteer
https://github.com/maxnowack/spaceshow
chrome meteor node puppeteer testing
Last synced: 3 months ago
JSON representation
Wrapper for easily testing meteor apps with puppeteer
- Host: GitHub
- URL: https://github.com/maxnowack/spaceshow
- Owner: maxnowack
- License: mit
- Created: 2018-02-16T09:59:48.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-20T16:36:36.000Z (almost 7 years ago)
- Last Synced: 2024-04-24T16:38:16.314Z (8 months ago)
- Topics: chrome, meteor, node, puppeteer, testing
- Language: JavaScript
- Size: 67.4 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spaceshow [![Build Status](https://travis-ci.org/maxnowack/spaceshow.svg?branch=master)](https://travis-ci.org/maxnowack/spaceshow)
Wrapper for easily testing meteor apps with puppeteer## Installation
````bash
$ npm install --save spaceshow
````## Usage
````javascript
import spaceshow from 'spaceshow';const app = await spaceshow({
appDir: `${__dirname}/meteor-test-app`, // path to your meteor app (required)
port: 3000, // port to run your app. default to 3000
settings: '…' // settings JSON string or file relative to app directory
args: […], // custom args to pass to meteor command
meteorPath: '…', // custom path for running meteor command
puppeteerOptions: { … } // custom puppeteer options. see https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions
initialGotoOptions: { … } // options for initial goto call (setting a different timeout for example)
});// for more commands see https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#class-page
await page.waitForSelector('h1');
const html = await page.evaluate(() => document.querySelector('h1').innerHTML);console.log(html);
await page.close();
````If you want more control over the whole process, you can also instantiate spaceshow by yourself
````javascript
import { Spaceshow } from 'spaceshow';const show = new Spaceshow({
// options like in the example above
});// log meteor output
show.on('stdout', (data) => {
console.log(data);
});
show.on('stderr', (data) => {
console.error(data);
});const app = await show.start();
// …
````## License
Licensed under MIT license. Copyright (c) 2018 Max Nowack## Contributions
Contributions are welcome. Please open issues and/or file Pull Requests.## Maintainers
- Max Nowack ([maxnowack](https://github.com/maxnowack))