{"id":16355484,"url":"https://github.com/normanlolx/drupal-circleci-behat","last_synced_at":"2025-03-23T01:31:16.709Z","repository":{"id":30031553,"uuid":"88962352","full_name":"normanlolx/drupal-circleci-behat","owner":"normanlolx","description":"Test and deploy Drupal 9 with CircleCI 2.0 and Behat 3","archived":false,"fork":false,"pushed_at":"2023-09-29T21:03:24.000Z","size":670,"stargazers_count":17,"open_issues_count":7,"forks_count":4,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-03-15T02:38:18.832Z","etag":null,"topics":["behat","circleci","drupal","drupal-8"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/normanlolx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2017-04-21T08:42:31.000Z","updated_at":"2022-03-01T23:12:13.000Z","dependencies_parsed_at":"2024-10-28T15:21:03.911Z","dependency_job_id":"2bac472c-539f-47f5-bc00-2ca9b7128335","html_url":"https://github.com/normanlolx/drupal-circleci-behat","commit_stats":null,"previous_names":["normanlolx/drupal-circleci-behat"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normanlolx%2Fdrupal-circleci-behat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normanlolx%2Fdrupal-circleci-behat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normanlolx%2Fdrupal-circleci-behat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/normanlolx%2Fdrupal-circleci-behat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/normanlolx","download_url":"https://codeload.github.com/normanlolx/drupal-circleci-behat/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245043919,"owners_count":20551850,"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","circleci","drupal","drupal-8"],"created_at":"2024-10-11T01:40:57.246Z","updated_at":"2025-03-23T01:31:16.407Z","avatar_url":"https://github.com/normanlolx.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Drupal CirceCI Behat Selenium\n\nkick-start example\n\n[![CircleCI](https://circleci.com/gh/leymannx/drupal-circleci-behat.svg?style=svg)](https://circleci.com/gh/leymannx/drupal-circleci-behat)\n\n## [`tests/behat/behat.yml`](https://github.com/leymannx/drupal-circleci-behat/blob/develop/tests/behat/behat.yml):\n\n```yaml\ndefault:\n  suites:\n    default:\n      contexts:\n        - FeatureContext\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      base_url: http://drupal-circleci-behat.localhost\n      goutte: ~\n      selenium2:\n        wd_host: http://drupal-circleci-behat.localhost:4444/wd/hub\n        capabilities:\n          marionette: true\n          browser: chrome\n      browser_name: chrome\n    Drupal\\DrupalExtension:\n      blackbox: ~\n      api_driver: drupal\n      drupal:\n        drupal_root: '%paths.base%/../../web'\n```\n\n## [`.circleci/config.yml`](https://github.com/leymannx/drupal-circleci-behat/blob/develop/.circleci/config.yml):\n\n```yaml\nversion: 2\njobs:\n  build:\n    docker:\n      - image: circleci/php:7.4-apache-node-browsers\n      - image: circleci/mariadb:latest\n        environment:\n          - MYSQL_ROOT_HOST=%\n    working_directory: ~/drupal-circleci-behat\n    steps:\n      - checkout\n      - run:\n          name: Setup Apache\n          command: |\n            sudo cp .circleci/env/drupal-circleci-behat.conf /etc/apache2/sites-available/drupal-circleci-behat.conf\n            sudo a2ensite drupal-circleci-behat\n            sudo service apache2 start\n            echo 127.0.0.1 drupal-circleci-behat.localhost | sudo tee -a /etc/hosts\n      - run:\n          name: Setup tools\n          command: |\n            sudo apt-get -qq update \u0026\u0026 sudo apt-get -qqy upgrade\n            sudo apt-get -yqq install libpng-dev libonig-dev mariadb-client nano xvfb\n            sudo docker-php-ext-install gd mbstring mysqli pdo pdo_mysql\n            sudo service apache2 restart\n      - run:\n          name: Start Xvfb\n          command: |\n            sudo Xvfb :7055\n            export DISPLAY=:7055\n          background: true\n      - run:\n          name: Download Selenium\n          command: |\n            curl -O http://selenium-release.storage.googleapis.com/3.141/selenium-server-standalone-3.141.5.jar\n      - run:\n          name: Start Selenium\n          command: |\n            mkdir -p /tmp/selenium\n            java -jar selenium-server-standalone-3.141.5.jar -log /tmp/selenium/selenium.log\n          background: true\n      - restore_cache:\n          keys:\n            - v1-dependencies-{{ checksum \"composer.lock\" }}\n      - run:\n          name: Composer Install\n          command: |\n            composer install -n --prefer-dist\n            echo 'export PATH=$HOME/drupal-circleci-behat/vendor/bin:$PATH' \u003e\u003e $BASH_ENV\n            source /home/circleci/.bashrc\n      - save_cache:\n          paths:\n            - ./vendor\n          key: v1-dependencies-{{ checksum \"composer.lock\" }}\n      - run:\n          name: Setup Drupal\n          command: |\n            cp .circleci/env/.htaccess web/.htaccess\n            cp .circleci/env/settings.local.php web/sites/default/settings.local.php\n            cd web\n            drush -y site:install --existing-config\n      - run:\n          name: Tests\n          command: |\n            mkdir -p tests/behat/test-results/junit\n            cd tests/behat\n            behat --no-snippets -f pretty -o std -f junit -o test-results/junit/junit.xml\n      - store_test_results:\n          path: tests/behat/test-results\n      - store_artifacts:\n          path: /tmp/selenium\n  deploy:\n    machine:\n      enabled: true\n    working_directory: ~/drupal-circleci-behat\n    steps:\n      - checkout\n      - run:\n          name: Fix ssh Could not resolve hostname\n          command: |\n            ssh-keyscan \"${LIVE_IP}\" \u003e\u003e ~/.ssh/known_hosts\n            ssh-keyscan \"${DEV_IP}\" \u003e\u003e ~/.ssh/known_hosts\n      - add_ssh_keys:\n          fingerprints:\n            - \"14:09:a1:b2:b3:c4:d5:e6:f7:g8:h9:81:\"\n      - run:\n          name: Deploy main\n          command: if [ \"${CIRCLE_BRANCH}\" == \"main\" ]; then ssh -p \"${LIVE_PORT}\" \"${LIVE_USER}\"@\"${LIVE_IP}\" \"cd /var/www/wordpress-circleci-behat/scripts/deployment \u0026\u0026 . deploy.sh ${CIRCLE_SHA1}\"; else echo \"Skipped\"; fi\n      - run:\n          name: Deploy dev\n          command: if [ \"${CIRCLE_BRANCH}\" == \"develop\" ]; then ssh -p \"${DEV_PORT}\" \"${DEV_USER}\"@\"${DEV_IP}\" \"cd /var/www/wordpress-circleci-behat/scripts/deployment \u0026\u0026 . deploy.sh ${CIRCLE_SHA1}\"; else echo \"Skipped\"; fi\n      - run: echo \"${CIRCLE_BRANCH}\"; echo \"${CIRCLE_SHA1}\";\nworkflows:\n  version: 2\n  build-and-deploy:\n    jobs:\n      - build\n      - deploy:\n          requires:\n            - build\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormanlolx%2Fdrupal-circleci-behat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnormanlolx%2Fdrupal-circleci-behat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnormanlolx%2Fdrupal-circleci-behat/lists"}