yawik / behat
This package provide a Behat tests utility for yawik
Installs: 3 113
Dependents: 13
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 1
Open Issues: 0
Requires
- behat/behat: ^3.2
- behat/mink: ^1.7
- behat/mink-browserkit-driver: ^1.3
- behat/mink-extension: ^2.3
- behat/mink-selenium2-driver: ^1.3
- enm1989/chromedriver: ^84.0
- lakion/mink-debug-extension: ^1.2.3
- novaway/common-contexts: ~2.0
- se/selenium-server-standalone: ^2.52
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- 0.35.8
- 0.35.7
- v0.35.6
- v0.35.5
- v0.35.4
- v0.35.3
- v0.35.2
- v0.35.1
- v0.35.0
- v0.34.9
- v0.34.8
- v0.34.7
- 0.34.6
- v0.34.5
- v0.34.4
- v0.34.3
- v0.34.2
- v0.34.1
- v0.34.0
- dev-develop / 0.33.x-dev
- 0.33.22
- v0.33.21
- v0.33.20
- v0.33.19
- v0.33.18
- v0.33.17
- v0.33.16
- v0.33.15
- v0.33.14
- v0.33.13
- v0.33.12
- 0.33.11
- 0.33.10
- v0.33.9
- v0.33.8
- v0.33.7
- v0.33.6
- v0.33.5
- v0.33.4
- v0.33.1
- v0.33
- dev-master / 0.32.x-dev
- v0.32.0
- v0.32.0-RC1
- dev-odm-module3
- dev-release-0.32.0
This package is auto-updated.
Last update: 2024-12-06 19:22:56 UTC
README
Yawik use behat to do browser testing. Here's how to run behat tests:
WARNING!!!
In order to perform installation tests, behat will create config/autoload/install.module.php
file.
If you have your yawik installation always go to install page, please remove this file manually
and restore backup file:
$ cd path/to/yawik
$ rm config/autoload/install.module.php
$ mv config/autoload/yawik.backup config/autoload/yawik.config.global.php
Behat Configuration
Copy default behat configuration file:
$ cp behat.yml.dist behat.yml
Edit base_url
in behat.yml
configuration files to match your
local yawik installation url:
# change base url to match your location default: ... extensions: ... Behat\MinkExtension: # change this base url value to match # your local development server url: base_url: "http://localhost:8000" files_path: "%paths.base%/module/Behat/resources/fixtures/"
Run Behat tests
Start selenium standalone server with chrome driver:
$ cd path/to/yawik
$ ./bin/start-selenium.sh
You can run all scenario with this command:
$ cd path/to/yawik
$ ./vendor/bin/behat
To run behat only for specific feature:
$ ./vendor/bin/behat features/install.feature
To run behat only for specific scenario:
$ ./vendor/bin/behat features/install.feature:12
That command above will run only scenario in features/install.feature
line 12
Screenshot
Because by default behat will perform test in headless mode,
you can see screenshot for behat failed test in build/behat
directory.
The *.png
files will show browser screenshot, and *.log
files
will show actual html output during tests.
Mail and Social Profile Feature
By default behat will skip mail and social profile tests, because this will cause error in travis. To perform this skipped tests you need to be sure that your mail and social login configuration is valid, and configure social profile user to be used during tests:
# path/to/yawik/behat.yml default: suites: user: contexts: - Yawik\Behat\UserContext: parameters: social_login_info: facebook: email: <test-facebook-user> pass: <test-facebook-password> linkedin: session_key-login: <test-linked-in-user> session_password-login: <test-linked-in-password>
You can run this skipped tests by using this command:
# to run mail tests: $ cd path/to/yawik $ ./vendor/bin/behat --tags=@mail # to run social profile tests $ cd path/to/yawik $ ./vendor/bin/behat --tags=@social-profile