Skip to content

Commit

Permalink
Merge pull request #141 from palantirnet/test-js-behat
Browse files Browse the repository at this point in the history
Test js behat
  • Loading branch information
iajon authored Feb 2, 2023
2 parents 6034102 + 44a7f4b commit 871ccd1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 38 deletions.
5 changes: 3 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ jobs:
- run:
name: Run Behat tests
command: |
nohup php -S ${CIRCLE_PROJECT_REPONAME}.local:8000 -t $(pwd)/web/ > /tmp/artifacts/phpd.log 2>&1 &
vendor/bin/behat --profile=circleci --suite=default --strict --format=junit --out=/tmp/artifacts
nohup php -S ${CIRCLE_PROJECT_REPONAME}.local:8000 -t $(pwd)/web/ > /tmp/artifacts/phpd.log 2>&1 &
google-chrome --headless --remote-debugging-port=9222 &>/dev/null &
vendor/bin/behat --profile=circleci --suite=default --strict --format=junit --out=/tmp/artifacts
- store_artifacts:
path: /tmp/artifacts
- store_test_results:
Expand Down
21 changes: 21 additions & 0 deletions .ddev/docker-compose.chrome.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This was taken from https://github.com/drud/ddev-contrib/tree/master/docker-compose-services/headless-chrome.
version: '3.6'
services:
chrome:
image: isholgueras/chrome-headless:latest
restart: unless-stopped
container_name: ddev-${DDEV_SITENAME}-chrome
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
volumes:
- ddev-global-cache:/mnt/ddev-global-cache
- ".:/mnt/ddev_config"
external_links:
- "ddev-router:${DDEV_HOSTNAME}"
cap_add:
- SYS_ADMIN
ports:
# Exposing this port allows you to visit 127.0.0.1:9222 to see what Headless Chrome doing without
# any additional configuration; However, you can only have one project using this port at a time.
- '9222:9222'
36 changes: 0 additions & 36 deletions behat.yml

This file was deleted.

2 changes: 2 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
"drush/drush": "^11"
},
"require-dev": {
"behat/behat": "^3.12",
"behat/mink-goutte-driver": "^2.0",
"dmore/behat-chrome-extension": "^1.4",
"drupal/core-dev": "^10",
"drupal/drupal-extension": "^5@alpha",
"palantirnet/the-build": "^4@beta"
Expand Down
12 changes: 12 additions & 0 deletions features/js_behat_test.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@api @javascript
Feature: Installation
As a Drupal developer
I want to use javaScript in Behat tests
So that I can rely on the build for my project.

Scenario: Verify that js behat test works.
Given I am logged in as a user with the "administrator" role
When I am on "/admin/modules/update"
And I should see the link "Check manually"
And I click "Check manually"
Then I should see the text "Status message"

0 comments on commit 871ccd1

Please sign in to comment.