Skip to content

Commit 3e51b29

Browse files
author
David Ferlay
committed
Refactored behat implementation for RA
1 parent 6ce26ff commit 3e51b29

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

scripts/makefile/tests.mk

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,21 @@ behat:
8989
ifdef REVIEW_DOMAIN
9090
$(eval BASE_URL := $(MAIN_DOMAIN_NAME))
9191
else
92-
$(eval BASE_URL := $(shell docker inspect --format="{{.NetworkSettings.Networks.$(COMPOSE_NET_NAME).IPAddress}}" $(COMPOSE_PROJECT_NAME)_web))
93-
endif
94-
ifeq ($(shell docker ps -f 'name=$(COMPOSE_PROJECT_NAME)_chrome' --format '{{.Names}}'), )
95-
@echo 'Browser driver is stoped. Running it.'
96-
make -s browser_driver
92+
$(eval BASE_URL := $(shell docker inspect --format='{{(index .NetworkSettings.Networks "$(COMPOSE_NET_NAME)").IPAddress}}' $(COMPOSE_PROJECT_NAME)_web))
9793
endif
94+
echo "Base URL: " $(BASE_URL)
95+
if [ -z `docker ps -f 'name=$(COMPOSE_PROJECT_NAME)_chrome' --format '{{.Names}}'` ]; then \
96+
echo 'Browser driver is stoped. Running it.'; \
97+
make -s browser_driver; \
98+
fi
9899
@echo "Replacing URL_TO_TEST value in behat.yml with http://$(BASE_URL)"
99100
$(call php, cp behat.default.yml behat.yml)
100101
$(call php, sed -i "s/URL_TO_TEST/http:\/\/$(BASE_URL)/" behat.yml)
101102
@echo "Running Behat scenarios against http://$(BASE_URL)"
102103
$(call php, composer install -o)
103104
$(call php, vendor/bin/behat -V)
104105
$(call php, vendor/bin/behat --colors)
106+
make browser_driver_stop
105107

106108
behatdl:
107109
$(call php, vendor/bin/behat -dl --colors)
@@ -116,7 +118,7 @@ browser_driver:
116118
--remote-debugging-address=0.0.0.0 --remote-debugging-port=9222 --no-sandbox \
117119
--entrypoint "" chromium-browser --headless --disable-gpu \
118120
--window-size=1200,2080 \
119-
--disable-web-security
121+
--disable-web-security --w3c=false
120122

121123
## Stop browser driver
122124
browser_driver_stop:

0 commit comments

Comments
 (0)