From 0b34244727b0cf220cff73d108ad51f14ccd92d5 Mon Sep 17 00:00:00 2001 From: ThrawnCA Date: Thu, 21 Apr 2022 16:33:45 +1000 Subject: [PATCH 1/3] [QOL-8779] update ckanext-data-qld to fix Squiz compatibility --- test/features/data_qld_theme.feature | 7 +++++++ vars/shared-CKANTest.var.yml | 2 +- vars/shared-OpenData.var.yml | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/test/features/data_qld_theme.feature b/test/features/data_qld_theme.feature index 46980583..1952d939 100644 --- a/test/features/data_qld_theme.feature +++ b/test/features/data_qld_theme.feature @@ -116,3 +116,10 @@ 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 see an element with xpath "//a[@href='/datarequest' and contains(string(), 'Request data')]" + And I should not see "not found" diff --git a/vars/shared-CKANTest.var.yml b/vars/shared-CKANTest.var.yml index 9648424a..5c74c56a 100644 --- a/vars/shared-CKANTest.var.yml +++ b/vars/shared-CKANTest.var.yml @@ -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 }}" diff --git a/vars/shared-OpenData.var.yml b/vars/shared-OpenData.var.yml index 1a07e94f..3ee0003d 100644 --- a/vars/shared-OpenData.var.yml +++ b/vars/shared-OpenData.var.yml @@ -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 }}" From 565f9baed2b86c7ce48e87c273933b367c4037c7 Mon Sep 17 00:00:00 2001 From: ThrawnCA Date: Thu, 21 Apr 2022 16:34:15 +1000 Subject: [PATCH 2/3] [QOL-8779] sync tests from comments repo and Geoscience harvester --- test/features/comments.feature | 10 +++++----- test/features/config.feature | 8 +++++++- test/features/search_facets.feature | 7 +++++++ test/features/steps/steps.py | 31 +++++++++++++++++++++-------- 4 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 test/features/search_facets.feature diff --git a/test/features/comments.feature b/test/features/comments.feature index cf3da183..a616f86a 100644 --- a/test/features/comments.feature +++ b/test/features/comments.feature @@ -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')]" @@ -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 diff --git a/test/features/config.feature b/test/features/config.feature index 798741b4..be743645 100644 --- a/test/features/config.feature +++ b/test/features/config.feature @@ -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" diff --git a/test/features/search_facets.feature b/test/features/search_facets.feature new file mode 100644 index 00000000..a16bbe5e --- /dev/null +++ b/test/features/search_facets.feature @@ -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')]" diff --git a/test/features/steps/steps.py b/test/features/steps/steps.py index df69a29f..a0c59421 100644 --- a/test/features/steps/steps.py +++ b/test/features/steps/steps.py @@ -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)) @@ -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""" From 2a8ba6dd29b86edd4f85d91e1d19cafdd0384376 Mon Sep 17 00:00:00 2001 From: antuarc Date: Fri, 22 Apr 2022 10:13:14 +1000 Subject: [PATCH 3/3] [QOL-8779] oops don't assert datarequest link in the header for Publications --- test/features/data_qld_theme.feature | 1 - 1 file changed, 1 deletion(-) diff --git a/test/features/data_qld_theme.feature b/test/features/data_qld_theme.feature index 1952d939..15a05a7f 100644 --- a/test/features/data_qld_theme.feature +++ b/test/features/data_qld_theme.feature @@ -121,5 +121,4 @@ Feature: Theme customisations 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 see an element with xpath "//a[@href='/datarequest' and contains(string(), 'Request data')]" And I should not see "not found"