Skip to content

Commit be27cc7

Browse files
authored
VACMS-12445: Rip out BeHat tests. (#14340)
* VACMS-12445: Rip out BeHat tests. * Get PHPUnit tests working again.
1 parent 9f00b9d commit be27cc7

37 files changed

+391
-3170
lines changed

.ddev/config.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,5 @@ web_environment:
4949
- CMS_MARIADB_HOST=db
5050
- CYPRESS_TAGS=\"not @ignore and not @piv\"
5151
- DDEV_APPROOT=/var/www/html
52-
- "BEHAT_PARAMS={\\\"extensions\\\":{\\\"Behat\\\\MinkExtension\\\":{\\\"base_url\\\":\\\"http://va-gov-cms.ddev.site\\\"},\\\"Drupal\\\\DrupalExtension\\\":{\\\"drush\\\":{\\\"root\\\":\\\"/var/www/html/docroot\\\",\\\"alias\\\":\\\"@none\\\"},\\\"drupal\\\":{\\\"drupal_root\\\":\\\"/var/www/html/docroot\\\"}}}}"
5352
- DRUPAL_ADDRESS=https://va-gov-cms.ddev.site
5453
nodejs_version: "16"

.env.example

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
# Used by WEB build process.
99
DRUPAL_ADDRESS=https://va-gov-cms.ddev.site
1010

11-
# Used by behat tests.
12-
# DO NOT use environment variable insertion here. Other systems may load this in a different order.
13-
BEHAT_PARAMS={"extensions":{"Behat\\MinkExtension":{"base_url":"https://va-gov-cms.ddev.site"},"Drupal\\DrupalExtension":{"drush":{"root":"/var/www/html/docroot","alias":"@none"},"drupal":{"drupal_root":"/var/www/html/docroot"}}}}
14-
1511
# Keep this to ensure environment type is set.
1612
CMS_ENVIRONMENT_TYPE=local
1713

.gitattributes

+61-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,61 @@
1-
*.module linguist-language=PHP
2-
*.install linguist-language=PHP
1+
# Drupal git normalization
2+
# @see https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
# @see https://www.drupal.org/node/1542048
4+
5+
# Normally these settings would be done with macro attributes for improved
6+
# readability and easier maintenance. However macros can only be defined at the
7+
# repository root directory. Drupal avoids making any assumptions about where it
8+
# is installed.
9+
10+
# Define text file attributes.
11+
# - Treat them as text.
12+
# - Ensure no CRLF line-endings, neither on checkout nor on checkin.
13+
# - Detect whitespace errors.
14+
# - Exposed by default in `git diff --color` on the CLI.
15+
# - Validate with `git diff --check`.
16+
# - Deny applying with `git apply --whitespace=error-all`.
17+
# - Fix automatically with `git apply --whitespace=fix`.
18+
19+
*.config text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
20+
*.css text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
21+
*.dist text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
22+
*.engine text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
23+
*.html text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=html
24+
*.inc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
25+
*.install text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
26+
*.js text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
27+
*.json text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
28+
*.lock text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
29+
*.map text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
30+
*.md text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
31+
*.module text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
32+
*.php text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
33+
*.po text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
34+
*.profile text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
35+
*.script text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
36+
*.sh text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
37+
*.sql text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
38+
*.svg text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
39+
*.theme text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2 diff=php linguist-language=php
40+
*.twig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
41+
*.txt text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
42+
*.xml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
43+
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
44+
45+
# Define binary file attributes.
46+
# - Do not treat them as text.
47+
# - Include binary diff in patches instead of "binary files differ."
48+
*.eot -text diff
49+
*.exe -text diff
50+
*.gif -text diff
51+
*.gz -text diff
52+
*.ico -text diff
53+
*.jpeg -text diff
54+
*.jpg -text diff
55+
*.otf -text diff
56+
*.phar -text diff
57+
*.png -text diff
58+
*.svgz -text diff
59+
*.ttf -text diff
60+
*.woff -text diff
61+
*.woff2 -text diff

.github/workflows/continuous_integration.yml

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ jobs:
165165
matrix:
166166
language:
167167
- javascript
168-
- python
169168
steps:
170169
- name: Checkout
171170
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3

.github/workflows/set-tugboat-tests-pending.yml

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
- name: Set status for Tugboat tasks.
2626
run: |
2727
test_names=(
28-
va/tests/behat
2928
va/tests/cypress
3029
va/tests/phpunit
3130
va/tests/content-build-gql

.tugboat/.env.j2

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ CMS_VAGOV_API_URL="{{ CMS_VAGOV_API_URL }}"
1616
CMS_GOVDELIVERY_ENDPOINT="{{ CMS_GOVDELIVERY_ENDPOINT }}"
1717
CMS_GOVDELIVERY_USERNAME="{{ CMS_GOVDELIVERY_USERNAME }}"
1818
CMS_GOVDELIVERY_PASSWORD="{{ CMS_GOVDELIVERY_PASSWORD }}"
19-
BEHAT_PARAMS='{"extensions":{"Behat\\MinkExtension":{"base_url":"{{ TUGBOAT_DEFAULT_SERVICE_URL_PROTOCOL }}://{{ TUGBOAT_DEFAULT_SERVICE_URL_HOST }}"},"Drupal\\DrupalExtension":{"drush":{"root":"{{ TUGBOAT_ROOT }}/docroot","alias":"@none"},"drupal":{"drupal_root":"{{ TUGBOAT_ROOT }}/docroot"}}}}'
2019

2120
# GitHub-Commenter and GitHub-Status-Updater environment variables.
2221
GITHUB_OWNER={{ TUGBOAT_GITHUB_OWNER }}

READMES/environment-variables.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Any existing environment variables will be overwritten if the same variable exis
1313
Using a `.env` file instead on relying on the server environment has many benefits:
1414

1515
- When the Composer autoloader is forced to use the `.env`, all of tools that use it will have the exact
16-
same environment. This includes Drupal itself, and everything in the [.bin folder](../bin): `drush`, `phpunit`, `behat`, `task`, `etc`.
16+
same environment. This includes Drupal itself, and everything in the [.bin folder](../bin): `drush`, `phpunit`, `task`, `etc`.
1717
- No need to write variables to server configuration.
1818
- No need to pass variables through docker, docker-compose, Dockerfiles, etc.
1919
- No need to worry about the execution environment:
@@ -56,7 +56,7 @@ See the files:
5656

5757
Environment variables like API tokens should be treated as secrets.
5858

59-
For secrets, the BRD system uses [AWS Systems Manager (SSM) Parameter Store](https://vfs.atlassian.net/wiki/spaces/OT/pages/1601503564/Credstash+Parameter+Store+Procedures). Please contact a member of the [@cms-devops-engineers](https://app.slack.com/client/T03FECE8V/CT4GZBM8F/user_groups/S01JXBLLMJL) group in the DSVA Slack to add, modify, or to get information about a Parameter Store secret.
59+
For secrets, the BRD system uses [AWS Systems Manager (SSM) Parameter Store](https://vfs.atlassian.net/wiki/spaces/OT/pages/1601503564/Credstash+Parameter+Store+Procedures). Please contact a member of the [@cms-devops-engineers](https://app.slack.com/client/T03FECE8V/CT4GZBM8F/user_groups/S01JXBLLMJL) group in the DSVA Slack to add, modify, or to get information about a Parameter Store secret.
6060

6161
----
6262

READMES/environments.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ SOCKS proxy or PIV+GFE hardware is required for accessing VA internal network.
182182
- Notifies GitHub of deployment success or failure, with lnks to the environments.
183183
- Includes the FE/WEB Build process in the Drupal CI pipeline.
184184
- Front-end WEB project can be built inside PR environments by using the "Release Content" page.
185-
- End-to-end testing of CMS+WEB with Behat and Cypress:
185+
- End-to-end testing of CMS+WEB with Cypress:
186186
1. Make CMS updates: Change content, publish state, etc.
187187
1. Run WEB build command to rebuild static assets.
188188
1. Confirm CMS change is visible in WEB static assets.

READMES/testing.md

-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ forth.
5959

6060
At present, these include:
6161

62-
- **Behat**, a PHP behavior-driven test framework. Behat performs some tests
63-
of user roles and permissions.
6462
- **Content-Build: GraphQL** or `content-build-gql`, a script that performs the
6563
initial retrieval of content-build data from Drupal via GraphQL, in order to
6664
verify compatibility.

READMES/unity.md

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ the **CMS** build process:
1818
This tool automatically installs executable versions of Node and NPM at the specific version we set in `composer.json`.
1919
- Add to `composer.json`'s "scripts" section (post-install-cmd), to kick off "yarn build" and "npm build" commands after `composer install`.
2020
- Add Composer commands (See `composer.json`'s "scripts" section) to faciitate building and rebuilding the **WEB** project.
21-
- To confirm this entire stack is working, the Behat test suite includes editing a CMS node, running the web rebuild,
22-
then confirms edited content is visible.
2321

2422
### Developing WEB and CMS Together
2523

READMES/workflow.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ We are currently working off a single `main` branch. `main` is protected and req
2929
1. `ddev composer install`
3030
1. `ddev start` or `ddev restart`
3131
1. `ddev pull va --skip-files` or `ddev pull va` idf you need managed files (images and pdfs)
32-
1. Running `ddev test` will build the frontend web and run all tests (PHPUnit, Behat, accessibility, FE web) See [testing](testing.md) for additional details.
32+
1. Running `ddev test` will build the frontend web and run all tests (PHPUnit, accessibility, FE web) See [testing](testing.md) for additional details.
3333
1. If possible, write your test, before you write code. The test should fail initially and not pass until you succeed.
34-
1. Fix code formatting issues with CodeSniffer, Drupal standard. (linters should run automatically upon trying to commit.
34+
1. Fix code formatting issues with CodeSniffer, Drupal standard (linters should run automatically upon trying to commit).
3535
1. Commit your changes. Each commit should be logically atomic (e.g. module adds in one commit, config in another, custom code in additional logical commits), and your commit messages should follow the pattern: "VACMS-123: A grammatically correct sentence starting with an action verb and ending with punctuation."
3636
_Example: VACMS-1234 Add configuration for menu reduction._
3737
1. Push work to your fork of the repository so a Pull Request may be created

composer.json

+3-15
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66
"minimum-stability": "dev",
77
"prefer-stable": true,
88
"require-dev": {
9+
"behat/mink": "^1.10",
10+
"behat/mink-browserkit-driver": "^2.1",
911
"drupal/devel": "^5.0",
1012
"drupal/html_tag_usage": "^1.0@beta",
1113
"drupal/media_entity_generic": "^1.0"
1214
},
1315
"require": {
14-
"acquia/drupal-spec-tool": "^5.0.0",
1516
"alchemy/zippy": "^1.0.0",
1617
"bower-asset/blazy": "^1.8",
1718
"bower-asset/cropper": "^4.1",
@@ -178,7 +179,6 @@
178179
"drupal/views_local_tasks": "^1.0",
179180
"drupal/workbench_access": "^2.0",
180181
"drupal/workbench_menu_access": "^2.0",
181-
"drush-ops/behat-drush-endpoint": "^9.4.0",
182182
"drush/drush": "^11",
183183
"easyrdf/easyrdf": "1.1.1 as 0.9.1",
184184
"geocoder-php/mapbox-provider": "^1.3",
@@ -200,11 +200,11 @@
200200
"querypath/querypath": "^3.0",
201201
"simplesamlphp/simplesamlphp": "^1.18",
202202
"squizlabs/php_codesniffer": "^3.5",
203+
"symfony/browser-kit": "^6.3",
203204
"symfony/config": "^4.0",
204205
"symfony/phpunit-bridge": "^5.1",
205206
"symfony/process": "^4.0",
206207
"symfony/routing": "^4.0",
207-
"traviscarden/behat-table-comparison": "~0.2",
208208
"va-gov/content-build": "^0.0.3296",
209209
"vlucas/phpdotenv": "^5.3",
210210
"webflo/drupal-finder": "^1.0.0",
@@ -214,7 +214,6 @@
214214
},
215215
"autoload": {
216216
"psr-4": {
217-
"CustomDrupal\\": "tests/behat/Drupal",
218217
"Drupal\\va_gov_backend\\": "docroot/modules/custom/va_gov_backend/src",
219218
"Drupal\\va_gov_flags\\": "docroot/modules/custom/va_gov_flags/src",
220219
"Tests\\Support\\": "tests/phpunit/Support",
@@ -532,9 +531,6 @@
532531
"drupal/views_data_export": {
533532
"3189135 - Use relative URL for export button": "https://www.drupal.org/files/issues/2022-08-06/use-relative-url-for-export-3189135-10.patch"
534533
},
535-
"traviscarden/behat-table-comparison": {
536-
"Throw meaningful message for duplicate entry. See https://github.com/TravisCarden/behat-table-comparison/pull/7": "patches/duplicate-row-message.patch"
537-
},
538534
"drupal/sitewide_alert": {
539535
"3290964 - Add drush commands for sitewide alerts": "https://www.drupal.org/files/issues/2023-06-22/3290964-add-drush-commands-2.patch"
540536
}
@@ -558,7 +554,6 @@
558554
"va:test": "Run all of the tests sequentially, stopping on the first failure.",
559555
"va:test:no-fail": "Run all of the tests sequentially, even if some fail.",
560556
"va:test:fast": "Runs the \"fast\" static analysis, linting, and unit tests.",
561-
"va:test:behat": "Run Behat tests.",
562557
"va:test:check-cer": "Check the Corresponding Entity References fields.",
563558
"va:test:check-node-revision-logs": "Check the node revision log fields.",
564559
"va:test:check-taxonomy-revision-logs": "Check the taxonomy revision log fields.",
@@ -655,7 +650,6 @@
655650
"va:test": [
656651
"# Run all of the tests sequentially, stopping on the first failure.",
657652
"@composer validate",
658-
"@va:test:behat",
659653
"@va:test:check-cer",
660654
"@va:test:check-node-revision-logs",
661655
"@va:test:check-taxonomy-revision-logs",
@@ -688,7 +682,6 @@
688682
"va:test:no-fail": [
689683
"# Run all of the tests sequentially, even if some fail.",
690684
"@composer validate || true",
691-
"@va:test:behat || true",
692685
"@va:test:check-cer || true",
693686
"@va:test:check-node-revision-logs || true",
694687
"@va:test:check-taxonomy-revision-logs || true",
@@ -704,11 +697,6 @@
704697
"@va:test:stylelint-modules || true",
705698
"@va:test:stylelint-themes || true"
706699
],
707-
"va:test:behat": [
708-
"# Run Behat tests.",
709-
"! ./scripts/should-run-directly.sh || ./tests/scripts/behat-tests.sh",
710-
"./scripts/should-run-directly.sh || ddev composer va:test:behat --"
711-
],
712700
"va:test:check-cer": [
713701
"# Check the Corresponding Entity References fields.",
714702
"! ./scripts/should-run-directly.sh || ./tests/scripts/check-cer.sh",

0 commit comments

Comments
 (0)