Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test js behat #141

Merged
merged 22 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"