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

Drop Goutte Driver. Support D10, Drush 11, Symfony 6 #620

Merged
merged 35 commits into from
Nov 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
fafbb1d
Fixes #614 to allow symfony 6.
mikemadison13 Aug 4, 2022
b221452
removing drupal 7 and php 7.3 builds.
mikemadison13 Sep 2, 2022
a386196
dropping symfony 3 support.
mikemadison13 Sep 6, 2022
4180a34
fix wrong conflict resolution
claudiu-cristea Oct 15, 2022
5979b4f
Config file and ID mismatch
claudiu-cristea Oct 15, 2022
5283a22
Don't test w/ D8
claudiu-cristea Oct 15, 2022
2ab66a7
Don't use Goutte
claudiu-cristea Oct 15, 2022
44d7e10
Remove D7 fixtures
claudiu-cristea Oct 15, 2022
3291508
Rename fixtures/drupal9 as fixtures/drupal
claudiu-cristea Oct 15, 2022
e0b478e
Cleanup dependencies
claudiu-cristea Oct 15, 2022
aee76a2
Missing new line
claudiu-cristea Oct 15, 2022
1200c13
Cleanup .travis.yml
claudiu-cristea Oct 15, 2022
0af583a
Run Drush from project root
claudiu-cristea Oct 15, 2022
0a285c6
Try Drupal 10
claudiu-cristea Oct 15, 2022
25e2757
Leftover
claudiu-cristea Oct 15, 2022
30c54cf
Behat profiles
claudiu-cristea Oct 15, 2022
76f4cf7
Fix the matrix
claudiu-cristea Oct 15, 2022
f3f9f53
Remove @d7 & @drushTest tests
claudiu-cristea Oct 15, 2022
b62563a
Try GitHub actions
claudiu-cristea Oct 17, 2022
383976b
PHP_XDEBUG_MODE should be string
claudiu-cristea Oct 17, 2022
45a812f
@wip is a legit tag
claudiu-cristea Oct 17, 2022
4ee02ba
Make sure composer.json is writable
claudiu-cristea Oct 17, 2022
93bf8cd
Typo
claudiu-cristea Oct 17, 2022
0f4e4d0
Don't run blackbox when running drupal profile
claudiu-cristea Oct 17, 2022
e9b8a8b
Are sub-contexts still needed? They never ran in pipeline
claudiu-cristea Oct 17, 2022
a534dfb
Don't fail fast
claudiu-cristea Oct 17, 2022
04514d3
Improve ci.yml
claudiu-cristea Oct 17, 2022
f96895f
drupal/drupal-driver to support D10
claudiu-cristea Oct 17, 2022
ee99500
Documentation
claudiu-cristea Oct 17, 2022
b9d7590
actions/checkout@v2 is deprecated
claudiu-cristea Oct 17, 2022
1c546dc
Drop .travis.yml
claudiu-cristea Oct 17, 2022
b3daad0
Rename the job
claudiu-cristea Oct 17, 2022
6b714cf
Don't hardcode the PHP version
claudiu-cristea Oct 26, 2022
aba1259
Fix badge link
claudiu-cristea Nov 3, 2022
b9bdd65
Drupal driver PR has been merged
claudiu-cristea Nov 7, 2022
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
2 changes: 1 addition & 1 deletion .gherkin-lintrc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"Step": "off"
}
],
"no-restricted-tags": ["on", {"tags": ["@watch", "@wip"]}],
"no-restricted-tags": ["on", {"tags": ["@watch"]}],
"use-and": "on",
"no-duplicate-tags": "on",
"no-superfluous-tags": "on",
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: ci
on: [push, pull_request_target]
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php_version: ["7.4", "8.0", "8.1"]
drupal_version: ["9", "10"]
exclude:
- php_version: "7.4"
drupal_version: "10"
- php_version: "8.0"
drupal_version: "10"
env:
PHP_VERSION: ${{ matrix.php_version }}
DRUPAL_VERSION: ${{ matrix.drupal_version }}
DOCKER_USER_ID: "1001"
steps:
- name: clone
uses: actions/checkout@v3
- name: docker-compose up -d
run: docker-compose up -d
- name: npm install
run: docker-compose exec -T -u node node npm install
- name: composer self-update
run: docker-compose exec -T php composer self-update
- name: composer require
run: docker-compose exec -u ${DOCKER_USER_ID} -T php composer require --no-interaction --dev --no-update drupal/core-recommended:^${DRUPAL_VERSION} drupal/core-composer-scaffold:^${DRUPAL_VERSION}
- name: composer install
run: docker-compose exec -T php composer install
- name: drush site-install
run: docker-compose exec -T php ./vendor/bin/drush --yes --root=drupal site-install --db-url=mysql://drupal:drupal@db/drupal --debug
- name: copy fixtures
run: docker-compose exec -T php cp -r fixtures/drupal/modules/behat_test drupal/modules
- name: drush pmu page_cache
run: docker-compose exec -T php ./vendor/bin/drush --yes --root=drupal pmu page_cache
- name: drush en behat_test
run: docker-compose exec -T php ./vendor/bin/drush --yes --root=drupal en behat_test
- name: npm test
run: docker-compose exec -T -u node node npm test
- name: composer test
run: docker-compose exec -T php composer test
- name: behat --profile=blackbox
run: docker-compose exec -T php vendor/bin/behat -fprogress --strict
- name: behat --profile=drupal
run: docker-compose exec -T php cat && docker-compose exec -T php vendor/bin/behat -fprogress --profile=drupal --strict
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ behat.yml
/package-lock.json
/node_modules
/.docksal
/.editorconfig
/.gitattributes
91 changes: 0 additions & 91 deletions .travis.yml

