diff --git a/.rmt.yml b/.rmt.yml index 23dc748..4505dc9 100644 --- a/.rmt.yml +++ b/.rmt.yml @@ -11,7 +11,7 @@ _default: working-copy-check: ~ display-last-changes: ~ composer-stability-check: ~ - tests-check: {command: composer test-ci} + tests-check: {command: composer test} # GENERAL CONFIG # Apply to all branches except the one from the 'branch-specific' section diff --git a/.travis.yml b/.travis.yml index 8a0258e..c284408 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,8 +57,7 @@ before_script: script: # Test if the website is actually running - - phantomjs --config=./phantomjs.json < /dev/null & - - composer test-ci + - composer test after_script: - cat $TRAVIS_BUILD_DIR/error.log diff --git a/README.md b/README.md index 659c830..957c033 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,6 @@ Tests and metrics To run all required test you can run the following commands from the dev env: ```bash - ./bin/bootstrap_phantomjs.sh composer test ``` diff --git a/behat.yml b/behat.yml index 67d42f8..193fd5e 100755 --- a/behat.yml +++ b/behat.yml @@ -7,12 +7,16 @@ default: Behat\MinkExtension: base_url: https://gssp.stepup.example.com default_session: 'symfony2' + goutte: + guzzle_parameters: + curl.CURLOPT_SSL_VERIFYPEER: false + curl.CURLOPT_CERTINFO: false + ssl.certificate_authority: false + verify: false sessions: symfony2: symfony2: ~ - selenium2: - wd_host: "http://127.0.0.1:8646/wd/hub" - capabilities: { "browser": "firefox", "version": "14"} + Behatch\Extension: ~ suites: app_bundle: @@ -23,4 +27,12 @@ default: - Behat\MinkExtension\Context\MinkContext - behatch:context:xml bundle: 'AppBundle' + sp_bundle: + type: symfony_bundle + contexts: + - AppBundle\Features\Context\WebContext + - AppBundle\Features\Context\ErrorReportContext + - Behat\MinkExtension\Context\MinkContext + - behatch:context:xml + bundle: 'SpBundle' diff --git a/bin/bootstrap_phantomjs.sh b/bin/bootstrap_phantomjs.sh deleted file mode 100755 index 27129fb..0000000 --- a/bin/bootstrap_phantomjs.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -pkill phantomjs -./bin/phantomjs --config=./phantomjs.json >/dev/null 2>&1 < /dev/null & diff --git a/bin/phantomjs b/bin/phantomjs deleted file mode 100755 index d72e801..0000000 Binary files a/bin/phantomjs and /dev/null differ diff --git a/composer.json b/composer.json index 5c7f3f8..7a48b98 100644 --- a/composer.json +++ b/composer.json @@ -45,7 +45,7 @@ "behat/behat": "^3.4", "behat/mink-browserkit-driver": "^1.3", "behat/mink-extension": "^2.2", - "behat/mink-selenium2-driver": "^1.3", + "behat/mink-goutte-driver": "^1.2", "behat/symfony2-extension": "^2.1", "behatch/contexts": "^2.7", "jakub-onderka/php-parallel-lint": "^0.9.2", @@ -69,14 +69,6 @@ "@security-tests" ], - "test-ci": [ - "@lint", - "@static-analysis", - "@phpunit", - "@behat-ci", - "@security-tests" - ], - "lint": ["@lint-php", "@lint-yml", "@lint-composer"], "lint-php": "vendor/bin/parallel-lint app src", "lint-yml": "bin/console lint:yaml app/config", @@ -93,7 +85,6 @@ "phpunit": "vendor/bin/phpunit tests", "behat": ["vendor/bin/behat --config behat.yml"], - "behat-ci": ["vendor/bin/behat --config behat.yml --tags '~@javascript'"], "security-tests": "vendor/bin/security-checker security:check --end-point=http://security.sensiolabs.org/check_lock", diff --git a/composer.lock b/composer.lock index ab84477..0b1154b 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "af74107dbe1ae89215a957b55a77d44f", + "content-hash": "e443cb44f3016f31395d549f62926e48", "packages": [ { "name": "beberlei/assert", @@ -2639,31 +2639,32 @@ "time": "2017-11-24T19:30:49+00:00" }, { - "name": "behat/mink-selenium2-driver", - "version": "v1.3.1", + "name": "behat/mink-goutte-driver", + "version": "v1.2.1", "source": { "type": "git", - "url": "https://github.com/minkphp/MinkSelenium2Driver.git", - "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288" + "url": "https://github.com/minkphp/MinkGoutteDriver.git", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/minkphp/MinkSelenium2Driver/zipball/473a9f3ebe0c134ee1e623ce8a9c852832020288", - "reference": "473a9f3ebe0c134ee1e623ce8a9c852832020288", + "url": "https://api.github.com/repos/minkphp/MinkGoutteDriver/zipball/8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", + "reference": "8b9ad6d2d95bc70b840d15323365f52fcdaea6ca", "shasum": "" }, "require": { - "behat/mink": "~1.7@dev", - "instaclick/php-webdriver": "~1.1", + "behat/mink": "~1.6@dev", + "behat/mink-browserkit-driver": "~1.2@dev", + "fabpot/goutte": "~1.0.4|~2.0|~3.1", "php": ">=5.3.1" }, "require-dev": { - "symfony/phpunit-bridge": "~2.7" + "symfony/phpunit-bridge": "~2.7|~3.0" }, "type": "mink-driver", "extra": { "branch-alias": { - "dev-master": "1.3.x-dev" + "dev-master": "1.2.x-dev" } }, "autoload": { @@ -2680,24 +2681,17 @@ "name": "Konstantin Kudryashov", "email": "ever.zet@gmail.com", "homepage": "http://everzet.com" - }, - { - "name": "Pete Otaqui", - "email": "pete@otaqui.com", - "homepage": "https://github.com/pete-otaqui" } ], - "description": "Selenium2 (WebDriver) driver for Mink framework", + "description": "Goutte driver for Mink framework", "homepage": "http://mink.behat.org/", "keywords": [ - "ajax", "browser", - "javascript", - "selenium", - "testing", - "webdriver" + "goutte", + "headless", + "testing" ], - "time": "2016-03-05T09:10:18+00:00" + "time": "2016-03-05T09:04:22+00:00" }, { "name": "behat/symfony2-extension", @@ -2948,111 +2942,288 @@ "time": "2015-06-14T21:17:01+00:00" }, { - "name": "hamcrest/hamcrest-php", - "version": "v2.0.0", + "name": "fabpot/goutte", + "version": "v3.2.2", "source": { "type": "git", - "url": "https://github.com/hamcrest/hamcrest-php.git", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" + "url": "https://github.com/FriendsOfPHP/Goutte.git", + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", - "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", + "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/395f61d7c2e15a813839769553a4de16fa3b3c96", + "reference": "395f61d7c2e15a813839769553a4de16fa3b3c96", "shasum": "" }, "require": { - "php": "^5.3|^7.0" - }, - "replace": { - "cordoval/hamcrest-php": "*", - "davedevelopment/hamcrest-php": "*", - "kodova/hamcrest-php": "*" + "guzzlehttp/guzzle": "^6.0", + "php": ">=5.5.0", + "symfony/browser-kit": "~2.1|~3.0|~4.0", + "symfony/css-selector": "~2.1|~3.0|~4.0", + "symfony/dom-crawler": "~2.1|~3.0|~4.0" }, "require-dev": { - "phpunit/php-file-iterator": "1.3.3", - "phpunit/phpunit": "~4.0", - "satooshi/php-coveralls": "^1.0" + "symfony/phpunit-bridge": "^3.3 || ^4" }, - "type": "library", + "type": "application", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.2-dev" } }, "autoload": { - "classmap": [ - "hamcrest" + "psr-4": { + "Goutte\\": "Goutte" + }, + "exclude-from-classmap": [ + "Goutte/Tests" ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD" + "MIT" ], - "description": "This is the PHP port of Hamcrest Matchers", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "A simple PHP Web Scraper", + "homepage": "https://github.com/FriendsOfPHP/Goutte", "keywords": [ - "test" + "scraper" ], - "time": "2016-01-20T08:20:44+00:00" + "time": "2017-11-19T08:45:40+00:00" }, { - "name": "instaclick/php-webdriver", - "version": "1.4.5", + "name": "guzzlehttp/guzzle", + "version": "6.3.0", "source": { "type": "git", - "url": "https://github.com/instaclick/php-webdriver.git", - "reference": "6fa959452e774dcaed543faad3a9d1a37d803327" + "url": "https://github.com/guzzle/guzzle.git", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/6fa959452e774dcaed543faad3a9d1a37d803327", - "reference": "6fa959452e774dcaed543faad3a9d1a37d803327", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/f4db5a78a5ea468d4831de7f0bf9d9415e348699", + "reference": "f4db5a78a5ea468d4831de7f0bf9d9415e348699", "shasum": "" }, "require": { + "guzzlehttp/promises": "^1.0", + "guzzlehttp/psr7": "^1.4", + "php": ">=5.5" + }, + "require-dev": { "ext-curl": "*", - "php": ">=5.3.2" + "phpunit/phpunit": "^4.0 || ^5.0", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.2-dev" + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "homepage": "http://guzzlephp.org/", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "rest", + "web service" + ], + "time": "2017-06-22T18:50:49+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "v1.3.1", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", + "shasum": "" + }, + "require": { + "php": ">=5.5.0" }, "require-dev": { - "phpunit/phpunit": "^4.8", - "satooshi/php-coveralls": "^1.0||^2.0" + "phpunit/phpunit": "^4.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.4-dev" } }, "autoload": { - "psr-0": { - "WebDriver": "lib/" + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "time": "2016-12-20T10:07:11+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", + "shasum": "" + }, + "require": { + "php": ">=5.4.0", + "psr/http-message": "~1.0" + }, + "provide": { + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" } }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + }, + "files": [ + "src/functions_include.php" + ] + }, "notification-url": "https://packagist.org/downloads/", "license": [ - "Apache-2.0" + "MIT" ], "authors": [ { - "name": "Justin Bishop", - "email": "jubishop@gmail.com", - "role": "Developer" + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" }, { - "name": "Anthon Pang", - "email": "apang@softwaredevelopment.ca", - "role": "Fork Maintainer" + "name": "Tobias Schultze", + "homepage": "https://github.com/Tobion" } ], - "description": "PHP WebDriver for Selenium 2", - "homepage": "http://instaclick.com/", + "description": "PSR-7 message implementation that also provides common utility methods", "keywords": [ - "browser", - "selenium", - "webdriver", - "webtest" + "http", + "message", + "request", + "response", + "stream", + "uri", + "url" + ], + "time": "2017-03-20T17:10:46+00:00" + }, + { + "name": "hamcrest/hamcrest-php", + "version": "v2.0.0", + "source": { + "type": "git", + "url": "https://github.com/hamcrest/hamcrest-php.git", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/hamcrest/hamcrest-php/zipball/776503d3a8e85d4f9a1148614f95b7a608b046ad", + "reference": "776503d3a8e85d4f9a1148614f95b7a608b046ad", + "shasum": "" + }, + "require": { + "php": "^5.3|^7.0" + }, + "replace": { + "cordoval/hamcrest-php": "*", + "davedevelopment/hamcrest-php": "*", + "kodova/hamcrest-php": "*" + }, + "require-dev": { + "phpunit/php-file-iterator": "1.3.3", + "phpunit/phpunit": "~4.0", + "satooshi/php-coveralls": "^1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "hamcrest" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD" ], - "time": "2017-06-30T04:02:48+00:00" + "description": "This is the PHP port of Hamcrest Matchers", + "keywords": [ + "test" + ], + "time": "2016-01-20T08:20:44+00:00" }, { "name": "jakub-onderka/php-parallel-lint", @@ -4085,6 +4256,56 @@ ], "time": "2017-06-30T09:13:00+00:00" }, + { + "name": "psr/http-message", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", + "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "time": "2016-08-06T14:39:51+00:00" + }, { "name": "sebastian/code-unit-reverse-lookup", "version": "1.0.1", diff --git a/docs/testing.md b/docs/testing.md index 32fef12..0ec3c55 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -7,8 +7,6 @@ as well as on a continuous integration server, which also helps the developer to You can run all test combined with: ```bash -./bin/bootstrap_phantomjs.sh - composer test ``` @@ -62,8 +60,6 @@ Acceptance tests will be written for all command handlers and will be run as par You can run these tools manually with composer: ```bash -./bin/bootstrap_phantomjs.sh - composer behat ``` diff --git a/phantomjs.json b/phantomjs.json deleted file mode 100644 index 6d1a378..0000000 --- a/phantomjs.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "ignoreSslErrors": true, - "load-images": true, - "localToRemoteUrlAccessEnabled": true, - "cookies-file": "/tmp/phantomjs-cookies", - "webdriver": 8646 -} \ No newline at end of file diff --git a/src/AppBundle/Features/Context/WebContext.php b/src/AppBundle/Features/Context/WebContext.php index 7a48518..7f10fad 100644 --- a/src/AppBundle/Features/Context/WebContext.php +++ b/src/AppBundle/Features/Context/WebContext.php @@ -17,7 +17,9 @@ namespace AppBundle\Features\Context; +use Behat\Behat\Event\ScenarioEvent; use Behat\Behat\Hook\Scope\BeforeScenarioScope; +use Behat\Mink\Driver\GoutteDriver; use Behat\MinkExtension\Context\MinkContext; use Behat\Symfony2Extension\Context\KernelAwareContext; use Behat\Behat\Context\Context; @@ -72,22 +74,22 @@ public function gatherContexts(BeforeScenarioScope $scope) } /** - * Set mink driver to selenium2 + * Set mink driver to goutte * - * @BeforeScenario javascript + * @BeforeScenario @remote */ - public function setJsDriver() + public function setGoutteDriver() { $this->previousMinkSession = $this->minkContext->getMink()->getDefaultSessionName(); - $this->minkContext->getMink()->setDefaultSessionName('selenium2'); + $this->minkContext->getMink()->setDefaultSessionName('goutte'); } /** - * Set mink driver to selenium2 + * Set mink driver to goutte * - * @AfterScenario javascript + * @AfterScenario @remote */ - public function resetJsDriver() + public function resetGoutteDriver() { $this->minkContext->getMink()->setDefaultSessionName($this->previousMinkSession); } @@ -133,36 +135,6 @@ public function getServiceProvider() ); } - /** - * @Then i wait :seconds seconds until i'm redirected to :url - * - * @param int $seconds - * @param string $url - */ - public function iWaitUntilRedirectedToUrl($seconds, $url) - { - while ($seconds--) { - try { - $this->minkContext->assertPageAddress($url); - - return; - } catch (\Exception $exception) { - // Try again. - } - } - $this->minkContext->assertPageAddress($url); - } - - /** - * @Then i wait :seconds seconds for the redirect back the service provider - * - * @param int $seconds - */ - public function iWaitUntilRedirectedToServiceProvider($seconds) - { - $this->iWaitUntilRedirectedToUrl($seconds, '/simplesamlphp/sp.php'); - } - /** * @Given /^a normal SAML 2.0 AuthnRequest form a unknown service provider$/ * diff --git a/src/AppBundle/Features/authentication.feature b/src/AppBundle/Features/authentication.feature index e38c99c..cf7323c 100644 --- a/src/AppBundle/Features/authentication.feature +++ b/src/AppBundle/Features/authentication.feature @@ -2,7 +2,7 @@ Feature: When an user needs to authenticate As a service provider I need to send an AuthnRequest with a nameID to the identity provider - @javascript + @remote Scenario: When an user needs to register for a new token Given I am on "https://pieter.aai.surfnet.nl/simplesamlphp/sp.php?sp=default-sp" And I select "https://gssp.stepup.example.com/app_dev.php/saml/metadata" from "idp" @@ -12,7 +12,7 @@ Feature: When an user needs to authenticate And I should be on "https://gssp.stepup.example.com/app_dev.php/authentication" When I press "Authenticate user" - Then i wait "120" seconds for the redirect back the service provider - And I should see "You are logged in to SP: default-sp" - And I should see "IdP EnitytID: https://gssp.stepup.example.com/app_dev.php/saml/metadata" + Then I press "Submit" + And I should see "You are logged in to SP:default-sp" + And I should see "IdP EnitytID:https://gssp.stepup.example.com/app_dev.php/saml/metadata" And I should see "test-name-id-1234" diff --git a/src/AppBundle/Features/registration.feature b/src/AppBundle/Features/registration.feature index c4ee36d..d1a3f2c 100644 --- a/src/AppBundle/Features/registration.feature +++ b/src/AppBundle/Features/registration.feature @@ -3,7 +3,7 @@ Feature: When an user needs to register for a new token As a service provider I need to send an AuthnRequest to the identity provider - @javascript + @remote Scenario: When an user needs to register for a new token Given I am on "https://pieter.aai.surfnet.nl/simplesamlphp/sp.php?sp=default-sp" And I select "https://gssp.stepup.example.com/app_dev.php/saml/metadata" from "idp" @@ -13,9 +13,9 @@ Feature: When an user needs to register for a new token Given I fill in "Subject NameID" with "test-name-id-1234" When I press "Register user" - Then i wait "120" seconds for the redirect back the service provider - And I should see "You are logged in to SP: default-sp" - And I should see "IdP EnitytID: https://gssp.stepup.example.com/app_dev.php/saml/metadata" + Then I press "Submit" + And I should see "You are logged in to SP:default-sp" + And I should see "IdP EnitytID:https://gssp.stepup.example.com/app_dev.php/saml/metadata" And I should see "test-name-id-1234" Scenario: When the user is redirected from an unknown service provider he should see an error page diff --git a/src/SpBundle/Features/authentication.feature b/src/SpBundle/Features/authentication.feature new file mode 100644 index 0000000..a042b60 --- /dev/null +++ b/src/SpBundle/Features/authentication.feature @@ -0,0 +1,24 @@ +@remote +Feature: When an user needs to authenticate + As a service provider + I need to send an AuthnRequest with a nameID to the identity provider + + Scenario: When an user needs to register for a new token + + # The user clicks on authenticate button from the SP + Given I am on "https://gssp.stepup.example.com/app_dev.php/demo/sp" + Then I should see "Demo service provider" + And I fill in "Subject NameID" with "test-name-id-1234" + Given I press "Authenticate user" + + # The user clicks on authenticate button from the GSSP IdP + Then I should be on "https://gssp.stepup.example.com/app_dev.php/authentication" + Given I press "Authenticate user" + + # The SSO return page + Then I should be on "https://gssp.stepup.example.com/app_dev.php/saml/sso_return" + Given I press "Submit" + + # Returns to the SP + And I should see "Demo Service provider ConsumerAssertionService endpoint" + And I should see "test-name-id-1234" diff --git a/src/SpBundle/Features/registration.feature b/src/SpBundle/Features/registration.feature new file mode 100644 index 0000000..d094a23 --- /dev/null +++ b/src/SpBundle/Features/registration.feature @@ -0,0 +1,27 @@ +@remote +Feature: When an user needs to register for a new token + To register an user for a new token + As a service provider + I need to send an AuthnRequest to the identity provider + + Scenario: When an user needs to register for a new token + # The user request a registration from the service provider + Given I am on "https://gssp.stepup.example.com/app_dev.php/demo/sp" + Then I should see "Demo service provider" + When I press "Register user" + + # The user register himself at the IdP + Then I should see "Registration" + And I should be on "https://gssp.stepup.example.com/app_dev.php/registration" + + # GSSP assigns a subject name id to the user + Given I fill in "Subject NameID" with "test-name-id-1234" + When I press "Register user" + + # The SSO return page + Then I should be on "https://gssp.stepup.example.com/app_dev.php/saml/sso_return" + Given I press "Submit" + + # Back at the SP. + And I should see "Demo Service provider ConsumerAssertionService endpoint" + And I should see "test-name-id-1234"