Skip to content

Instantly share code, notes, and snippets.

@kilip
Last active February 6, 2018 03:54
Show Gist options
  • Save kilip/5aaae72d7f5dde63caf561c1eb85b92a to your computer and use it in GitHub Desktop.
Save kilip/5aaae72d7f5dde63caf561c1eb85b92a to your computer and use it in GitHub Desktop.
Behat PHPList Setup

New Development Requirements

To make selenium easier to be used by developer this 2 packages added into dev dependencies:

  • enm1989/chromedriver
  • se/selenium-server-standalone

New bash script bin/start-selenium added, so developer can start selenium by using this command:

# cd path/to/phplist3
$ bin/start-selenium

This command need to be execute before perform behat tests with chrome browser

Parameters Changed

This config parameters for FeatureContext is deleted:

  • baseurl
  • db_user
  • db_password
  • db_name
  • admin_username
  • admin_password

The new configFeatureContext parameter with their default value is:

# cd path/to/phplist3/behat.yml
default:
    suites:
        default:
            contexts:
                - FeatureContext:
                    # Set database access credentials
                    database:
                        host: localhost
                        user: phplist
                        password: phplist
                        name: phplistdb
                    # Set admin user login credentials
                    admin:
                        username: admin
                        password: admin

Browser Testing

By this default command behat will be using goutte:

$ behat

To do tests with chrome browser we should type this command (using behat profile):

$ behat -p chrome

Since using selenium with firefox is buggy, we can't tests firefox browser (at least for now).

Travis Build

  • Removed php 5.3 version, because no compatible package availble for php 5.3 version to take a screenshot during selenium tests.
  • Actually the old travis build never use the phpenv version, the php version used in test is the one from apache (see this link. In the new travis configuration we using php built in server:
$ php -S localhost:8000 -t public_html/
  • By default all tests in php version will use goutte, we only have 7.1 version to be tested with chrome browser
  • For chrome browser test, failed screen shot will be uploaded into imgur by using bin/imgur-uploader.sh script. A link for this image can be found by the end of travis build log
  • Behat will skip features/scenarios that tagged with @wip such as this feature. Please remove this tag if that features/scenario is fixed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment