diff --git a/behat.yml b/behat.yml index f3854e1d..ff35719d 100644 --- a/behat.yml +++ b/behat.yml @@ -24,11 +24,13 @@ default: screenshot: false Behat\MinkExtension: + browser_name: chrome base_url: 'http://127.0.0.1:8088/' goutte: ~ + selenium2: ~ sessions: default: - goutte: ~ + selenium2: ~ Behatch\Extension: ~ @@ -39,4 +41,4 @@ default: contexts: - Behatch\Context\JsonContext - Context\FeatureContext - paths: [ "%paths.base%/tests/api" ] + paths: [ "%paths.base%/tests/api"] diff --git a/composer.json b/composer.json index f6d6226c..0de9261e 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,11 @@ "ext-pdo": "*", "antishov/doctrine-extensions-bundle": "^1.4", "api-platform/core": "^2.4", + "behat/mink-selenium2-driver": "^1.3", "bolt/common": "^2.1.0", "cocur/slugify": "^3.2", "composer/composer": "^1.9", + "dmore/chrome-mink-driver": "^2.7", "doctrine/annotations": "^1.7", "doctrine/doctrine-bundle": "^1.11", "doctrine/doctrine-cache-bundle": "^1.3.1", @@ -71,8 +73,10 @@ "acmecorp/reference-extension": "^1.0", "behat/behat": "^3.5", "behat/mink": "dev-master@dev", + "behat/mink-browserkit-driver": "^1.3", "behat/mink-extension": "^2.3", "behat/mink-goutte-driver": "^1.2", + "behat/symfony2-extension": "^2.1", "behatch/contexts": "^3.2", "bobdenotter/weatherwidget": "^1.0", "bolt/newswidget": "^1.0", diff --git a/tests/api/bootstrap/FeatureContext.php b/tests/api/bootstrap/FeatureContext.php index 0052261c..a8a4b212 100644 --- a/tests/api/bootstrap/FeatureContext.php +++ b/tests/api/bootstrap/FeatureContext.php @@ -226,4 +226,12 @@ class FeatureContext extends MinkContext implements Context return $client; } + + /** + * @When /^wait (\d+) seconds?$/ + */ + public function waitSeconds($seconds) + { + $this->getSession()->wait(1000*$seconds); + } } diff --git a/tests/api/content/homepage.feature b/tests/api/content/homepage.feature new file mode 100644 index 00000000..bac3090e --- /dev/null +++ b/tests/api/content/homepage.feature @@ -0,0 +1,7 @@ +Feature: Homepage + @javascript + Scenario: I want to display Homepage + When I am on "/" + And wait 5 seconds + Then I should see "Bolt Core Git Clone" + And I should see "Recent Pages" \ No newline at end of file diff --git a/tests/e2e/features/filemanager.feature b/tests/e2e/features/filemanager.feature index b3675a97..face7994 100644 --- a/tests/e2e/features/filemanager.feature +++ b/tests/e2e/features/filemanager.feature @@ -15,5 +15,12 @@ Feature: Filemanager Then there is element "header" with text "Content files" And there is element "path" with text "Path: files/" + Scenario: As an Admin I want to upload files in the "Files" section + Given I am logged in as "admin" + + When I visit the "filemanager" page with parameters: + | area | files | + And I fill the form + Then there is element "svg" with height "55px" # @todo Add tests for uploading files, and verifying that they're there \ No newline at end of file diff --git a/tests/e2e/kakunin.conf.js b/tests/e2e/kakunin.conf.js index 831cfede..e826783a 100644 --- a/tests/e2e/kakunin.conf.js +++ b/tests/e2e/kakunin.conf.js @@ -50,7 +50,7 @@ module.exports = { "clearCookiesAfterScenario": true, "clearLocalStorageAfterScenario": true, "email": null, - "headless": true, + "headless": false, "noGpu": false, "type": "otherWeb", "baseUrl": "http://127.0.0.1:8088",