huddleeng / muppeteer Goto Github PK
View Code? Open in Web Editor NEWVisual regression testing framework for Chrome
License: MIT License
Visual regression testing framework for Chrome
License: MIT License
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:
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.
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.
chrome-headless-stable
instead of chrome-headless-trunk
because we don't want to keep releasing for every minor change - particularly unstable changes.docker-compose.yml
filedocker-compose.yml
file if there's a new tag. The script publish a PR for this.There are currently no tests for the framework. They are needed to check for regressions and encourage TDD.
test-launcher
should be in lib
, move misc API functions into separate files.
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
TodoMVC has some animations, so the test occasionally fail in an intermediate animation state. Need to run turnOffAnimations
extension function before running the tests.
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.
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.
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.
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' });
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.
The waitForResource function is erroring on the URL check in the latest version of Puppeteer.
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.
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.
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.
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.
I want to make muppeteer run **/*.js
files, but now I can't because:
Muppeteer/lib/test-launcher.js
Line 94 in 529f669
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.