8000 Releases · drevops/behat-steps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Releases: drevops/behat-steps

3.1.0

02 Jun 12:26
6eb3123
Compare
Choose a tag to compare

What's new since 3.0.0

New steps

  • @Then the element :selector1 should appear after the element :selector2
  • @Then the text :text1 should appear after the text :text2
  • @Then current url should have the :param parameter
  • @Then current url should have the :param parameter with the :value value
  • @Then current url should not have the :param parameter
  • @Then current url should not have the :param parameter with the :value value
  • @When I check the checkbox :selector
  • @When I uncheck the checkbox :selector
  • @Given browser validation for the form :selector is disabled
  • @When I visit the :content_type content revisions page with the title :title
  • @When I visit the :vocabulary_machine_name term page with the name :term_name
  • @When I visit the :vocabulary_machine_name term edit page with the name :term_name
  • @When I visit the :vocabulary_machine_name term delete page with the name :term_name

Updated steps

  • @Then the path should be :path
  • @Then the path should not be :path
  • @When I edit the :vocabulary_machine_name vocabulary :term_name term page

Changelog:

Full Changelog: 3.0.0...3.1.0

@AlexSkrypnyk, @df-nikita, @nsineok, @renovate[bot], @skipper-vp and renovate[bot]

3.0.0 - Consistent language and new namespaces

06 May 09:32
d1cb522
Compare
Choose a tag to compare

Consistent language for step definition is here! 🎉

A list of new steps are available in the STEPS.md

We’ve reviewed and updated every step to align with our strict language guidelines. We've also added automated checks to make sure that the step definition are written in a consistent way in the future.

Drupal-specific traits are now namespaced under Drupal/, making it clear that this library is framework-agnostic and suitable for non-Drupal projects as well. More integrations with PHP applications are on the way.

We’ve also added support for Drupal 11, ensuring compatibility with all actively maintained versions.

The testing coverage was increased: we've added positive and negative tests for every trait to guarantee that the tests pass and fail when they expected to do so; we've also added unit tests for some of the traits to check for the most error-prone code.

For migrating from 2.x, please refer to the migration map.

🤖 Expand to get an AI prompt for features migration

Copy and paste below into your agentic AI client chat.

# Guide to Updating Behat Steps Package in Drupal Projects

This guide explains how to update the drevops/behat-steps package to the latest version and update your Behat tests to work with the new step definitions.

## Overview of the Update Process

1. Update the package version in composer.json
2. Update namespace imports in FeatureContext.php
3. Update step definitions in feature files
4. Test and fix each feature file

## Step-by-Step Instructions

### 1. Update the Package

First, check your current version of drevops/behat-steps in composer.json. Then update to the latest version (3.0.1 or newer) using your project's package management tool.

### 2. Fix FeatureContext.php

The namespace structure has changed in version 3.0.1. You'll need to update your FeatureContext.php file:

1. Locate your FeatureContext.php file (typically in tests/behat/bootstrap/)
2. Update the namespace imports at the top of the file
   - Generic traits are now in the root namespace: `DrevOps\BehatSteps\`
   - Drupal-specific traits are now in a subdirectory: `DrevOps\BehatSteps\Drupal\`

For example, change:

    use DrevOps\BehatSteps\ContentTrait;
    use DrevOps\BehatSteps\FieldTrait;
    use DrevOps\BehatSteps\FileTrait;

To:

    use DrevOps\BehatSteps\Drupal\ContentTrait;
    use DrevOps\BehatSteps\Drupal\FieldTrait;
    use DrevOps\BehatSteps\Drupal\FileTrait;

Non-Drupal traits remain in the root namespace:

    use DrevOps\BehatSteps\LinkTrait;
    use DrevOps\BehatSteps\PathTrait;
    use DrevOps\BehatSteps\ResponseTrait;
    use DrevOps\BehatSteps\WaitTrait;

### 3. Consult the STEPS.md File

**This is the most important reference for the update process!**

The drevops/behat-steps package includes a comprehensive STEPS.md file that documents all available steps. After updating the package:

1. Locate this file at `vendor/drevops/behat-steps/STEPS.md`
2. Review this file thoroughly - it contains all available steps with examples
3. Use this as your primary reference when updating feature files

The STEPS.md file is organized into sections:
- Generic steps (Cookie, Date, Element, Path, etc.)
- Drupal-specific steps (Content, Field, File, Media, etc.)

Each section includes detailed examples of how to use the steps, which is invaluable for updating your tests correctly.

### 4. Find and Update Feature Files

Examine your feature files (typically in tests/behat/features/) and update step definitions to match the new format from STEPS.md:

#### Common Changes Needed:

1. **Path Assertions**:
   - Change: `I should be in the "path" path`
   - To: `the path should be "path"`

2. **HTTP Response Assertions**:
   - Change: `I should get a 200 HTTP response`
   - To: `the response status code should be 200`

3. **Response Header Assertions**:
   - Change: `response header "X-Header" contains "value"`
   - To: `the response header "X-Header" should contain the value "value"`

4. **Link Interaction**:
   - Change: `I click the link with title "Title"`
   - To: `I click on the link with the title "Title"` or simply `I click "Title"`

5. **Wait Steps**:
   - Change: `I wait 2 seconds`
   - To: `I wait for 2 seconds`

6. **File Creation**:
   - Change: `unmanaged file "public://file.txt" created with content "content"`
   - To: `the unmanaged file at the URI "public://file.txt" exists with "content"`

7. **Content Visiting**:
   - Change: `I visit content_type "Title"`
   - To: `I visit the "content_type" content page with the title "Title"`

### 5. Reference Available Steps

There are two ways to see all available steps in the new package:

1. **STEPS.md File (Recommended)**: 
   - This is the most comprehensive and user-friendly reference
   - Contains examples and descriptions for each step
   - Located at `vendor/drevops/behat-steps/STEPS.md`

2. **Behat Definitions Command**:
   - Use the Behat definitions command appropriate for your system:
   
       vendor/bin/behat --definitions=i
   
   - This will show all available step definitions but with less context than STEPS.md

Always refer to STEPS.md first, as it provides clearer examples and more detailed information about each step.

### 6. Test Each Feature File

After updating step definitions:

1. Run each feature file individually to identify any issues
2. For failing tests, check screenshots if available to help diagnose the problems
3. Add `@skipped` tag to features that aren't ready to run (you can fix these later)
4. Once individual files pass, run the entire test suite

### 7. Common Troubleshooting

- **Step Not Found**: Verify you're using the current step syntax by checking the step definitions
- **Element Not Found**: The site structure may have changed - update selectors or navigation paths
- **Form Submission Issues**: For form tests, consider checking for broader success indicators rather than specific messages

### Reference Information

The STEPS.md file is your most important reference during this process. It contains:

1. Complete documentation of all available steps
2. Clear examples showing the exact format for each step
3. Descriptions of what each step does
4. Organization by trait/functionality for easy browsing

After updating the package, you should immediately locate and bookmark this file:

    vendor/drevops/behat-steps/STEPS.md

If you need to understand specific Behat step behavior in detail, this file should be your first resource.

## Example: Updating a Contact Form Feature

Before:

    Scenario: User submits a form
      Given I am on the homepage
      And I click the link with title "Contact"
      When I fill in "Name" with "Test User"
      And I press "Send message"
      Then I should see the text "Your message has been sent."

After:

    Scenario: User submits a form
      Given I am on the homepage
      And I click "Contact" 
      When I fill in "Name" with "Test User"
      And I press "Send message"
      Then I should not see an "#edit-submit" element

What's new since 2.7.0

Full Changelog: 2.7.0...3.0.0

@AlexSkrypnyk, @renovate[bot], @skipper-vp, Andrey Simonov and renovate[bot]

2.7.0

24 Mar 10:41
5e3c9ad
Compare
Choose a tag to compare

What's new since 2.6.0

Full Changelog: 2.6.0...2.7.0

@AlexSkrypnyk, @renovate[bot], @richardgaunt and renovate[bot]

2.6.0

26 Oct 04:21
Compare
Choose a tag to compare

What's new since 2.5.0

Full Changelog: 2.5.0...2.6.0

@AlexSkrypnyk, @renovate and @renovate[bot]

2.5.0

18 Oct 01:57
Compare
Choose a tag to compare

BC 🚨

These 2 step definitions were removed as it is no longer possible to enable/disable the test system within a test; tag a test with @email instead:

  • Given I enable the test email system
  • Given I disable the test email system

What's new since 2.4.0

Full Changelog: 2.4.0...2.5.0

@AlexSkrypnyk, @NigelCunninghamRGA, @renovate, @renovate[bot] and @tannguyen04

2.4.0

04 Jul 09:45
Compare
Choose a tag to compare

What's new since 2.3.0

This is a tiny release, but addresses an important BC change for OverrideTrait. Also adds strict types.

Full Changelog: 2.3.0...2.4.0

@AlexSkrypnyk, @renovate and @renovate[bot]

2.3.0

26 Apr 08:02
Compare
Choose a tag to compare

What's new since 2.2.0

BC break 🚨
When I go to my edit profile page -> When I go to my profile edit page

  • [#212] Fixed When I go to my profile edit page. @AlexSkrypnyk (#219)
  • [#196] Added code coverage reporting. @AlexSkrypnyk (#213)
  • [#216] Decommissioned Drupal 9 test fixtures. @AlexSkrypnyk (#217)
  • Updated Drupal fixture to 10.2. @AlexSkrypnyk (#214)
  • [#209] Supported additional entity properties when creating files. @ericgsmith (#210)
  • chore(deps): update drevops/ci-runner docker tag to v24.4.0 @renovate (#211)
  • chore(deps): update seleniarm/standalone-chromium docker tag to v123 @renovate (#207)
  • chore(deps): update drevops/docker-wait-for-dependencies docker tag to v24.3.0 @renovate (#206)
  • chore(deps): update uselagoon/php-8.1-fpm docker tag to v24.3.1 @renovate (#204)
  • chore(deps): update uselagoon/php-8.1-cli-drupal docker tag to v24.3.1 @renovate (#203)
  • chore(deps): update uselagoon/nginx-drupal docker tag to v24.3.1 @renovate (#202)
  • chore(deps): update uselagoon/mariadb-drupal docker tag to v24.3.1 @renovate (#201)
  • chore(deps): update uselagoon/php-8.1-cli-drupal docker tag to v24.3.0 @renovate (#200)
  • chore(deps): update uselagoon/nginx-drupal docker tag to v24.3.0 @renovate (#199)
  • chore(deps): update uselagoon/mariadb-drupal docker tag to v24.3.0 @renovate (#197)
  • chore(deps): update uselagoon/php-8.1-fpm docker tag to v24.3.0 @renovate (#198)
  • chore(deps): update dependency palantirnet/drupal-rector to ^0.20 @renovate (#195)
  • chore(deps): update drevops/ci-runner docker tag to v24.3.0 @renovate (#194)
  • chore(deps): update uselagoon/php-8.1-fpm docker tag to v24.2.0 @renovate (#193)
  • chore(deps): update uselagoon/php-8.1-cli-drupal docker tag to v24.2.0 @renovate (#192)
  • chore(deps): update uselagoon/mariadb-drupal docker tag to v24.2.0 @renovate (#190)
  • chore(deps): update uselagoon/nginx-drupal docker tag to v24.2.0 @renovate (#191)

Full Changelog: 2.2.0...2.3.0

@AlexSkrypnyk, @ericgsmith, @renovate and @renovate[bot]

2.2.0

27 Feb 12:33
2bdb122
Compare
Choose a tag to compare

What's new since 2.1.0

IMPORTANT! Updates version constraints for Mink and MinkSelenium2Driver to use versions after the strict type updates.
If you used Syn library in your custom FeatureContext.php - update it accordingly based on changes in those packages. This package is fully compatible with the updated Syn library.

  • [#161] Updated behat/mink-selenium2-driver to 1.7 @tannguyen04 (#187)
  • chore(deps): update drevops/docker-wait-for-dependencies docker tag to v24 @renovate (#185)
  • [#127] Made dynamic condition for no managed files step. @tannguyen04 (#180)
  • chore(deps): update release-drafter/release-drafter action to v6 @renovate (#183)
  • [#174] Restructured code to follow scaffold 0.12.0 @tannguyen04 (#179)
  • chore(deps): update seleniarm/standalone-chromium docker tag to v121 @renovate (#182)
  • chore(deps): update drevops/ci-runner docker tag to v24 @renovate (#181)
  • chore(deps): update uselagoon/php-8.1-fpm docker tag to v24 @renovate (#178)
  • chore(deps): update uselagoon/php-8.1-cli-drupal docker tag to v24 @renovate (#177)
  • chore(deps): update uselagoon/nginx-drupal docker tag to v24 @renovate (#176)
  • chore(deps): update uselagoon/mariadb-drupal docker tag to v24 @renovate (#175)
  • Added negative assertions for the TaxonomyTrait steps. @tannguyen04 (#172)
  • chore(deps): update toshimaru/auto-author-assign action to v2.1.0 @renovate (#173)
  • chore(deps): update dependency palantirnet/drupal-rector to ^0.19 @renovate (#171)
  • chore(deps): update drevops/ci-runner docker tag to v23.12.0 @renovate (#170)
  • chore(deps): update seleniarm/standalone-chromium docker tag to v120 @renovate (#169)
  • [#124] Added support for CKEditor 5. @tannguyen04 (#168)
  • chore(deps): update seleniarm/standalone-chromium docker tag to v117 @renovate (#167)
  • Updated dependencies and added strict types. @AlexSkrypnyk (#162)

Full Changelog: 2.1.0...2.2.0

@AlexSkrypnyk, @renovate, @renovate[bot] and @tannguyen04

2.1.0

18 Dec 23:40
Compare
Choose a tag to compare

What's new since 2.0.1

IMPORTANT! Adds version constraints for Mink and MinkSelenium2Driver to use versions prior to strict type updates (which partially breaks some steps) and Syn library updates.
The next minor version of behat-steps will be compatible with newer versions of these packages and these constraints will be removed.

https://github.com/minkphp/Mink/releases/tag/v1.11.0
https://github.com/minkphp/MinkSelenium2Driver/releases/tag/v1.7.0

Features

Chores

  • chore(deps): update uselagoon/nginx-drupal docker tag to v23.12.0 @renovate (#158)
  • chore(deps): update uselagoon/php-8.1-cli-drupal docker tag to v23.12.0 @renovate (#159)
  • chore(deps): update uselagoon/php-8.1-fpm docker tag to v23.12.0 @renovate (#157)
  • chore(deps): update uselagoon/mariadb-drupal docker tag to v23.12.0 @renovate (#156)
  • chore(deps): update drevops/ci-runner docker tag to v23.11.0 @renovate (#160)
  • chore(deps): update uselagoon/php-8.1-cli-drupal docker tag to v23.11.0 @renovate (#153)
  • chore(deps): update uselagoon/php-8.1-fpm docker tag to v23.11.0 @renovate (#154)
  • chore(deps): update uselagoon/nginx-drupal docker tag to v23.11.0 @renovate (#152)
  • chore(deps): update uselagoon/mariadb-drupal docker tag to v23.11.0 @renovate (#151)

Full Changelog: 2.0.1...2.1.0

@AlexSkrypnyk, @renovate, @renovate[bot] and @richardgaunt

2.0.1

15 Oct 06:13
Compare
Choose a tag to compare

What's new since 2.0.0

  • Fixed several static errors. @AlexSkrypnyk (#146)
  • chore(deps): update uselagoon/php-8.1-cli-drupal docker tag to v23.10.0 @renovate (#141)
  • chore(deps): update uselagoon/php-8.1-fpm docker tag to v23.10.0 @renovate (#142)
  • chore(deps): update uselagoon/nginx-drupal docker tag to v23.10.0 @renovate (#140)
  • chore(deps): update uselagoon/mariadb-drupal docker tag to v23.10.0 @renovate (#138)
  • Updated scaffold files. @AlexSkrypnyk (#136)

Full Changelog: 2.0.0...2.0.1

@AlexSkrypnyk, @renovate and @renovate[bot]

0