{"id":13299261,"url":"https://github.com/tyler36/behat-d9-demo","last_synced_at":"2025-03-28T14:29:09.898Z","repository":{"id":94819321,"uuid":"480630320","full_name":"tyler36/behat-d9-demo","owner":"tyler36","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-09T01:44:22.000Z","size":200,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"ddev-chrome","last_synced_at":"2024-10-19T04:31:17.999Z","etag":null,"topics":["behat","cypress","drupal","drupal-9","testing"],"latest_commit_sha":null,"homepage":"","language":"Gherkin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tyler36.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-12T02:49:50.000Z","updated_at":"2023-05-16T08:35:17.000Z","dependencies_parsed_at":"2023-04-30T12:16:22.056Z","dependency_job_id":null,"html_url":"https://github.com/tyler36/behat-d9-demo","commit_stats":null,"previous_names":["tyler36/behat-d9-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler36%2Fbehat-d9-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler36%2Fbehat-d9-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler36%2Fbehat-d9-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tyler36%2Fbehat-d9-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tyler36","download_url":"https://codeload.github.com/tyler36/behat-d9-demo/tar.gz/refs/heads/ddev-chrome","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246045435,"owners_count":20714775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["behat","cypress","drupal","drupal-9","testing"],"created_at":"2024-07-29T17:37:19.906Z","updated_at":"2025-03-28T14:29:09.879Z","avatar_url":"https://github.com/tyler36.png","language":"Gherkin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Behat with drupal demo \u003c!-- omit in toc --\u003e\n\n- [Requirements](#requirements)\n- [Installation](#installation)\n- [Drivers](#drivers)\n  - [Goutte](#goutte)\n- [Errors](#errors)\n  - [cURL error 60: SSL certificate problem](#curl-error-60-ssl-certificate-problem)\n\n## Requirements\n\nBased on `Drupal 9.3`, it has the following requirements:\n\n- PHP 8.0\n- Mysql database\n\n## Installation\n\nBased on [How to use behavior-driven development in Drupal with Behat](https://opensource.com/article/19/3/how-drupal-behat)\n\n- Install Behat with Drupal extensions.\n\n```shell\ncomposer require drupal/drupal-extension --dev -W\n```\n\n- Add `behat.yml` config\n\n```yml\n# behat.yml\ndefault:\n  suites:\n    default:\n      contexts:\n        - Drupal\\DrupalExtension\\Context\\DrupalContext\n        - Drupal\\DrupalExtension\\Context\\MinkContext\n        - Drupal\\DrupalExtension\\Context\\MessageContext\n        - Drupal\\DrupalExtension\\Context\\DrushContext\n  extensions:\n    Behat\\MinkExtension:\n      goutte: ~\n      base_url: http://example.org/  # Replace with your site's URL\n    Drupal\\DrupalExtension:\n      blackbox: ~\n```\n\n- initialize behat project\n\n```shell\n./vendor/bin/behat -init\n\n## Behat\n\n- Show step definitions\n\n```shell\n$ ./vendor/bin/behat -dl\ndefault | Given I am an anonymous user\ndefault | Given I am not logged in\ndefault | Then I log out\ndefault | Given I am logged in as a user with the :role role(s)\ndefault | Given I am logged in as a/an :role\ndefault | Given I am logged in as a user with the :role role(s) and I have the following fields:\ndefault | Given I am logged in as :name\ndefault | Given I am logged in as a user with the :permissions permission(s)\ndefault | Then I should see (the text ):text in the :rowText row\ndefault | Then I should not see (the text ):text in the :rowText row\ndefault | Given I click :link in the :rowText row\ndefault | Then I (should )see the :link in the :rowText row\ndefault | Given the cache has been cleared\ndefault | Given I run cron\ndefault | Given I am viewing a/an :type (content )with the title :title\ndefault | Given a/an :type (content )with the title :title\ndefault | Given I am viewing my :type (content )with the title :title\ndefault | Given :type content:\ndefault | Given I am viewing a/an :type( content):\ndefault | Then I should be able to edit a/an :type( content)\ndefault | Given I am viewing a/an :vocabulary term with the name :name\ndefault | Given a/an :vocabulary term with the name :name\ndefault | Given users:\ndefault | Given :vocabulary terms:\ndefault | Given the/these (following )languages are available:\ndefault | Then (I )break\n\n# Show step definitions in different language, eg. JA\n$ ./vendor/bin/behat -dl --lang=ja\n```\n\n- Show story-syntax in different language\n\n```shell\nbehat --story-syntax --lang=ja\n```\n\n## Drivers\n\n- [list of supported drivers](https://mink.behat.org/en/latest/guides/drivers.html)\n\n### Goutte\n\n- command-line browser\n- does **NOT** support javascript\n\n## Errors\n\n### cURL error 60: SSL certificate problem\n\n- Issue: Trying to access a DDEV-hosted website\n\n```shell\n$ behat\n\n  Scenario: A visitor can use the site-wide contact form     # features/contact-form.feature:6\n    Given I am at \"contact/feedback\"                         # \\DrupalExtension\\Context\\MinkContext::assertAtPath()\n      cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) (GuzzleHttp\\Exception\\RequestException)\n```\n\n- Occurs when trying to access a HTTPS site with a self-signed certificate\n- Solution:  Update `behat.yml`\n\n```yml\n  extensions:\n    Behat\\MinkExtension:\n      goutte:\n        guzzle_parameters:\n          verify: false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyler36%2Fbehat-d9-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftyler36%2Fbehat-d9-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftyler36%2Fbehat-d9-demo/lists"}