This file was deleted.

9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
* [#620](https://github.com/jhedstrom/drupalextension/pull/620) Drupal 10 compatibility.
### Changed
* [#620](https://github.com/jhedstrom/drupalextension/pull/620) Support for Drupal 7 and 8 is discontinued.
* [#620](https://github.com/jhedstrom/drupalextension/pull/620) Testing pipeline moved to GitHib actions.
## [4.2.0]
### Added
* [#606](https://github.com/jhedstrom/drupalextension/pull/606) Added PHP 8.1 support.
Expand Down Expand Up @@ -33,7 +38,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Changed
* [#528](https://github.com/jhedstrom/drupalextension/pull/528) Show a more helpful failure when running `@javascript`
scenarios with incorrect configuration.
* [#545](https://github.com/jhedstrom/drupalextension/issue/545) Remove Zombie JS testing on Travis.
* [#545](https://github.com/jhedstrom/drupalextension/issue/545) Remove Zombie JS testing on Travis.
* [#518](https://github.com/jhedstrom/drupalextension/issue/518) Subcontexts are deprecated and will be removed in v4.1.0.
### Added
* [#527](https://github.com/jhedstrom/drupalextension/pull/527) Provide a step to check that a button is not in a region.
Expand Down Expand Up @@ -86,7 +91,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
* [#449](https://github.com/jhedstrom/drupalextension/pull/449) Translate steps to Spanish.

### Fixed
* [#460](https://github.com/jhedstrom/drupalextension/pull/460): Fix links in documentation to `drush.org`.
* [#460](https://github.com/jhedstrom/drupalextension/pull/460): Fix links in documentation to `drush.org`.

### Changed
* [#457](https://github.com/jhedstrom/drupalextension/pull/457): Drupal 8 is now tested with Drush 9.
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@ The Drupal Extension is an integration layer between [Behat](http://behat.org),
provides step definitions for common testing scenarios specific to Drupal
sites.

[![Build Status](https://app.travis-ci.com/jhedstrom/drupalextension.svg?branch=master)](https://app.travis-ci.com/github/jhedstrom/drupalextension)
[![ci](https://github.com/jhedstrom/drupalextension/actions/workflows/ci.yml/badge.svg)](https://github.com/jhedstrom/drupalextension/actions/workflows/ci.yml)

The Drupal Extension 4.x supports Drupal 7, 8, and 9, utilizes Behat 3.2+ and
runs on PHP 7.3+. It is compatible with Symfony components 3.x as well as 4.x
so it can be used on Drupal 8 and 9.
The Drupal Extension 5.x supports Drupal 9 and 10, utilizes Behat 3.2+ and runs
on:

- PHP 7.4, 8.0, 8.1 with Drupal 9
- PHP 8.1 with Drupal 10.

[![Latest Stable Version](https://poser.pugx.org/drupal/drupal-extension/v/stable.svg)](https://packagist.org/packages/drupal/drupal-extension)
[![Total Downloads](https://poser.pugx.org/drupal/drupal-extension/downloads.svg)](https://packagist.org/packages/drupal/drupal-extension)
[![Latest Unstable Version](https://poser.pugx.org/drupal/drupal-extension/v/unstable.svg)](https://packagist.org/packages/drupal/drupal-extension)
[![License](https://poser.pugx.org/drupal/drupal-extension/license.svg)](https://packagist.org/packages/drupal/drupal-extension)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/jhedstrom/drupalextension/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/jhedstrom/drupalextension/?branch=master)



## Use it for testing your Drupal site.

If you're new to the Drupal Extension, we recommend starting with
If you're new to the Drupal Extension, we recommend starting with
the [Full documentation](https://behat-drupal-extension.readthedocs.org)

[![Documentation Status](https://readthedocs.org/projects/behat-drupal-extension/badge/?version=master)](https://behat-drupal-extension.readthedocs.org)
Expand All @@ -34,12 +34,12 @@ the [Full documentation](https://behat-drupal-extension.readthedocs.org)
mkdir projectdir
cd projectdir
curl -sS https://getcomposer.org/installer | php
COMPOSER_BIN_DIR=bin php composer.phar require drupal/drupal-extension='~4.0'
COMPOSER_BIN_DIR=bin php composer.phar require drupal/drupal-extension='~5.0'
```

1. In the projectdir, create a file called `behat.yml`. Below is the
minimal configuration. Many more options are covered in the
[Full documentation](https://behat-drupal-extension.readthedocs.org)
minimal configuration. Many more options are covered in the
[Full documentation](https://behat-drupal-extension.readthedocs.org)

``` yaml
default:
Expand All @@ -49,7 +49,7 @@ the [Full documentation](https://behat-drupal-extension.readthedocs.org)
- Drupal\DrupalExtension\Context\DrupalContext
extensions:
Drupal\MinkExtension:
goutte: ~
browserkit_http: ~
base_url: http://example.org/ # Replace with your site's URL
Drupal\DrupalExtension:
blackbox: ~
Expand All @@ -69,7 +69,7 @@ the [Full documentation](https://behat-drupal-extension.readthedocs.org)

1. Define your own steps in `projectdir\features\FeatureContext.php`

1. Start adding your [feature files](http://behat.org/en/latest/user_guide/gherkin.html)
1. Start adding your [feature files](http://behat.org/en/latest/user_guide/gherkin.html)
to the `features` directory of your repository.

## Credits
Expand Down
93 changes: 6 additions & 87 deletions behat.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ default:
tags: "@blackbox"
extensions:
Drupal\MinkExtension:
goutte: ~
base_url: http://127.0.0.1:8888/blackbox
browserkit_http: ~
base_url: http://blackbox
Drupal\DrupalExtension:
blackbox: ~
region_map:
Expand All @@ -29,87 +29,7 @@ default:
success_message_selector: '.messages.status'
warning_message_selector: '.messages.warning'

# Separate profile for testing using the api driver. This assumes a
# stock Drupal 7 install.
drupal7:
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MarkupContext
filters:
tags: "@d7"
extensions:
Drupal\MinkExtension:
base_url: http://127.0.0.1:8888
Drupal\DrupalExtension:
api_driver: "drupal"
drupal:
# Change this to the absolute path to Drupal install.
drupal_root: "drupal"
region_map:
left sidebar: "#sidebar-first"
content: "#content"

# Separate profile for testing using the Drush driver. Assumes a stock
# Drupal 7 install.
drush:
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\DrushContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MarkupContext
filters:
tags: "@drushTest"
extensions:
Drupal\MinkExtension:
base_url: http://127.0.0.1:8888
Drupal\DrupalExtension:
api_driver: "drush"
drush_driver: "drush"
drush:
root: "drupal"
region_map:
left sidebar: "#sidebar-first"
content: "#content"

# Separate profile for testing D8. Assumes a stock Drupal 8 install.
drupal8:
suites:
default:
contexts:
- FeatureContext
- Drupal\DrupalExtension\Context\ConfigContext
- Drupal\DrupalExtension\Context\DrupalContext
- Drupal\DrupalExtension\Context\MinkContext
- Drupal\DrupalExtension\Context\MarkupContext
- Drupal\DrupalExtension\Context\MessageContext
- Drupal\DrupalExtension\Context\MailContext
- Drupal\DrupalExtension\Context\RandomContext
filters:
tags: "@d8&&~@d8wip"
extensions:
Drupal\MinkExtension:
base_url: http://127.0.0.1:8888
Drupal\DrupalExtension:
api_driver: "drupal"
drupal:
# Change this to the absolute path to Drupal install.
drupal_root: "drupal"
region_map:
left sidebar: "#sidebar-first"
content: "#content"
selectors:
error_message_selector: '.messages--error'

# Separate profile for testing D9. Assumes a stock Drupal 9 install.
# This uses the same tags as Drupal 8.
drupal9:
drupal:
suites:
default:
contexts:
Expand All @@ -122,15 +42,14 @@ drupal9:
- Drupal\DrupalExtension\Context\MailContext
- Drupal\DrupalExtension\Context\RandomContext
filters:
tags: "@d8&&~@d8wip"
tags: "~@blackbox&&~@wip"
extensions:
Drupal\MinkExtension:
base_url: http://127.0.0.1:8888
base_url: http://drupal
Drupal\DrupalExtension:
api_driver: "drupal"
drupal:
# Change this to the absolute path to Drupal install.
drupal_root: "drupal"
drupal_root: "/var/www/html/drupal"
region_map:
main content: "#main"
selectors:
Expand Down
Loading