Skip to content

Commit

Permalink
Merge pull request #229 from qld-gov-au/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
ThrawnCA authored Apr 22, 2022
2 parents 75dc2ec + 2250d68 commit 38dc74e
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 16 deletions.
10 changes: 5 additions & 5 deletions test/features/comments.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ Feature: Comments
Scenario: The Add Comment form should not display for a non-logged-in user - instead they see a 'Login to comment' button
Given "Unauthenticated" as the persona
When I go to dataset "warandpeace" comments
Then I should see an element with xpath "//a[contains(string(), 'Login to comment')]"
And I should not see "Add a comment"
Then I should see "Login to comment" within 1 seconds
And I should not see the add comment form

Scenario: Logged-in users see the add comment form
Given "CKANUser" as the persona
When I log in
Then I go to dataset "warandpeace" comments
Then I should see an element with xpath "//h3[contains(string(), 'Add a comment')]"
Then I should see the add comment form

@comment-add
Scenario: When a logged-in user submits a comment on a Dataset the comment should display within 10 seconds
Given "CKANUser" as the persona
When I log in
Then I go to dataset "warandpeace" comments
Then I should see an element with xpath "//h3[contains(string(), 'Add a comment')]"
Then I should see the add comment form
Then I submit a comment with subject "Test subject" and comment "This is a test comment"
Then I should see "This is a test comment" within 10 seconds
And I should see an element with xpath "//div[contains(@class, 'comment-wrapper') and contains(string(), 'This is a test comment')]"
Expand Down Expand Up @@ -49,7 +49,7 @@ Feature: Comments
Given "CKANUser" as the persona
When I log in
Then I go to dataset "warandpeace" comments
Then I should see an element with xpath "//h3[contains(string(), 'Add a comment')]"
Then I should see the add comment form
Then I submit a comment with subject "Test subject" and comment "sex"
Then I should see "sex" within 10 seconds

Expand Down
8 changes: 7 additions & 1 deletion test/features/config.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,11 @@ Feature: Config
Scenario: Assert that Data Request configuration values are available
Given "SysAdmin" as the persona
When I log in and go to admin config page
Then I should see "Suggested Description"
Then I should see "Data Request Suggested Description"
And I should see an element with id "field-ckanext.data_qld.datarequest_suggested_description"
And I should see "Data Request Closing Circumstances"
And I should see an element with id "field-ckan.datarequests.closing_circumstances"
And I should see "Comments - custom profanity list (one word per line)"
And I should see an element with id "field-ckan-comments-profanity-list"
And I should see "Resource formats"
And I should see an element with id "field-ckanext.data_qld.resource_formats"
6 changes: 6 additions & 0 deletions test/features/data_qld_theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,9 @@ Feature: Theme customisations
When I go to "/nonexistent"
Then I should see an element with xpath "//div[contains(string(), 'was not found') or contains(string(), 'could not be found')]"
And I should not see "Sorry, the page you were looking for could not be found."

Scenario: When I go to the header URL, I can see the list of necessary assets
When I go to "/header.html"
Then I should see an element with xpath "//a[@href='/user/login' and contains(string(), 'Log in')]"
And I should see an element with xpath "//a[@href='/user/register' and contains(string(), 'Register')]"
And I should not see "not found"
7 changes: 7 additions & 0 deletions test/features/search_facets.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@OpenData
Feature: Search facets

Scenario: When I go to the dataset list page, I can see the 'Data Portals' facet
When I go to "/dataset"
Then I should see "Data Portals"
And I should see an element with xpath "//a[contains(@href, '?dataset_type=dataset')]/span[contains(@class, 'item-label') and contains(string(), 'data.qld.gov.au')]"
31 changes: 23 additions & 8 deletions test/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,29 @@ def go_to_dataset(context, name):
when_i_visit_url(context, '/dataset/' + name)


@step(u'I go to dataset "{name}" comments')
def go_to_dataset_comments(context, name):
context.execute_steps(u"""
When I go to dataset "%s"
And I click the link with text that contains "Comments"
""" % (name))


@step(u'I should see the add comment form')
def comment_form_visible(context):
context.execute_steps(u"""
Then I should see an element with xpath "//textarea[@name='comment']"
""")


@step(u'I should not see the add comment form')
def comment_form_not_visible(context):
context.execute_steps(u"""
Then I should not see an element with xpath "//input[@name='subject']"
And I should not see an element with xpath "//textarea[@name='comment']"
""")


@step(u'I edit the "{name}" dataset')
def edit_dataset(context, name):
when_i_visit_url(context, '/dataset/edit/{}'.format(name))
Expand Down Expand Up @@ -204,14 +227,6 @@ def go_to_reporting_page(context):
when_i_visit_url(context, '/dashboard/reporting')


@step(u'I go to dataset "{name}" comments')
def go_to_dataset_comments(context, name):
context.execute_steps(u"""
When I go to dataset "%s"
And I click the link with text that contains "Comments"
""" % (name))


@step(u'I go to data request "{subject}"')
def go_to_data_request(context, subject):
context.execute_steps(u"""
Expand Down
2 changes: 1 addition & 1 deletion vars/shared-CKANTest.var.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extensions:
description: "CKAN Extension for Queensland Government Open Data"
type: "git"
url: "https://github.com/qld-gov-au/ckanext-data-qld.git"
version: "6.0.4"
version: "6.0.5"

CKANExtODICertificates: &CKANExtODICertificates
name: "ckanext-odi-certificates-{{ Environment }}"
Expand Down
2 changes: 1 addition & 1 deletion vars/shared-OpenData.var.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extensions:
description: "CKAN Extension for Queensland Government Open Data"
type: "git"
url: "https://github.com/qld-gov-au/ckanext-data-qld.git"
version: "6.0.4"
version: "6.0.5"

CKANExtODICertificates: &CKANExtODICertificates
name: "ckanext-odi-certificates-{{ Environment }}"
Expand Down

0 comments on commit 38dc74e

Please sign in to comment.