Code Monkey home page Code Monkey logo

behat's Introduction

Docksal Latest Release Build Status

Documentation Blog GitHub Discussions

Docker powered web development environments for macOS, Windows, and Linux. Unified environment for your team regardless of the OS.

Why Docksal

  • Full power of Docker Compose to suit any project without artificial syntax limitations

  • Unprecedented ability to automate routine tasks, slashing the time to on-board new team members.

    Create your custom automation in Bash, PHP, or Node to spin up your project anywhere where Docksal is with a single command, or automate routine tasks.

  • Best in class filesystem performance

  • Running Drupal, Wordpress, Magento, Laravel, Symfony, Backdrop, Grav, Hugo, Gatsby, and others is one step away with ready-to-use boilerplates.

Welcome onboard

Install Docksal, cd to the desired directory, and run:

fin project create

The wizard will guide you throughout the creation of a new project using any of the Instant Boilerplate Projects listed below. The wizard will create the proper Docker containers stack, depending on the project choice, and install a working empty project preconfigured for running in Docksal that you can build upon.

Instant Boilerplate Projects

In case you want to be in full control, you can clone one the boilerplate projects below and run fin init.

More advanced use cases and tutorials are available in the Documentation and Blog.

Contributing to Docksal

Ready to give back? Check the Contributing docs on how to get involved.

We have GitHub Discussions and chat rooms on Slack where questions can be asked and answered:

If you have experience with Docksal and Docker, please stick around in the rooms to help others.

Roadmap

For the list of current and past releases check the Projects section.
Change records are published there and in the Changelog docs.

behat's People

Contributors

ambachtelijk avatar clemens-tolboom avatar lmakarov avatar sergey-zabolotny avatar stevenlafl avatar toni-kolev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

behat's Issues

Element not found with xpath, //html

I'm not certain what is the problem here, considering this is inside a container. Just using it as-is I can't run the example that comes with it.

    Given I am on "http://getbootstrap.com/"                                                                                                                                                                                       # Drupal\DrupalExtension\Context\MinkContext::visit()
    Then I should see text matching "Bootstrap is an open source toolkit for developing with HTML, CSS, and JS. Quickly prototype your ideas or build your entire app with our Sass variables and mixins, responsive grid system." # Drupal\DrupalExtension\Context\MinkContext::assertPageMatchesText()
      Element not found with xpath, //html
       (WebDriver\Exception\NoSuchElement)

ln: /usr/bin/php: File exists

While doing a make for Dockerfile I get error:

$ docker build -t docksal/behat .
Sending build context to Docker daemon   22.7MB
Step 1/11 : FROM alpine:edge
 ---> 529f4bac5cdf
Step 2/11 : MAINTAINER Leonid Makarov <[email protected]>
 ---> Using cache
 ---> cd7a16d840f6
