Skip to content

Commit

Permalink
add activity stream tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ThrawnCA committed Sep 20, 2024
1 parent c52fe75 commit 8f303e8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
4 changes: 3 additions & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ CKAN_GIT_ORG=ckan

if [ "$CKAN_VERSION" = "2.10" ]; then
if [ "$CKAN_TYPE" = "custom" ]; then
CKAN_GIT_VERSION=ckan-2.10.3-qgov.3
CKAN_GIT_VERSION=ckan-2.10.5-qgov.1
CKAN_GIT_ORG=qld-gov-au
else
CKAN_GIT_VERSION=ckan-2.10.5
fi

PYTHON_VERSION=py3
Expand Down
19 changes: 19 additions & 0 deletions test/features/datasets.feature
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@dataset
Feature: Dataset APIs

Scenario: Creative Commons BY-NC-SA 4.0 licence is an option for datasets
Expand All @@ -6,3 +7,21 @@ Feature: Dataset APIs
And I edit the "test-dataset" dataset
Then I should see an element with xpath "//option[@value='cc-by-nc-sa-4']"

Scenario: As a publisher, I can view the change history of a dataset
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "notes=Testing activity stream" and "name=Test"
And I press the element with xpath "//a[contains(@href, '/dataset/activity/') and contains(string(), 'Activity Stream')]"
Then I should see "created the dataset"
When I press "View this version"
Then I should see "You're currently viewing an old version of this dataset."

When I go back
And I press "Changes"
Then I should see "View changes from"
And I should see an element with xpath "//select[@name='old_id']"
And I should see an element with xpath "//select[@name='new_id']"

When I go back
And I press the element with xpath "//li[contains(@class, 'new-package')]/preceding-sibling::li[1]//a[contains(string(), 'Changes')]"
Then I should see "Added resource"
5 changes: 4 additions & 1 deletion test/features/organisations.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@users
@organisations
Feature: Organization APIs

Scenario Outline: Organisation membership is accessible to admins of the organisation
Expand Down Expand Up @@ -37,6 +37,9 @@ Feature: Organization APIs
Then I should see "Test Organisation"
And I should not see an element with xpath "//a[contains(@href, '?action=read')]"
And I should see an element with xpath "//a[contains(@href, '/organization/test-organisation')]"
When I press "Test Organisation"
And I press "Activity Stream"
Then I should see "created the org"

When I view the "test-organisation" organisation API "not including" users
Then I should see an element with xpath "//*[contains(string(), '"success": true') and contains(string(), '"name": "test-organisation"')]"

0 comments on commit 8f303e8

Please sign in to comment.