mmunz / ddev-backstopjs Goto Github PK
View Code? Open in Web Editor NEWddev addon to provide a backstopjs container for visual regression testing
License: Apache License 2.0
ddev addon to provide a backstopjs container for visual regression testing
License: Apache License 2.0
The de-facto way of updating ddev addons is by running ddev get
again:
ddev get mmunz/ddev-backstopjs
This fails if .gitignore
is self-managed:
$ ddev get mmunz/ddev-backstopjs --verbose
Installing mmunz/ddev-backstopjs:v1.0.3
Downloading https://api.github.com/repos/mmunz/ddev-backstopjs/tarball/v1.0.3
v1.0.3_1199366832.tar.gz 8.89 KiB / 8.89 KiB [==================================================================================================] 100.00% 0s
Executing pre-install actions:
+ set -eu -o pipefail
+ test -d /home/bserem/Development/REDACTED/tests/backstop
+ set -eu -o pipefail
+ test -f /home/bserem/Development/REDACTED/tests/backstop/.gitignore
+ set -eu -o pipefail
+ grep -q '## ddev-generated' /home/bserem/Development/REDACTED/tests/backstop/.gitignore
๐
Could not process pre-install action (2) ''; error=Unable to run action set -x; set -eu -o pipefail
grep -q "## ddev-generated" ${DDEV_APPROOT}/tests/backstop/.gitignore && printf "## ddev-generated\n**/bitmaps_test\n**/html_report\n" > ${DDEV_APPROOT}/tests/backstop/.gitignore: exit status 1, output=+ set -eu -o pipefail
+ grep -q '## ddev-generated' /home/bserem/Development/REDACTED/tests/backstop/.gitignore
action=grep -q "## ddev-generated" ${DDEV_APPROOT}/tests/backstop/.gitignore && printf "## ddev-generated\n**/bitmaps_test\n**/html_report\n" > ${DDEV_APPROOT}/tests/backstop/.gitignore
I have removed ## ddev-generated
line from the .gitignore
file, as I do not want to store the reference files.
This is a minor issue, but might be good to find a way around it, especially if there are plans to add this to the official addons in the future.
Thanks
I'm trying to use this addon but I get following error:
BackstopJS v6.2.2
Loading config: /src/backstop.json
COMMAND | Executing core for "test"
createBitmaps | Selected 1 of 1 scenarios.
Puppeteer old Headless deprecation warning:
In the near feature `headless: true` will default to the new Headless mode
for Chrome instead of the old Headless implementation. For more
information, please see https://developer.chrome.com/articles/new-headless/.
Consider opting in early by passing `headless: "new"` to `puppeteer.launch()`
If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose.
Puppeteer old Headless deprecation warning:
In the near feature `headless: true` will default to the new Headless mode
for Chrome instead of the old Headless implementation. For more
information, please see https://developer.chrome.com/articles/new-headless/.
Consider opting in early by passing `headless: "new"` to `puppeteer.launch()`
If you encounter any bugs, please report them to https://github.com/puppeteer/puppeteer/issues/new/choose.
Cookie state restored with: [
{
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "Lax",
"url": "https://.www.yourdomain.com"
}
]
Cookie state restored with: [
{
"path": "/",
"name": "yourCookieName",
"value": "yourCookieValue",
"expirationDate": 1798790400,
"hostOnly": false,
"httpOnly": false,
"secure": false,
"session": false,
"sameSite": "Lax",
"url": "https://.www.yourdomain.com"
}
]
Puppeteer encountered an error while running scenario "homepage"
Error: net::ERR_CONNECTION_REFUSED at https://powerme.ddev.site/
Puppeteer encountered an error while running scenario "homepage"
Error: net::ERR_CONNECTION_REFUSED at https://powerme.ddev.site/
COMMAND | Executing core for "report"
compare | Reference image not found powerme_homepage_0__0_phone.png
compare | Reference image not found powerme_homepage_0__1_tablet.png
report | Test completed...
report | 0 Passed
report | 2 Failed
report | Writing browser report
report | Resources copied
report | Copied json report to: /src/backstop_data/bitmaps_test/20231219-084619/report.json
report | Copied jsonp report to: /src/backstop_data/html_report/config.js
COMMAND | Executing core for "openReport"
openReport | Attempting to ping
openReport | Remote not found. Opening backstop_data/html_report/index.html
report | *** Mismatch errors found ***
COMMAND | Command "report" ended with an error after [0.084s]
COMMAND | Error: Mismatch errors found.
at /usr/local/lib/node_modules/backstopjs/core/command/report.js:284:17
at processTicksAndRejections (node:internal/process/task_queues:96:5)
COMMAND | Command "test" ended with an error after [0.993s]
COMMAND | Error: Mismatch errors found.
at /usr/local/lib/node_modules/backstopjs/core/command/report.js:284:17
at processTicksAndRejections (node:internal/process/task_queues:96:5)
Failed to run backstop test: exit status 1
I'm not sure why I get
Error: net::ERR_CONNECTION_REFUSED at https://powerme.ddev.site/
When I tried this with not docker internal urls it works as expected
this is my backstop.json:
{
"id": "backstop_default",
"viewports": [
{
"label": "phone",
"width": 320,
"height": 480
},
{
"label": "tablet",
"width": 1024,
"height": 768
}
],
"onBeforeScript": "puppet/onBefore.js",
"onReadyScript": "puppet/onReady.js",
"scenarios": [
{
"label": "homepage",
"cookiePath": "backstop_data/engine_scripts/cookies.json",
"url": "https://powerme.ddev.site/",
"referenceUrl": "https://www.powerme.gr/",
"readyEvent": "",
"readySelector": "",
"delay": 0,
"hideSelectors": [],
"removeSelectors": [],
"hoverSelector": "",
"clickSelector": "",
"postInteractionWait": 0,
"selectors": [],
"selectorExpansion": true,
"expect": 0,
"misMatchThreshold" : 0.1,
"requireSameDimensions": true
}
],
"paths": {
"bitmaps_reference": "backstop_data/bitmaps_reference",
"bitmaps_test": "backstop_data/bitmaps_test",
"engine_scripts": "backstop_data/engine_scripts",
"html_report": "backstop_data/html_report",
"ci_report": "backstop_data/ci_report"
},
"report": ["browser"],
"engine": "puppeteer",
"engineOptions": {
"args": ["--no-sandbox"]
},
"asyncCaptureLimit": 5,
"asyncCompareLimit": 50,
"debug": false,
"debugWindow": false
}
Any suggestion on how to solve this?
Right after ddev get mmunz/ddev-backstopjs
and ddev restart
the restart takes a long time. I suppose it downloads backstop. There is nothing displayed to the end user however. Is the default ddev output when downloading images supresed somehow?
It's not a big deal, but definitely a good thing to have, especially for people on slow connections
I get this output and everything is red:
ddev restart
Restarting project mysite.eu...
Network ddev-mysiteeu_default Removed
Network ddev-mysiteeu_default created
Building project images...
....................................................................................................................................................................................failed to solve: process "/bin/sh -c apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo \"ALL ALL=NOPASSWD: ALL\" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop" did not complete successfully: exit code: 2
Failed to restart mysite.eu: docker-compose build failed: composeCmd failed to run 'COMPOSE_PROJECT_NAME=ddev-mysiteeu docker-compose -f /home/hannes/Sites/bef/mysite/.ddev/.ddev-docker-compose-full.yaml --progress=plain build', action='[]', err='exit status 17', stdout='#0 building with "default" instance using docker driver
#1 [backstop internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s
#2 [backstop internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.11kB done
#2 DONE 0.0s
#3 [web internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [backstop internal] load metadata for docker.io/backstopjs/backstopjs:6.2.2
#4 DONE 0.0s
#5 [backstop 1/8] FROM docker.io/backstopjs/backstopjs:6.2.2
#5 DONE 0.0s
#6 [backstop internal] load build context
#6 transferring context: 35B done
#6 DONE 0.0s
#7 [backstop 3/8] RUN chmod +x /entrypoint.sh
#7 CACHED
#8 [backstop 2/8] COPY ./entrypoint.sh /entrypoint.sh
#8 CACHED
#9 [backstop 4/8] RUN userdel -r node
#9 CACHED
#10 [backstop 5/8] RUN (groupadd --gid 1000 "hannes" || groupadd "hannes" || true) && (useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' --uid 1000 "hannes" || useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --gid "1000" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --comment '' hannes )
#10 CACHED
#11 [web internal] load build definition from Dockerfile
#11 transferring dockerfile: 1.00kB done
#11 DONE 0.0s
#12 [db internal] load .dockerignore
#12 transferring context: 2B done
#12 DONE 0.0s
#13 [db internal] load build definition from Dockerfile
#13 transferring dockerfile: 638B 0.0s done
#13 DONE 0.1s
#14 [web internal] load metadata for docker.io/ddev/ddev-webserver:v1.22.6
#14 DONE 0.0s
#15 [web 1/4] FROM docker.io/ddev/ddev-webserver:v1.22.6
#15 DONE 0.0s
#16 [web 3/4] RUN export XDEBUG_MODE=off; composer self-update --stable || composer self-update --stable || true; composer self-update --2 || composer self-update --2 || true
#16 CACHED
#17 [web 2/4] RUN (groupadd --gid 1000 "hannes" || groupadd "hannes" || true) && (useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' --uid 1000 "hannes" || useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --gid "1000" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --comment '' hannes )
#17 CACHED
#18 [web 4/4] RUN mkdir -p /home/hannes && chown hannes /home/hannes && chmod 600 /home/hannes/.pgpass
#18 CACHED
#19 [web] exporting to image
#19 exporting layers done
#19 writing image sha256:0a15f95ee0ade69c3af7baefd65d31cb665e26f13180fe1ef48b10a28c3a922d done
#19 naming to docker.io/ddev/ddev-webserver:v1.22.6-mysite.eu-built
#19 naming to docker.io/ddev/ddev-webserver:v1.22.6-mysite.eu-built 0.0s done
#19 DONE 0.0s
#20 [db internal] load metadata for docker.io/ddev/ddev-dbserver-mariadb-10.4:v1.22.6
#20 DONE 0.0s
#21 [db 1/2] FROM docker.io/ddev/ddev-dbserver-mariadb-10.4:v1.22.6
#21 DONE 0.0s
#22 [db 2/2] RUN (groupadd --gid 1000 "hannes" || groupadd "hannes" || true) && (useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' --uid 1000 "hannes" || useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --gid "1000" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --comment '' hannes )
#22 CACHED
#23 [db] exporting to image
#23 exporting layers done
#23 writing image sha256:fa4023d051f037be84f9306dd251d1e6840419c31ac29bcc9ded2236e5ff4048 0.0s done
#23 naming to docker.io/ddev/ddev-dbserver-mariadb-10.4:v1.22.6-mysite.eu-built 0.0s done
#23 DONE 0.0s
#24 [backstop 6/8] RUN apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop
#24 0.380
#24 0.380 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#24 0.380
#24 60.45 Err:1 http://deb.debian.org/debian bullseye InRelease
#24 60.45 Temporary failure resolving 'deb.debian.org'
#24 120.5 Err:2 http://deb.debian.org/debian-security bullseye-security InRelease
#24 120.5 Temporary failure resolving 'deb.debian.org'
#24 180.5 Err:3 http://deb.debian.org/debian bullseye-updates InRelease
#24 180.5 Temporary failure resolving 'deb.debian.org'
#24 180.6 Reading package lists...
#24 180.6 Building dependency tree...
#24 180.6 Reading state information...
#24 180.6 All packages are up to date.
#24 180.6 W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease Temporary failure resolving 'deb.debian.org'
#24 180.6 W: Failed to fetch http://deb.debian.org/debian-security/dists/bullseye-security/InRelease Temporary failure resolving 'deb.debian.org'
#24 180.6 W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease Temporary failure resolving 'deb.debian.org'
#24 180.6 W: Some index files failed to download. They have been ignored, or old ones used instead.
#24 180.6
#24 180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#24 180.6
#24 180.6 Reading package lists...
#24 180.6 Building dependency tree...
#24 180.6 Reading state information...
#24 180.6 E: Unable to locate package sudo
#24 180.6
#24 180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#24 180.6
#24 180.6 /bin/sh: 1: cannot create /etc/sudoers.d/ddev-backstop: Directory nonexistent
#24 ERROR: process "/bin/sh -c apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo \"ALL ALL=NOPASSWD: ALL\" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop" did not complete successfully: exit code: 2
------
> [backstop 6/8] RUN apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop:
180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
180.6
180.6 Reading package lists...
180.6 Building dependency tree...
180.6 Reading state information...
180.6 E: Unable to locate package sudo
180.6
180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
180.6
180.6 /bin/sh: 1: cannot create /etc/sudoers.d/ddev-backstop: Directory nonexistent
------
', stderr='failed to solve: process "/bin/sh -c apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo \"ALL ALL=NOPASSWD: ALL\" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop" did not complete successfully: exit code: 2', output='#0 building with "default" instance using docker driver
#1 [backstop internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s
#2 [backstop internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.11kB done
#2 DONE 0.0s
#3 [web internal] load .dockerignore
#3 transferring context: 2B done
#3 DONE 0.0s
#4 [backstop internal] load metadata for docker.io/backstopjs/backstopjs:6.2.2
#4 DONE 0.0s
#5 [backstop 1/8] FROM docker.io/backstopjs/backstopjs:6.2.2
#5 DONE 0.0s
#6 [backstop internal] load build context
#6 transferring context: 35B done
#6 DONE 0.0s
#7 [backstop 3/8] RUN chmod +x /entrypoint.sh
#7 CACHED
#8 [backstop 2/8] COPY ./entrypoint.sh /entrypoint.sh
#8 CACHED
#9 [backstop 4/8] RUN userdel -r node
#9 CACHED
#10 [backstop 5/8] RUN (groupadd --gid 1000 "hannes" || groupadd "hannes" || true) && (useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' --uid 1000 "hannes" || useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --gid "1000" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --comment '' hannes )
#10 CACHED
#11 [web internal] load build definition from Dockerfile
#11 transferring dockerfile: 1.00kB done
#11 DONE 0.0s
#12 [db internal] load .dockerignore
#12 transferring context: 2B done
#12 DONE 0.0s
#13 [db internal] load build definition from Dockerfile
#13 transferring dockerfile: 638B 0.0s done
#13 DONE 0.1s
#14 [web internal] load metadata for docker.io/ddev/ddev-webserver:v1.22.6
#14 DONE 0.0s
#15 [web 1/4] FROM docker.io/ddev/ddev-webserver:v1.22.6
#15 DONE 0.0s
#16 [web 3/4] RUN export XDEBUG_MODE=off; composer self-update --stable || composer self-update --stable || true; composer self-update --2 || composer self-update --2 || true
#16 CACHED
#17 [web 2/4] RUN (groupadd --gid 1000 "hannes" || groupadd "hannes" || true) && (useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' --uid 1000 "hannes" || useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --gid "1000" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --comment '' hannes )
#17 CACHED
#18 [web 4/4] RUN mkdir -p /home/hannes && chown hannes /home/hannes && chmod 600 /home/hannes/.pgpass
#18 CACHED
#19 [web] exporting to image
#19 exporting layers done
#19 writing image sha256:0a15f95ee0ade69c3af7baefd65d31cb665e26f13180fe1ef48b10a28c3a922d done
#19 naming to docker.io/ddev/ddev-webserver:v1.22.6-mysite.eu-built
#19 naming to docker.io/ddev/ddev-webserver:v1.22.6-mysite.eu-built 0.0s done
#19 DONE 0.0s
#20 [db internal] load metadata for docker.io/ddev/ddev-dbserver-mariadb-10.4:v1.22.6
#20 DONE 0.0s
#21 [db 1/2] FROM docker.io/ddev/ddev-dbserver-mariadb-10.4:v1.22.6
#21 DONE 0.0s
#22 [db 2/2] RUN (groupadd --gid 1000 "hannes" || groupadd "hannes" || true) && (useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' --uid 1000 "hannes" || useradd -l -m -s "/bin/bash" --gid "hannes" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --gid "1000" --comment '' "hannes" || useradd -l -m -s "/bin/bash" --comment '' hannes )
#22 CACHED
#23 [db] exporting to image
#23 exporting layers done
#23 writing image sha256:fa4023d051f037be84f9306dd251d1e6840419c31ac29bcc9ded2236e5ff4048 0.0s done
#23 naming to docker.io/ddev/ddev-dbserver-mariadb-10.4:v1.22.6-mysite.eu-built 0.0s done
#23 DONE 0.0s
#24 [backstop 6/8] RUN apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop
#24 0.380
#24 0.380 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#24 0.380
#24 60.45 Err:1 http://deb.debian.org/debian bullseye InRelease
#24 60.45 Temporary failure resolving 'deb.debian.org'
#24 120.5 Err:2 http://deb.debian.org/debian-security bullseye-security InRelease
#24 120.5 Temporary failure resolving 'deb.debian.org'
#24 180.5 Err:3 http://deb.debian.org/debian bullseye-updates InRelease
#24 180.5 Temporary failure resolving 'deb.debian.org'
#24 180.6 Reading package lists...
#24 180.6 Building dependency tree...
#24 180.6 Reading state information...
#24 180.6 All packages are up to date.
#24 180.6 W: Failed to fetch http://deb.debian.org/debian/dists/bullseye/InRelease Temporary failure resolving 'deb.debian.org'
#24 180.6 W: Failed to fetch http://deb.debian.org/debian-security/dists/bullseye-security/InRelease Temporary failure resolving 'deb.debian.org'
#24 180.6 W: Failed to fetch http://deb.debian.org/debian/dists/bullseye-updates/InRelease Temporary failure resolving 'deb.debian.org'
#24 180.6 W: Some index files failed to download. They have been ignored, or old ones used instead.
#24 180.6
#24 180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#24 180.6
#24 180.6 Reading package lists...
#24 180.6 Building dependency tree...
#24 180.6 Reading state information...
#24 180.6 E: Unable to locate package sudo
#24 180.6
#24 180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
#24 180.6
#24 180.6 /bin/sh: 1: cannot create /etc/sudoers.d/ddev-backstop: Directory nonexistent
#24 ERROR: process "/bin/sh -c apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo \"ALL ALL=NOPASSWD: ALL\" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop" did not complete successfully: exit code: 2
------
> [backstop 6/8] RUN apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo "ALL ALL=NOPASSWD: ALL" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop:
180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
180.6
180.6 Reading package lists...
180.6 Building dependency tree...
180.6 Reading state information...
180.6 E: Unable to locate package sudo
180.6
180.6 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
180.6
180.6 /bin/sh: 1: cannot create /etc/sudoers.d/ddev-backstop: Directory nonexistent
------
', stderr='failed to solve: process "/bin/sh -c apt update && apt install -y sudo; apt clean -qq && rm -rf /var/lib/apt/lists/*; echo \"ALL ALL=NOPASSWD: ALL\" > /etc/sudoers.d/ddev-backstop && chmod 440 /etc/sudoers.d/ddev-backstop" did not complete successfully: exit code: 2'
I was following through the readme when I hit the following
Hint: have a look at the config the author uses: https://github.com/mmunz/backstopjs-config
When I tried to click through, Github threw a 404
error.
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.