Skip to content

Commit

Permalink
Update test framework to use behat/phantomJS tests
Browse files Browse the repository at this point in the history
Addresses #1338
  • Loading branch information
zcwilt committed Nov 21, 2016
1 parent cfd94f0 commit 79541cf
Show file tree
Hide file tree
Showing 21 changed files with 2,577 additions and 1,829 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -22,3 +22,7 @@ dev-*.*
.idea
# dbv
/data/meta/revision
localconfig_*.php
!localconfig_travis.php
!localconfig_EXAMPLE.php
!localconfig_vagrant.php
9 changes: 7 additions & 2 deletions .travis.yml
Expand Up @@ -57,11 +57,16 @@ before_script:
# sauce setup
# - bash testFramework/setup/do-sauce.sh
- mkdir -p build/logs
# start PHP webserver
- "php -S 127.0.0.1:8000 > /dev/null &"
# Start PhantomJS
- "phantomjs --webdriver=8643 --ignore-ssl-errors=true > /dev/null &"

script:
# unittests
- php vendor/bin/phpunit -c testFramework/unittests/phpunit.xml
#uncomment the following to trigger webtests
# - testFramework/webtests/vendor/bin/phpunit testFramework/webtests/allWebTests.php
# webtests
- vendor/bin/behat

after_script:
#- vendor/bin/phpcs --standard=PSR2 includes/ testFramework/
Expand Down
36 changes: 36 additions & 0 deletions behat.yml
@@ -0,0 +1,36 @@
default:
autoload:
- %paths.base%/testFramework/behat/features/bootstrap
suites:
installer_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/testInstaller.feature ]
contexts: [ MainContext ]
taxzone_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/testTaxZones.feature ]
contexts: [ MainContext ]
customer_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/createCustomers.feature ]
contexts: [ MainContext ]
gv_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/giftVoucherPurchase.feature ]
contexts: [ MainContext ]
create_coupons_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/createCoupons.feature ]
contexts: [ MainContext ]
use_coupons_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/useCoupons.feature ]
contexts: [ MainContext ]
group_discount_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/groupDiscount.feature ]
contexts: [ MainContext ]
low_order_fee_features:
paths: [ %paths.base%/testFramework/behat/features/testFeatures/lowOrderFee.feature ]
contexts: [ MainContext ]

extensions:
Behat\MinkExtension:
goutte:
guzzle_parameters:
verify: false
selenium2:
wd_host: "http://localhost:8643/wd/hub"
22 changes: 18 additions & 4 deletions composer.json
Expand Up @@ -14,10 +14,14 @@
"php": ">=5.5"
},
"require-dev": {
"phpunit/phpunit": ">4.8",
"phpdocumentor/phpdocumentor": ">=2.9",
"jakoch/phantomjs-installer": "^2.1",
"phpunit/phpunit": "=4.8",
"mikey179/vfsStream": ">1.6",
"phpunit/phpunit-selenium": ">=1.2"
"behat/behat": "^3.2",
"behat/mink": "^1.7",
"behat/mink-goutte-driver": "^1.2",
"behat/mink-selenium2-driver": "^1.3",
"behat/mink-extension": "^2.2"
},
"autoload": {
"classmap": ["includes/classes", "includes/modules"],
Expand All @@ -30,8 +34,18 @@
"classmap": ["testFramework"]
},
"include-path": ["includes/"],
"config": {
"bin-dir": "vendor/bin"
},
"scripts": {
"post-install-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
],
"post-update-cmd": [
"PhantomInstaller\\Installer::installPhantomJS"
],
"tests": "phpunit --verbose -c testFramework/unittests/phpunit.xml",
"webtests": "phpunit --verbose -c testFramework/webtests/phpunit.xml --debug"
"webtests": "phpunit --verbose -c testFramework/webtests/phpunit.xml --debug",
"behat": "vendor/bin/behat"
}
}

0 comments on commit 79541cf

Please sign in to comment.