Coder Social home page Coder Social logo

muppeteer's People

Contributors

codacy-badger avatar gidztech avatar huyhong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

muppeteer's Issues

Add docker support via configuration

It should be possible to add Docker support internally rather than the end user having to configure it all. The only dependency would be Docker being installed, which we can do dependency detection for.

Things to do:

  • Add config option so that someone can run tests in docker, default to latest stable release of Chrome, but perhaps allow tagging of a particular version too
  • Add dependency detection for Docker, and tell user to download it if not available
    -- CI, like Travis, will have a docker option
  • Make sure an Dockerfile for Chrome dependencies exists
  • Set up volume mount mapping to the visual path/report path for Docker container
  • Make sure cleanup of container/images exist
  • ...
  • Probs some other stuff I forgotten

Example tests should run on a local server

The example tests currently run on the live TodoMVC website. If that goes down or changes, the tests will break. A local server should be used in the tests with a copy of the example code base.

Pin docker image version to a release

Using latest tag for Docker Hub builds is not ideal because it's non deterministic, and breakages in Chrome could cause visuals failures out of the blue without the user knowing why.

  • Use chrome-headless-stable instead of chrome-headless-trunk because we don't want to keep releasing for every minor change - particularly unstable changes.
  • Pin the version in the docker-compose.yml file
  • Create a script to pull latest tags from Docker hub and update the docker-compose.yml file if there's a new tag. The script publish a PR for this.
  • Add an automated way to do this - for example, a daily job running on a server
  • Consider the approach to releasing a new version. PR could be automatically merged and a release published, but stuff on master would end up in it too without me knowing.

Add test coverage

There are currently no tests for the framework. They are needed to check for regressions and encourage TDD.

Create a UI for visualising all baselines and diffs

The current HTML report shows the diff image when a test fails but it would be useful in a dev environment to see all visual baselines and any diffs that were generated after tests run locally. We could then have an option to interactivity rebase visuals.

To achieve this, we need a task to launch a Node server (like Express) via a new CLI option and an associated JS function returned from ConfigureLauncher

Example tests occasionally fail on visual

TodoMVC has some animations, so the test occasionally fail in an intermediate animation state. Need to run turnOffAnimations extension function before running the tests.

waitForLoadedWebFontCountToBe times out even with a successful response

Issue:

When awaiting waitForLoadedWebFontCountToBe, the function times out even though a successful response has occurred.

Resolution
r.resourceType is not getter, it's a function, which needs to be invoked. We also should check the response code for success (200 OK or 304 Not Modified). Redirects would lead to a second request, where the response would be one of the above.

Security: update package use of puppeteer library

There is an advisory for the npm package puppeteer that can be solved by upgrading to a later version than v1.13.0. Muppeteer v1.3.0 currently uses puppeteer v1.2.0.

Please see below for detail on the issue:
https://nodesecurity.io/advisories/824

It appears that the below commit addresses the puppeteer dependency, but there is no corresponding release:
2c373c9

Would you consider a release addressing the above? Thank you.

shouldRebaseVisuals flag is missing as a CLI option

The CLI should accept all possible configurations other than the following, which must be provided as handlers to the configuration function internally:

  • componentTestUrlFactory
  • componentTestVisualPathFactory
  • onFinish

shouldRebaseVisuals is the only option missing currently.

"alpeware/chrome-headless-trunk:rev-599821" not found

to the tests to run I had to go into "/cromium/Dockerfile" line 1, and change

"FROM alpeware/chrome-headless-trunk:rev-599821"

to

"FROM alpeware/chrome-headless-trunk"

and in "src/utils/dockerChrome.js" comment out lines 125-128

// const data = readFileSync(dockerFilePath, { encoding: 'utf-8' });
// const previousTag = data.match(/:(.*)/)[1]; // get everything after : on same line
// const newData = data.replace(previousTag, latestTag);
// writeFileSync(dockerFilePath, newData, { encoding: 'utf-8' });

Investigate adding option to use Jest instead of Mocha

Originally I tried to use Jest for the runner but had problems getting a custom interface to work. This was quite some time ago, and Mocha was dead simple to use. Jest may have improved this area since then, so it's worth trying again.

Add more error handling around bad config, timeouts etc.

Problems with bad config or timeouts can lead to broken promises, and it's often difficult to determine the cause. More error handling is needed closer to the source to either resolve issues or throw useful messages up the stack.

ConfigureLauncher(...).launch is not a function

Firstly, thanks for creating this project. ๐Ÿ‘

I am trying to run a very basic test with muppeteer using CLI but getting below error. Can you please help me resolve it? Let me know if I am doing something wrong.
TypeError: ConfigureLauncher(...).launch is not a function

Attached is a screenshot.

image

Muppeteer.* prefix is not required in the test interface

The Muppeteer API exposes the page and assert modules onto the Muppeteer object, which is available in the context of the test interface. The two modules can just be put directly on the context to avoid the end user having to type Muppeteer.* all the time.

Remove alternative key press API function

An alternative press function was created a while back to work with the legacy keypress handler. It seems newer versions of Puppeteer have solved this so the naughtyPress function can go away.

Add contributing/code of conduct etc.

In preparation for allowing community to contribute to the project, we need the necessary documentation, such as a contributing file and a code of conduct, plus anything else I can think of.

About "testFilter" option

I want to make muppeteer run **/*.js files, but now I can't because:

path.basename(file).substr(-7) === 'test.js'

It seems that if you have configured the option testFilter: '.js' it only runs 'test.js' file.

I don't understand why it is designed in this way, is there anyway to run **/*.js files?

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.