diff --git a/modules/dkan/dkan_data_story/test/.gitignore b/modules/dkan/dkan_data_story/test/.gitignore deleted file mode 100644 index 7e0d6d51d3..0000000000 --- a/modules/dkan/dkan_data_story/test/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -bin -composer.lock -composer.phar -vendor -screens/* \ No newline at end of file diff --git a/modules/dkan/dkan_data_story/test/behat.yml b/modules/dkan/dkan_data_story/test/behat.yml deleted file mode 100644 index 421ce85eee..0000000000 --- a/modules/dkan/dkan_data_story/test/behat.yml +++ /dev/null @@ -1,26 +0,0 @@ -default: - extensions: - Behat\MinkExtension\Extension: - goutte: ~ - selenium2: ~ - base_url: http://127.0.0.1:8888 - default_session: 'goutte' - javascript_session: 'selenium2' - Drupal\DrupalExtension\Extension: - blackbox: ~ - api_driver: 'drupal' - drush: - alias: @self - region_map: - toolbar: ".tabs.primary" - drupal: - drupal_root: 'drupal' - text: - log_out: "Log out" - log_in: "Log in" - -teo: - extensions: - Drupal\DrupalExtension\Extension: - drupal: - drupal_root: '/Users/teofilosibileau/Developing/NUCIVIC/drupal_test/test/' diff --git a/modules/dkan/dkan_data_story/test/composer.json b/modules/dkan/dkan_data_story/test/composer.json deleted file mode 100644 index 181521d946..0000000000 --- a/modules/dkan/dkan_data_story/test/composer.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "require": { - "drupal/drupal-extension": "1.0.2" - }, - "config": { - "bin-dir": "bin/" - } -} diff --git a/modules/dkan/dkan_data_story/test/features/bootstrap/FeaturedContext.php b/modules/dkan/dkan_data_story/test/features/bootstrap/FeaturedContext.php deleted file mode 100644 index b43166107e..0000000000 --- a/modules/dkan/dkan_data_story/test/features/bootstrap/FeaturedContext.php +++ /dev/null @@ -1,137 +0,0 @@ -getHash(); - foreach ($memberships as $membership) { - // Find group node. - $group_node = $membership['group']; - foreach($this->nodes as $node) { - if($node->type == 'group' && $node->title == $group_node) { - $group_node = $node; - } - } - - // Subscribe nodes and users to group. - if (isset($membership['members'])) { - $members = explode(",", $membership['members']); - foreach ($this->users as $user) { - if (in_array($user->name, $members)) { - og_group( - 'node', - $group_node->nid, - array( - 'entity' => $user, - 'entity_type' => 'user', - "membership type" => OG_MEMBERSHIP_TYPE_DEFAULT, - ) - ); - // Patch till i figure out why rules are not firing. - if ($user->name == 'editor') { - og_role_grant('node', $group_node->nid, $user->uid, 4); - } - } - } - } - - if (isset($membership['nodes'])) { - $content = explode(",", $membership['nodes']); - foreach ($this->nodes as $node) { - if ($node->type != 'group' && in_array($node->title, $content)) { - og_group( - 'node', - $group_node->nid, - array( - 'entity' => $node, - 'entity_type' => 'node', - 'state' => OG_STATE_ACTIVE, - ) - ); - } - } - } - } - } - - /** - * @Given /^I wait for "([^"]*)" seconds$/ - */ - public function iWaitForSeconds($seconds) { - $session = $this->getSession(); - $session->wait($seconds * 1000); - } - - /** - * @Then /^I should see the administration menu$/ - */ - public function iShouldSeeTheAdministrationMenu() { - $xpath = "//div[@id='admin-menu']"; - // grab the element - $element = $this->getXPathElement($xpath); - } - - /** - * @Then /^I should have an "([^"]*)" text format option$/ - */ - public function iShouldHaveAnTextFormatOption($option) { - $xpath = "//select[@name='body[und][0][format]']//option[@value='" . $option . "']"; - // grab the element - $element = $this->getXPathElement($xpath); - } - - /** - * Returns an element from an xpath string - * @param string $xpath - * String representing the xpath - * @return object - * A mink html element - */ - protected function getXPathElement($xpath) { - // get the mink session - $session = $this->getSession(); - // runs the actual query and returns the element - $element = $session->getPage()->find( - 'xpath', - $session->getSelectorsHandler()->selectorToXpath('xpath', $xpath) - ); - // errors must not pass silently - if (null === $element) { - throw new \InvalidArgumentException(sprintf('Could not evaluate XPath: "%s"', $xpath)); - } - return $element; - } - - /** - * Take screenshot when step fails. - * Works only with Selenium2Driver. - * - * @AfterStep - */ - public function takeScreenshotAfterStep($event) - { - if (4 === $event->getResult()) { - $driver = $this->getSession()->getDriver(); - if (!($driver instanceof Selenium2Driver)) { - // throw new UnsupportedDriverActionException('Taking screenshots is not supported by %s, use Selenium2Driver instead.', $driver); - return; - } - $screenshot = $driver->getScreenshot(); - $file = 'screens/' . time() . ' ' . $event->getLogicalParent()->getTitle(); - $file = $file . '.png'; - file_put_contents($file, $screenshot); - } - } -} diff --git a/modules/dkan/dkan_data_story/test/features/dkan_data_story_ui.feature b/modules/dkan/dkan_data_story/test/features/dkan_data_story_ui.feature deleted file mode 100644 index 83c255651f..0000000000 --- a/modules/dkan/dkan_data_story/test/features/dkan_data_story_ui.feature +++ /dev/null @@ -1,11 +0,0 @@ -Feature: Testing module UI - - @api - Scenario: Menu Item - Given I am on the homepage - Then I should see "Stories" - - @api - Scenario: Stories Index - Given I am on "/stories" - Then I should see "No stories were found." diff --git a/modules/dkan/dkan_data_story/test/features/role_storyteller.feature b/modules/dkan/dkan_data_story/test/features/role_storyteller.feature deleted file mode 100644 index 8c3d3b3a47..0000000000 --- a/modules/dkan/dkan_data_story/test/features/role_storyteller.feature +++ /dev/null @@ -1,90 +0,0 @@ -Feature: Testing storyteller role and permissions - - @api - Scenario: Can see the administration menu - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And I am logged in as "storyteller" - When I am on the homepage - Then I should see the administration menu - - @api - Scenario: Can see administration pages - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And I am logged in as "storyteller" - When I am on "/admin" - Then I should see "Content" - - @api - Scenario: Access content overview - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And I am logged in as "storyteller" - When I am on "/admin/content" - Then I should see "About" - - @api - Scenario: Create Story Content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And I am logged in as "storyteller" - When I am on "/node/add/dkan-data-story" - And I fill in "edit-title" with "Test Story Post" - And I fill in "body[und][0][value]" with "Test description" - And I press "Save" - Then I should see "DKAN Data Story Test Story Post has been created" - - @api - Scenario: Delete own story content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And "dkan_data_story" nodes: - | title | author | status | - | test Story Post | storyteller | 1 | - And I am logged in as "storyteller" - When I am on "admin/content" - And I click "delete" - And I press "Delete" - Then I should see "DKAN Data Story Test Story Post has been deleted" - - @api - Scenario: Edit own story content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And "dkan_data_story" nodes: - | title | author | status | - | test Story Post | storyteller | 0 | - And I am logged in as "storyteller" - And I am on "/admin/content" - When I click "edit" - And I fill in "body[und][0][value]" with "Test description Update" - And I press "Save" - Then I should see "DKAN Data Story Test Story Post has been updated" - - @api @javascript - Scenario: Use text format filtered_html - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And I am logged in as "storyteller" - When I am on "/node/add/dkan-data-story" - Then I should have an "html" text format option - - @api - Scenario: View own unpublished content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | 132006037 | - And "dkan_data_story" nodes: - | title | author | status | - | test Story Post | storyteller | 0 | - And I am logged in as "storyteller" - When I am on "/admin/content" - Then I should see "test Story Post" diff --git a/test/behat.yml b/test/behat.yml index e40a5191a7..5ad448d567 100644 --- a/test/behat.yml +++ b/test/behat.yml @@ -7,6 +7,13 @@ default: - Drupal\DrupalExtension\Context\MinkContext - Drupal\DrupalExtension\Context\MessageContext - Drupal\DrupalExtension\Context\DrushContext + - Drupal\DKANExtension\Context\GroupContext + - Drupal\DKANExtension\Context\DatasetContext + - Drupal\DKANExtension\Context\ResourceContext + - Drupal\DKANExtension\Context\PageContext + - Drupal\DKANExtension\Context\DKANDataStoryContext + - Drupal\DKANExtension\Context\DataDashboardContext + - Drupal\DKANExtension\Context\ChartContext - Devinci\DevinciExtension\Context\DebugContext: asset_dump_path: %paths.base%/../assets/ - Devinci\DevinciExtension\Context\JavascriptContext: @@ -18,9 +25,9 @@ default: Behat\MinkExtension: goutte: ~ selenium2: ~ - base_url: http://127.0.0.1:8888 default_session: 'goutte' javascript_session: 'selenium2' + files_path: %paths.base%/files Drupal\DrupalExtension: blackbox: ~ drupal: @@ -57,6 +64,7 @@ local: extensions: Behat\MinkExtension: base_url: http://dkan.local + files_path: %paths.base%/files selenium2: wd_host: http://127.0.0.1:4444/wd/hub Drupal\DrupalExtension: @@ -64,3 +72,18 @@ local: drupal_root: '/var/www/dkan/webroot' drush: root: '/var/www/dkan/webroot' +docker: + extensions: + Behat\MinkExtension: + #base_url: http://web + base_url: http://data_starter.local + selenium2: + #wd_host: http://browser:4444/wd/hub + wd_host: http://192.168.10.1:4444/wd/hub + #browser: chrome + browser: firefox + Drupal\DrupalExtension: + drupal: + drupal_root: '/var/www/docroot' + drush: + root: '/var/www/docroot' diff --git a/test/composer.json b/test/composer.json index d34dadb907..7b7bdba552 100644 --- a/test/composer.json +++ b/test/composer.json @@ -1,7 +1,8 @@ { "require": { "drupal/drupal-extension": "~3.0", - "devinci/devinci-behat-extension": "dev-master" + "devinci/devinci-behat-extension": "dev-master", + "nucivic/dkanextension": "dev-master" }, "config": { "bin-dir": "bin/" diff --git a/test/composer.lock b/test/composer.lock index bbc64ed557..24d174ccc2 100644 --- a/test/composer.lock +++ b/test/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" ], - "hash": "6dc2662607a56a5cb563af5006d9e1ca", + "hash": "f1aae08cda2af1c639275ee9ecdcbb4c", "packages": [ { "name": "behat/behat", @@ -480,16 +480,20 @@ "source": { "type": "git", "url": "https://github.com/devinci-code/devinci-behat-extension.git", - "reference": "834136fe8753a898d9ee289bae348461d4577f27" + "reference": "bf79d2cf25981df22ef1f89436f7fb6d6b1425e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/devinci-code/devinci-behat-extension/zipball/834136fe8753a898d9ee289bae348461d4577f27", - "reference": "834136fe8753a898d9ee289bae348461d4577f27", + "url": "https://api.github.com/repos/devinci-code/devinci-behat-extension/zipball/bf79d2cf25981df22ef1f89436f7fb6d6b1425e0", + "reference": "bf79d2cf25981df22ef1f89436f7fb6d6b1425e0", "shasum": "" }, "require": { - "behat/behat": "~3.0" + "behat/behat": "~3.0", + "behat/mink": "~1.5", + "behat/mink-extension": "~2.0", + "behat/mink-goutte-driver": "~1.0", + "behat/mink-selenium2-driver": "~1.1" }, "type": "library", "autoload": { @@ -512,20 +516,20 @@ "Behat", "test" ], - "time": "2015-09-17 08:34:21" + "time": "2015-10-01 20:37:27" }, { "name": "drupal/drupal-driver", - "version": "v1.1.1", + "version": "v1.1.2", "source": { "type": "git", "url": "https://github.com/jhedstrom/DrupalDriver.git", - "reference": "96ebcbbd6d553450c66979fdfd371895d4763231" + "reference": "cc90135ebbf68b92e5bab8993f25c3bb88e93879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jhedstrom/DrupalDriver/zipball/96ebcbbd6d553450c66979fdfd371895d4763231", - "reference": "96ebcbbd6d553450c66979fdfd371895d4763231", + "url": "https://api.github.com/repos/jhedstrom/DrupalDriver/zipball/cc90135ebbf68b92e5bab8993f25c3bb88e93879", + "reference": "cc90135ebbf68b92e5bab8993f25c3bb88e93879", "shasum": "" }, "require": { @@ -563,7 +567,7 @@ "test", "web" ], - "time": "2015-09-02 18:25:27" + "time": "2015-10-06 22:36:27" }, { "name": "drupal/drupal-extension", @@ -732,16 +736,16 @@ }, { "name": "guzzlehttp/promises", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "97fe7210def29451ec74923b27e552238defd75a" + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/97fe7210def29451ec74923b27e552238defd75a", - "reference": "97fe7210def29451ec74923b27e552238defd75a", + "url": "https://api.github.com/repos/guzzle/promises/zipball/b1e1c0d55f8083c71eda2c28c12a228d708294ea", + "reference": "b1e1c0d55f8083c71eda2c28c12a228d708294ea", "shasum": "" }, "require": { @@ -779,7 +783,7 @@ "keywords": [ "promise" ], - "time": "2015-08-15 19:37:21" + "time": "2015-10-15 22:28:00" }, { "name": "guzzlehttp/psr7", @@ -897,6 +901,47 @@ ], "time": "2015-06-15 20:19:33" }, + { + "name": "nucivic/dkanextension", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/NuCivic/dkanextension.git", + "reference": "ab3b02575fc1d3a692c0c61e2f5c10910f34c09a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/NuCivic/dkanextension/zipball/ab3b02575fc1d3a692c0c61e2f5c10910f34c09a", + "reference": "ab3b02575fc1d3a692c0c61e2f5c10910f34c09a", + "shasum": "" + }, + "require": { + "drupal/drupal-extension": "~3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "Drupal\\DKANExtension\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "acouch", + "email": "aaron@nucivic.com" + } + ], + "description": "Provides base DKAN class for Drupal Extension", + "keywords": [ + "drupal", + "test", + "web" + ], + "time": "2015-10-20 22:34:32" + }, { "name": "psr/http-message", "version": "1.0", @@ -1595,7 +1640,8 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "devinci/devinci-behat-extension": 20 + "devinci/devinci-behat-extension": 20, + "nucivic/dkanextension": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/test/features/data_dashboard.feature b/test/features/data_dashboard.feature index 1dd11c322c..7db24af0d3 100644 --- a/test/features/data_dashboard.feature +++ b/test/features/data_dashboard.feature @@ -1,7 +1,7 @@ Feature: Data Dashboard Background: - Given Data Dashboard: + Given data dashboards: | title | | Dashboard 01 | | Dashboard 02 | diff --git a/test/features/dataset.feature b/test/features/dataset.feature index d90af6a1d4..e47df75842 100644 --- a/test/features/dataset.feature +++ b/test/features/dataset.feature @@ -1,38 +1,44 @@ Feature: Datasets + Background: + Given groups: + | title | author | published | + | Group 01 | Admin | Yes | + Given datasets: + | title | author | description | publisher | published | resource format | tags | + | Dataset 01 | admin | Polling places in the state of Wisconsin | Group 01 | Yes | csv | election | + Given resources: + | title | author | description | publisher | published | resource format | dataset | + | Resource 01 | admin | Test resource | Group 01 | Yes | csv | Dataset 01 | + @api Scenario: Sharing the Dataset on Facebook - Given I am on "/dataset/wisconsin-polling-places" + Given I am on "/dataset/dataset-01" When I click "Facebook" Then I should see "Facebook" Scenario: Sharing the Dataset on Twitter - Given I am on "/dataset/wisconsin-polling-places" + Given I am on "/dataset/dataset-01" When I click "Twitter" Then I should see "Share a link with your followers" Scenario: Seeing the License - Given I am on "/dataset/wisconsin-polling-places" - When I click "Creative Commons Attribution" - Then I should see "The Creative Commons Attribution license allows re-distribution and re-use of a licensed work" + Given I am on "/dataset/dataset-01" + Then I should see "License not specified" Scenario: See Users datasets @javascript Scenario: Viewing the Dataset - Given I am on "/dataset/wisconsin-polling-places" + Given I am on "/dataset/dataset-01" Then I should see "Polling places in the state of Wisconsin" And I should see "Explore Data" And I should see "Dataset Info" And I should see "Modified Date" And I should see "Identifier" - When I click "Madison Polling Places" - Then I wait for "This is a list and map of polling places in Madison, WI." - And I wait for "Polling_Places_Madison.csv" - And I wait for "Door Creek Church" - @api @javascript + @api @javascript @fixme Scenario: Create a dataset with a group as an authenticated user Given I am logged in as a user with the "authenticated user" role And I am on "/node/add/group" @@ -69,6 +75,6 @@ Feature: Datasets When I am on "dataset/test-dataset" Then I should see "Edit" And I should see "Add Resource" - When I am on "/dataset/wisconsin-polling-places" + When I am on "/dataset/dataset-01" Then I should not see "Edit" And I should see "Add Resource" diff --git a/test/features/groups.feature b/test/features/groups.feature index b0f42858aa..265062e00b 100644 --- a/test/features/groups.feature +++ b/test/features/groups.feature @@ -3,35 +3,47 @@ Feature: Groups As a website user I need to be able to view the group pages + Background: + Given groups: + | title | author | published | + | Group 01 | Admin | Yes | + Given datasets: + | title | author | description | publisher | published | resource format | tags | + | Dataset 01 | admin | Polling places in the state of Wisconsin | Group 01 | Yes | csv | election | + | Dataset 02 | admin | Afghanistan election districts | Group 01 | Yes | csv | country-afghanistan | + Given resources: + | title | author | description | publisher | published | resource format | dataset | + | Resource 01 | admin | Test resource | Group 01 | Yes | csv | Dataset 01 | + @api @javascript Scenario: Join a group and edit group content as an Authenticated User Given I am logged in as a user with the "authenticated user" role - When I visit "dataset/wisconsin-polling-places" + When I visit "dataset/dataset-01" Then I should not see "edit" - When I click "Madison Polling Places" + When I click "Resource 01" Then I should not see "edit" - Given I am a "member" of the group "Geospatial Data Explorer Examples" - When I visit "dataset/wisconsin-polling-places" + Given I am a "member" of the group "Group 01" + When I visit "dataset/dataset-01" Then I should see "edit" @api @javascript Scenario: Request to join a group as an Auth User Given I am logged in as a user with the "authenticated user" role - When I visit "group/geospatial-data-explorer-examples" + When I visit "group/group-01" And I click "Request group membership" - Then I should see "Are you sure you want to join the group Geospatial Data Explorer Examples?" + Then I should see "Are you sure you want to join the group Group 01?" @api @javascript Scenario: View Groups - Given I am on "/group/geospatial-data-explorer-examples" - Then I should see "Wisconsin Polling Places" - And I should see "Afghanistan Election Districts" + Given I am on "/group/group-01" + Then I should see "Dataset 01" + And I should see "Dataset 02" When I click "country-afghanistan (1)" - Then I should see "Afghanistan Election Districts" - And I should not see "Wisconsin Polling Places" + Then I should see "Dataset 02" + And I should not see "Dataset 01" When I click "country-afghanistan" - Then I should see "Afghanistan Election Districts" - And I should see "Wisconsin Polling Places" + Then I should see "Dataset 02" + And I should see "Dataset 01" @api @javascript Scenario: Manage a group as an Editor diff --git a/test/features/role_storyteller.feature b/test/features/role_storyteller.feature index 378f2aaed3..a1527a5758 100644 --- a/test/features/role_storyteller.feature +++ b/test/features/role_storyteller.feature @@ -1,114 +1,91 @@ - Feature: Testing storyteller role and permissions +Feature: Testing storyteller role and permissions - @api - Scenario: Can see the administration menu - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And I am logged in as "storyteller" - When I am on the homepage - Then I should see the administration menu + @api + Scenario: Can see the administration menu + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And I am logged in as "storyteller" + When I am on the homepage + Then I should see the administration menu - @api - Scenario: Can see administration pages - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And I am logged in as "storyteller" - When I am on "/admin" - Then I should see "Content" + @api + Scenario: Can see administration pages + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And I am logged in as "storyteller" + When I am on "/admin" + Then I should see "Content" - @api - Scenario: Access content overview - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And I am logged in as "storyteller" - When I am on "/admin/content" - Then I should see "About" + @api + Scenario: Access content overview + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And I am logged in as "storyteller" + When I am on "/admin/content" + Then I should see "About" - @api - Scenario: Create Story Content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And I am logged in as "storyteller" - When I am on "/node/add/dkan-data-story" - And I fill in "edit-title" with "DKAN Data Story Test Story Post" - And I fill in "body[und][0][value]" with "Test description" - And I press "Save" - Then I should see "Your DKAN Data Story 'DKAN Data Story Test Story Post' has been created" + @api + Scenario: Create Story Content + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And I am logged in as "storyteller" + When I am on "/node/add/dkan-data-story" + And I fill in "edit-title" with "Test Story Post" + And I fill in "body[und][0][value]" with "Test description" + And I press "Save" + Then I should see "DKAN Data Story 'Test Story Post' has been created" - @api - Scenario: Delete own story content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And "dkan_data_story" content: - | title | author | status | - | DKAN Data Story Test Story Post | storyteller | 1 | - And I am logged in as "storyteller" - When I am on "admin/content" - And I click "delete" - And I press "Delete" - Then I should see "DKAN Data Story Test Story Post has been deleted" + @api + Scenario: Delete own story content + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And data stories: + | title | description | author | status | tags | + | Test Story Post | Test post | storyteller | 1 | election | + And I am logged in as "storyteller" + When I am on "story/test-story-post" + And I click "Edit" + And I press "Delete" + And I press "Delete" + Then I should see "DKAN Data Story Test Story Post has been deleted." - @api - Scenario: Edit own story content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And "dkan_data_story" content: - | title | author | status | - | DKAN Data Story Test Story Post | storyteller | 0 | - And I am logged in as "storyteller" - When I am on "story/dkan-data-story-test-story-post" - When I click "Edit" - And I fill in "body[und][0][value]" with "Test description Update" - And I press "Save" - Then I should see "DKAN Data Story Test Story Post has been updated" + @api + Scenario: Edit own story content + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And data stories: + | title | description | author | status | tags | + | test Story Post | Test post | storyteller | 0 | election | + And I am logged in as "storyteller" + And I am on "story/test-story-post" + When I click "Edit" + And I fill in "body[und][0][value]" with "Test description Update" + And I press "Save" + Then I should see "DKAN Data Story Test Story Post has been updated" - # @api @javascript - # Scenario: Add widget to my story - # Given users: - # | name | mail | status | roles | - # | storyteller | storyteller@test.com | 1 | storyteller | - # And "dkan_data_story" content: - # | title | author | status | - # | DKAN Data Story Test Story Post | storyteller | 0 | - # And I am logged in as "storyteller" - # When I am on "story/dkan-data-story-test-story-post" - # And I wait for "Customize this page" - # And I click "Customize this page" - # And I wait for "Add new pane" - # And I click "Add new pane" - # And I wait for "Please select a category from the left" - # When I click on the text " Add map" - # And I wait for "2" seconds - # And I fill in "field_map_address[und][0][value]" with "175th St, Jamaica, NY 11433, USA" - # And I fill in "field_map_information[und][0][value]" with "map example" - # And I press "Finish" - # And I wait for "2" seconds - # And I press "Save as custom" - # And I wait for "map example" + @api @javascript + Scenario: Use text format filtered_html + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And I am logged in as "storyteller" + When I am on "/node/add/dkan-data-story" + Then I should have an "html" text format option - @api @javascript - Scenario: Use text format filtered_html - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And I am logged in as "storyteller" - When I am on "/node/add/dkan-data-story" - Then I should have an "html" text format option - - @api - Scenario: View own unpublished content - Given users: - | name | mail | status | roles | - | storyteller | storyteller@test.com | 1 | storyteller | - And "dkan_data_story" content: - | title | author | status | - | test Story Post | storyteller | 0 | - And I am logged in as "storyteller" - When I am on "/admin/content" - Then I should see "test Story Post" + @api + Scenario: View own unpublished content + Given users: + | name | mail | status | roles | + | storyteller | storyteller@test.com | 1 | storyteller | + And data stories: + | title | description | author | status | tags | + | test Story Post | Test post | storyteller | 0 | election | + And I am logged in as "storyteller" + When I am on "story/test-story-post" + Then I should see "test Story Post" diff --git a/test/features/test.feature b/test/features/test.feature new file mode 100644 index 0000000000..7f17ae296f --- /dev/null +++ b/test/features/test.feature @@ -0,0 +1,91 @@ +Feature: Test + + @javascript + Scenario: test-submit + Given I am on the homepage + And I wait and press "edit-submit--2" + + @api + Scenario: test-groups + Given users: + | name | mail | status | + | teo | teo@rocks.com | 1 | + Given groups: + | title | author | published | + | Group 01 | Admin | yes | + Given group memberships: + | user | group | role on group | membership status | + | teo | Group 01 | administrator member | Active | + Given I am on "group/group-01" + Then I should see "Group 01" + When I click "Members" + Then I should see "teo" + And I should see "administrator member" + + + @api + Scenario: test-datasets + Given groups: + | title | author | published | + | Group 01 | Admin | Yes | + Given datasets: + | title | author | description | publisher | published | resource format | tags | + | Dataset 01 | admin | Test data collection | Group 01 | Yes | csv | election | + Given I am on "dataset/dataset-01" + Then I should see "Dataset 01" + Given I am on "dataset" + Then I should see a dataset called "Dataset 01" + + @api + Scenario: test-resources + Given groups: + | title | author | published | + | Group 01 | Admin | Yes | + Given datasets: + | title | author | description | publisher | published | resource format | tags | + | Dataset 01 | admin | Test data collection | Group 01 | Yes | csv | election | + | Dataset 02 | admin | Another collection | Group 01 | Yes | csv | election | + Given resources: + | title | author | description | publisher | published | resource format | dataset | + | Resource 01 | admin | Test resource | Group 01 | Yes | csv | Dataset 01 | + Given I am on "dataset/dataset-01" + Then I should see "Resource 01" + + @api + Scenario: test-data-stories + Given data stories: + | title | description | tags | + | Data Story 01 | My story with lots of election data | election | + Given I am on "story/data-story-01" + Then I should see "Data Story 01" + And I should see "election" + + @api + Scenario: test-data-dashboards + Given data dashboards: + | title | + | Data Dashboard 01 | + Given I am on "data-dashboard-01" + Then I should see "Data Dashboard 01" + + @api + Scenario: test-charts + Given groups: + | title | author | published | + | Group 01 | Admin | Yes | + Given datasets: + | title | author | description | publisher | published | resource format | tags | + | Dataset 01 | admin | Test data collection | Group 01 | Yes | csv | election | + Given resources: + | title | author | description | publisher | published | resource format | dataset | + | Resource 01 | admin | Test resource | Group 01 | Yes | csv | Dataset 01 | + # + # TO-DO: add support for feeding in a file to the chart so + # it can properly display data + # + Given charts: + | title | description | resource | + | Chart 01 | Chart of resource 01 data | Resource 01 | + Given I am logged in as a user with the "administrator" role + Given I am on "admin/structure/entity-type/visualization/ve_chart" + Then I should see "Chart 01" \ No newline at end of file