Step 3/11 : RUN apk --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/community  add     bash     curl     git     unzip     php7     php7-xml     php7-zip     php7-xmlreader     php7-zlib     php7-opcache     php7-mcrypt     php7-openssl     php7-curl     php7-json     php7-dom     php7-phar     php7-mbstring     php7-ctype     && rm -rf /var/cache/apk/*
 ---> Using cache
 ---> db6f445d772d
Step 4/11 : RUN         ln -s /usr/bin/php7 /usr/bin/php
 ---> Running in 115d66ae42da
ln: /usr/bin/php: File exists
The command '/bin/sh -c ln -s /usr/bin/php7 /usr/bin/php' returned a non-zero code: 1

running Chrome in headless mode, disable-gpu, ...

working well and fine, thank you!

But I was wondering what is the best option to use this setup and run Chrome in headless mode and even add some more switches of my own?

There are different images on docker hub for Chrome headless, but at the first look none seems to allow adding own flags.

Thanks!

Element not found with xpath, //html. Error present even when adding Behat configs suggested online.

I have a D9 install with Docksal that will run behat, but I get this error:

    Element not found with xpath, //html
           (WebDriver\Exception\NoSuchElement)

I suspect it has to do with my behat configs.

I have done some research online with the error message and there were suggestions to do things like add this to my tests/behat/behat.yml file

        capabilities:
          browser: "chrome"
          version: "*"
          extra_capabilities:
            chromeOptions:
              w3c: false

But this didn't seem to work. I also added this to my docksal.yml file

      browser:
        hostname: browser
        # Pin selenium image to an older version
        # See https://github.com/docksal/docksal/issues/1096#issuecomment-543316840
        image: selenium/standalone-chrome-debug:3.141.59-oxygen
        dns:
          - ${DOCKSAL_DNS1}
          - ${DOCKSAL_DNS2}

I can see online that I should look at the D7 advanced boilerplate code for examples, but I am not sure which part of it is outdated.

What parts of D7 advanced boilerplate behat configs do I need to change if I am running Drupal 9?

Here is my behat.yml file: ( I am assuming that the base_url is the url I use in my browser when I look at the page )

    default:
      autoload:
        '': '%paths.base%/tests/behat/features/bootstrap'
      suites:
        default:
          contexts:
            - Drupal\FeatureContext
            - Drupal\DrupalExtension\Context\DrupalContext
            - Drupal\DrupalExtension\Context\MinkContext
            - Drupal\DrupalExtension\Context\MessageContext
            - Drupal\DrupalExtension\Context\DrushContext
          paths:
            features: '%paths.base%/tests/behat/features'
      extensions:
        Behat\MinkExtension:
          default_session: 'selenium2'
          goutte: ~
          selenium2: ~
          base_url: 'http://myprojectname.docksal'
        Drupal\DrupalExtension:
          blackbox: ~
          api_driver: 'drupal'
          drush:
            alias: 'local'
          drupal:
            drupal_root: '%paths.base%/docroot'

Here is my tests/behat/behat.yml file:

# Docker profile.
# For use inside the CLI container in Docksal.
docker:
  extensions:
    Behat\MinkExtension:
      # URL of the site when accessed inside Docksal.
      base_url: http://myprojectname.docksal
      # Configure browser to be used. Browser must be available on wd_host.
      # Stick with chrome by default. It's 2x faster than firefox or phantomjs (your results may vary).
      browser_name: chrome
      selenium2:
        wd_host: http://browser:4444/wd/hub
        capabilities:
          browser: "chrome"
          version: "*"
          extra_capabilities:
            chromeOptions:
              w3c: false
    Drupal\DrupalExtension:
      drupal:
        # Site docroot inside Docksal.
        drupal_root: /var/www/docroot
      drush:
        # Site docroot inside Docksal.
        root: /var/www/docroot

This is my docksal.yml file:

    version: "2.1"
    services:
      # Web
      web:
        extends:
          file: ${HOME}/.docksal/stacks/services.yml
          service: apache
        depends_on:
          - cli
    
      # DB
      db:
        extends:
          file: ${HOME}/.docksal/stacks/services.yml
          service: mysql
    
      # CLI
      cli:
        extends:
          file: ${HOME}/.docksal/stacks/services.yml
          service: cli
    
      # Browser
      browser:
        hostname: browser
        # Pin selenium image to an older version
        # See https://github.com/docksal/docksal/issues/1096#issuecomment-543316840
        image: selenium/standalone-chrome-debug:3.141.59-oxygen
        dns:
          - ${DOCKSAL_DNS1}
          - ${DOCKSAL_DNS2}

This is my docksal.env file:

    # This is a shared configuration file that is intended to be stored in the project repo.
    # To override a variable locally:
    # - create .docksal/docksal-local.env file and local variable overrides there
    # - add .docksal/docksal-local.env to .gitignore
    #
    # After editing, apply changes with 'fin up'
    
    # Use the default Docksal LAMP stack
    DOCKSAL_STACK=acquia
    
    DOCKSAL_DNS1=http://myproject.docksal
    # Lock images versions for LAMP services
    # This will prevent images from being updated when Docksal is updated
    #WEB_IMAGE='docksal/web:x.x-apache2.4'
    DB_IMAGE='docksal/mysql:5.7-1.4'
    #CLI_IMAGE='docksal/cli:x.x-php7.1'
    
    # Override virtual host (matches project folder name by default)
    #VIRTUAL_HOST=drupal8.docksal
    # Override document root ('docroot' by default)
    DOCROOT="docroot"
    
    # MySQL settings.
    # MySQL will be exposed on a random port. Use "fin ps" to check the port.
    # To have a static MySQL port assigned, copy the line below into the .docksal/docksal-local.env file
    # and replace the host port "0" with a unique host port number (e.g. MYSQL_PORT_MAPPING='33061:3306')
    MYSQL_PORT_MAPPING='0:3306'
    
    # Enable/disable xdebug
    # To override locally, copy the two lines below into .docksal/docksal-local.env and adjust as necessary
    XDEBUG_ENABLED=0


No AJAX timeout has been defined error when press or click the button.

When I use in the test either I press "Submit" or I click the element with selector "form > button" I am getting the same error:
No AJAX timeout has been defined. Please verify that "Drupal\MinkExtension" is configured in behat.yml (and not "Behat\MinkExtension"). (Exception)

This is not defined extension and I guess not used at all so not sure what can be done about that?

Cannot run example 'No such container: behat'

I have available

  • no fin installed (as this is a stand alone repo
  • docksal/behat
docker run --rm -v $(pwd):/src docksal/behat --version

behat version 3.1.0

next trying the example

git clone https://github.com/docksal/behat.git docksal-behat
cd docksal-behat/example
./run-behat features/blackbox.feature

Error: No such container: behat
To view HTML report visit: http://<your-docker-host-ip>:8000/html_report

Running the script with set -x gives

./run-behat
++ docker-compose ps -q behat

  • docker exec behat --colors --format=pretty --out=std --format=html --out=html_report
    Error: No such container: behat
  • echo 'To view HTML report visit: http://<your-docker-host-ip>:8000/html_report'
    To view HTML report visit: http://<your-docker-host-ip>:8000/html_report

Spinning up the containers then run the example gives some results

docksal-behat/example % docker-compose up

then in a different terminal

docksal-behat/example % ./run-behat

docksal-behat/example % ./run-behat
++ docker-compose ps -q behat

  • docker exec 89d6d28bd51cc74eb3c1b65b0a81ca0f5b15feaa6edf4f028a677e5254993f94 behat --colors --format=pretty --out=std --format=html --out=html_report
@javascript
Feature: Getbootstrap smoke testing
  As an anonymous user
  I should be able to navigate through website pages using Nav buttons

  Scenario: Open home page and find text                                                                                                                       # features/blackbox-javascript.feature:7
    Given I am on "http://getbootstrap.com/"

Not sure what is wrong. I know how to fix the tests (PR #1) but not this ./run-behat script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.