Giter VIP home page Giter VIP logo

behat-selenium-docker's Introduction

Testing with Behat on Selenium at Docker

1. Installation

  1. Install Docksal (required only once, but please update it sometimes).
  2. Run fin init command in project root directory (required only once, see note below) to initialize and start Docker stack (containers, volumes and network).

2. Usage

  • fin test - execute behat tests on Selenium from features/ directory
  • fin tt TAG_NAME - execute behat tests on Selenium by TAG_NAME (see below)
  • fin tl - execute behat tests on Selenium and save result in screenshots/$DATETIME/ directory
  • fin start - to start Docker stack (containers, volumes and network)
  • fin stop - to stop Docker stack (containers, volumes and network)
  • fin project remove - to remove all Docker components (containers, volumes and network)

3. Run specific test

Run fin tt TAG_NAME command, where TAG_NAME is tag name defined in PHP test files. Most important tags:

  • @user_forms_error
  • @update_user_profile_process
  • @user_register_account_level1_ok
  • @user_register_account_level2_ok
  • @webinar_create
  • @webinar_open
  • @new_user_watch_webinar_process

4. See what Selenium are doing

  1. Define SELENIUM_DEBUG="-debug" in .docksal/docksal-local.env file and run fin start command.
  2. Open VNC viewer with fin vnc command.

5. Customize Selenium

In .docksal/docksal-local.env file define variables:

  • SELENIUM_BROWSER_NAME and SELENIUM_DEBUG - browser name, lookup for one at hub.docker.com.
  • SELENIUM_PORT, default: 4444
  • SELENIUM_VNC_PORT, default: 5900
  • SELENIUM_SCREEN_WIDTH, default: 1366
  • SELENIUM_SCREEN_HEIGHT, default: 768
  • SELENIUM_SCREEN_DEPTH, default: 24
  • SELENIUM_SCREEN_DPI, default: 74

When You made some changes please recreate Docker stack with fin start command.

6. Write custom tests

Read behat mink documentation.

7. Troubleshooting

  1. For ERROR: for selenium Cannot start service selenium: Ports are not available: listen tcp 0.0.0.0:5900: bind: address already in use please define SELENIUM_VNC_PORT in .docksal/docksal-local.yml file.

behat-selenium-docker's People

Contributors

bartlomiej-kwiatek-vml avatar flower7c3 avatar

Watchers

 avatar  avatar

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.