This repository was archived by the owner on Aug 6, 2018. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Backstop 3.x and Chrome Headless. Fixes #4
- Switched to node:8.5.0-alpine (Alpine 3.6) - Using the latest Chromium version from alpine/edge (Chromy requires Chrome ver.61 or later) - Cleaned up SlimerJS dependencies - Using GNU grep for compatibility (busybox grep uses -r vs -R) - Setting NPM_CONFIG_UNSAFE_PERM=true for compatibility between phantomjs-prebuilt and recent nodejs/npm versions - Added basic bats tests - Updated README
- Loading branch information
Showing
5 changed files
with
174 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
language: generic | ||
|
||
services: | ||
- docker | ||
|
||
install: | ||
- curl -fsSL get.docksal.io | sh | ||
- fin version | ||
- fin sysinfo | ||
|
||
script: | ||
- make && make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-include env_make | ||
|
||
VERSION ?= 3 | ||
|
||
REPO = docksal/backstopjs | ||
NAME = docksal-backstopjs-$(VERSION) | ||
|
||
.PHONY: build test push shell run start stop logs clean release | ||
|
||
build: | ||
fin docker build -t $(REPO):$(VERSION) . | ||
|
||
test: | ||
IMAGE=$(REPO):$(VERSION) NAME=$(NAME) tests/test.bats | ||
|
||
shell: | ||
fin docker run --rm --name $(NAME) -it $(PORTS) $(VOLUMES) $(ENV) --entrypoint=bash $(REPO):$(VERSION) | ||
|
||
clean: | ||
fin docker rm -f $(NAME) || true | ||
|
||
default: build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
#!/usr/bin/env bats | ||
|
||
PHANTOMJS_VERSION=2.1.1 | ||
CASPERJS_VERSION=1.1.4 | ||
SLIMERJS_VERSION=0.10.3 | ||
BACKSTOPJS_VERSION=3.0.25 | ||
CHROMIUM_VERSION=61.0 | ||
FIREFOX_VERSION=52.3 | ||
|
||
# Debugging | ||
teardown() { | ||
echo | ||
# TODO: figure out how to deal with this (output from previous run commands showing up along with the error message) | ||
echo "Note: ignore the lines between \"...failed\" above and here" | ||
echo | ||
echo "Status: $status" | ||
echo "Output:" | ||
echo "================================================================" | ||
echo "$output" | ||
echo "================================================================" | ||
} | ||
|
||
# Global skip | ||
# Uncomment below, then comment skip in the test you want to debug. When done, reverse. | ||
#SKIP=1 | ||
|
||
@test "Check PhantomJS" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Tests ### | ||
|
||
run fin docker run --name ${NAME} --rm --entrypoint="" ${IMAGE} phantomjs --version | ||
echo "$output" | grep -F ${PHANTOMJS_VERSION} | ||
} | ||
|
||
@test "Check SlimerJS" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Tests ### | ||
|
||
run fin docker run --name ${NAME} --rm --entrypoint="" ${IMAGE} slimerjs --version | ||
echo "$output" | grep -F ${SLIMERJS_VERSION} | ||
} | ||
|
||
@test "Check CasperJS" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Tests ### | ||
|
||
run fin docker run --name ${NAME} --rm --entrypoint="" ${IMAGE} casperjs --version | ||
echo "$output" | grep -F ${CASPERJS_VERSION} | ||
} | ||
|
||
@test "Check BackstopJS" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Tests ### | ||
|
||
run fin docker run --name ${NAME} --rm --entrypoint="" ${IMAGE} backstop --version | ||
echo "$output" | grep -F ${BACKSTOPJS_VERSION} | ||
} | ||
|
||
@test "Check Chrome" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Tests ### | ||
|
||
run fin docker run --name ${NAME} --rm --entrypoint="" ${IMAGE} chromium-browser --version | ||
echo "$output" | grep -F ${CHROMIUM_VERSION} | ||
} | ||
|
||
@test "Check Firefox" { | ||
[[ $SKIP == 1 ]] && skip | ||
|
||
### Tests ### | ||
|
||
run fin docker run --name ${NAME} --rm --entrypoint="" ${IMAGE} firefox --version | ||
echo "$output" | grep ${FIREFOX_VERSION} | ||
} |