Skip to content

Commit

Permalink
Merge pull request #245 from qld-gov-au/develop
Browse files Browse the repository at this point in the history
Develop to master
  • Loading branch information
ThrawnCA authored Jun 1, 2022
2 parents a495f57 + ca53e3b commit d90cf36
Show file tree
Hide file tree
Showing 13 changed files with 127 additions and 26 deletions.
8 changes: 1 addition & 7 deletions .docker/test-Publications.ini
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ckan.redis.url = redis://redis:6379
# Add ``datapusher`` to enable DataPusher
# Add ``resource_proxy`` to enable resource proxying and get around the
# same origin policy
ckan.plugins = stats text_view image_view recline_view publications_qld_theme qgovext csrf_filter resource_type_validation
ckan.plugins = stats text_view image_view recline_view publications_qld_theme qgovext csrf_filter resource_type_validation ssm_config

# Define which views should be created by default
# (plugins must be loaded in ckan.plugins)
Expand Down Expand Up @@ -171,12 +171,6 @@ ckan.hide_activity_from_users = %(ckan.site_id)s
smtp.test_server = localhost:8025
smtp.mail_from = [email protected]

## Harvester settings
ckan.harvest.mq.type = redis
ckan.harvest.mq.hostname = redis
ckan.harvest.mq.port = 6379
ckan.harvest.mq.redis_db = 0

## Logging configuration
[loggers]
keys = root, ckan, ckanext
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

- name: Test
run: .circleci/test.sh
timeout-minutes: 35
timeout-minutes: 40

- name: Retrieve screenshots
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Test
run: .circleci/test.sh
timeout-minutes: 35
timeout-minutes: 40

- name: Retrieve screenshots
if: failure()
Expand Down
84 changes: 84 additions & 0 deletions test/features/google_analytics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,87 @@ Feature: GoogleAnalytics
And I click the link with text that contains "A Novel By Tolstoy"
And I click the link with text that contains "Full text"
Then I should see an element with xpath "//meta[@name='DCTERMS.creator' and @content='c=AU; o=The State of Queensland; ou=Test Organisation' and @scheme='AGLSTERMS.GOLD']"

@Publications
Scenario: When viewing the HTML source code of a group, the appropriate metadata is visible
When I go to group page
And I resize the browser to 1024x2048
Then I should see an element with xpath "//meta[@name='DCTERMS.title' and @content='Groups']"
And I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.creator' and @content='c=AU; o=The State of Queensland;' and @scheme='AGLSTERMS.GOLD']"
And I should see an element with xpath "//meta[@name='DCTERMS.description' and @content='List of all groups']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
And I should see an element with xpath "//meta[@name='AGLSTERMS.documentType' and @content='index']"

When I click the link with text that contains "Dave's books"
And I click the link with text that contains "About"
Then I should see an element with xpath "//meta[@name='DCTERMS.title' and contains(@content, 'Dave')]"
And I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.creator' and contains(@content, 'c=AU; o=The State of Queensland; ou=Dave') and @scheme='AGLSTERMS.GOLD']"
And I should see an element with xpath "//meta[@name='DCTERMS.created' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.description' and @content='These are books that David likes.']"
And I should see an element with xpath "//meta[@name='DCTERMS.identifier' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
And I should see an element with xpath "//meta[@name='AGLSTERMS.documentType' and @content='guidelines']"

@Publications
Scenario: When viewing the HTML source code of an organisation, the appropriate metadata is visible
When I go to organisation page
And I resize the browser to 1024x2048
Then I should see an element with xpath "//meta[@name='DCTERMS.title' and @content='Organisations']"
And I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.creator' and @content='c=AU; o=The State of Queensland;' and @scheme='AGLSTERMS.GOLD']"
And I should see an element with xpath "//meta[@name='DCTERMS.description' and @content='List of all organisations']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
And I should see an element with xpath "//meta[@name='AGLSTERMS.documentType' and @content='index']"

When I click the link with text that contains "Department of Health"
And I click the link with text that contains "About"
Then I should see an element with xpath "//meta[@name='DCTERMS.title' and @content='Department of Health']"
And I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.creator' and @content='c=AU; o=The State of Queensland; ou=Department of Health' and @scheme='AGLSTERMS.GOLD']"
And I should see an element with xpath "//meta[@name='DCTERMS.created' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.description' and @content='Department of Health']"
And I should see an element with xpath "//meta[@name='DCTERMS.identifier' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
And I should see an element with xpath "//meta[@name='AGLSTERMS.documentType' and @content='guidelines']"

@Publications
Scenario: When viewing the HTML source code of a resource, the appropriate metadata is visible
When I go to Dataset page
And I resize the browser to 1024x2048
Then I should see an element with xpath "//meta[@name='DCTERMS.title' and @content='Datasets']"
And I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.creator' and @content='c=AU; o=The State of Queensland;' and @scheme='AGLSTERMS.GOLD']"
And I should see an element with xpath "//meta[@name='DCTERMS.description' and @content='List of all datasets']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
And I should see an element with xpath "//meta[@name='AGLSTERMS.documentType' and @content='index']"

When I click the link with text that contains "A Novel By Tolstoy"
Then I should see an element with xpath "//meta[@name='DCTERMS.title' and @content='A Novel By Tolstoy']"
And I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.creator' and @content='c=AU; o=The State of Queensland; ou=Test Organisation' and @scheme='AGLSTERMS.GOLD']"
And I should see an element with xpath "//meta[@name='DCTERMS.created' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.modified' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.description' and contains(@content, 'Some bolded text.')]"
And I should see an element with xpath "//meta[@name='DCTERMS.identifier' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
And I should see an element with xpath "//meta[@name='AGLSTERMS.documentType' and @content='index']"

When I click the link with text that contains "Full text"
Then I should see an element with xpath "//meta[@name='DCTERMS.title' and @content='Full text']"
And I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.creator' and @content='c=AU; o=The State of Queensland; ou=Test Organisation' and @scheme='AGLSTERMS.GOLD']"
And I should see an element with xpath "//meta[@name='DCTERMS.created' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.modified' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.description' and contains(@content, 'Full text. Needs escaping')]"
And I should see an element with xpath "//meta[@name='DCTERMS.identifier' and @content != '' and @content != 'None']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
And I should see an element with xpath "//meta[@name='AGLSTERMS.documentType' and @content='dataset']"
9 changes: 8 additions & 1 deletion test/features/homepage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,11 @@ Feature: Homepage
@homepage
Scenario: Smoke test to ensure Homepage is accessible
When I go to homepage
Then I take a screenshot
Then I take a screenshot

@Publications
Scenario: Homepage has Dublin Core metadata
When I go to homepage
Then I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
8 changes: 8 additions & 0 deletions test/features/login.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ Feature: Login
Given "SysAdmin" as the persona
When I log in
Then I take a screenshot

@Publications
Scenario: Dashboard has Dublin Core metadata
Given "SysAdmin" as the persona
When I log in
Then I should see an element with xpath "//meta[@name='DCTERMS.publisher' and @content='corporateName=The State of Queensland; jurisdiction=Queensland' and @scheme='AGLSTERMS.AglsAgent']"
And I should see an element with xpath "//meta[@name='DCTERMS.jurisdiction' and @content='Queensland' and @scheme='AGLSTERMS.AglsJuri']"
And I should see an element with xpath "//meta[@name='DCTERMS.type' and @content='Text' and @scheme='DCTERMS.DCMIType']"
12 changes: 6 additions & 6 deletions test/features/login_redirect.feature
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Feature: Login Redirection
Scenario: As a Sysadmin I set the visibility of a public record to private for the following scenarios
Given "SysAdmin" as the persona
When I log in
Then I visit "/dataset/edit/annakarenina"
Then I visit "/dataset/edit/test-dataset"
When I select "True" from "private"
And I fill in "author_email" with "[email protected]"
And I press "Update Dataset"
Expand All @@ -35,7 +35,7 @@ Feature: Login Redirection
@private_dataset
Scenario: As an unauthenticated user, when I visit the URL of a private dataset I see the login page
Given "Unauthenticated" as the persona
When I visit "/dataset/annakarenina"
When I visit "/dataset/test-dataset"
Then I should see a login link

@public_dataset
Expand All @@ -48,16 +48,16 @@ Feature: Login Redirection
@private_dataset
Scenario: As an unauthenticated organisation member, when I visit the URL of a private dataset I see the login page. Upon logging in I am taken to the private dataset
Given "TestOrgMember" as the persona
When I visit "/dataset/annakarenina"
When I visit "/dataset/test-dataset"
Then I should see a login link
When I log in directly
Then I should see an element with xpath "//h1[contains(string(), 'A Novel By Tolstoy')]"
Then I should see an element with xpath "//h1[contains(string(), 'test-dataset')]"
And I should see an element with xpath "//span[contains(string(), 'Private')]"

@private_dataset
Scenario: As an authenticated organisation member, when I visit the URL of a dataset private to my organisation I am taken to the private dataset
Given "TestOrgMember" as the persona
When I log in
Then I visit "/dataset/annakarenina"
Then I should see an element with xpath "//h1[contains(string(), 'A Novel By Tolstoy')]"
Then I visit "/dataset/test-dataset"
Then I should see an element with xpath "//h1[contains(string(), 'test-dataset')]"
And I should see an element with xpath "//span[contains(string(), 'Private')]"
2 changes: 1 addition & 1 deletion test/features/organisations.feature
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Feature: Organization APIs
Then I should see an element with xpath "//*[contains(string(), '"success": false,') and contains(string(), 'Authorization Error')]"

Scenario: Organisation overview is accessible to everyone
When I go to "/organization"
When I go to organisation page
Then I should see "Department of Health"
When I view the "department-of-health" organisation API "not including" users
Then I should see an element with xpath "//*[contains(string(), '"success": true,') and contains(string(), '"name": "department-of-health"')]"
8 changes: 8 additions & 0 deletions test/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,11 @@ def edit_dataset(context, name):
when_i_visit_url(context, '/dataset/edit/{}'.format(name))


@step(u'I go to group page')
def go_to_group_page(context):
when_i_visit_url(context, '/group')


@step(u'I go to organisation page')
def go_to_organisation_page(context):
when_i_visit_url(context, '/organization')
Expand Down Expand Up @@ -244,6 +249,9 @@ def log_out(context):
when_i_visit_url(context, '/user/logout')


# ckanext-data-qld


@step(u'I create resource_availability test data with title:"{title}" de_identified_data:"{de_identified_data}" resource_name:"{resource_name}" resource_visible:"{resource_visible}" governance_acknowledgement:"{governance_acknowledgement}"')
def create_dataset_resource_availability(context, title, de_identified_data, resource_name, resource_visible, governance_acknowledgement):
assert context.persona
Expand Down
2 changes: 1 addition & 1 deletion vars/CKAN-Stack.var.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ common_stack: &common_stack
EnableDataStore: "{{ enable_datastore | default('no') }}"
SSMKey: "{{ SSMKey | default('') }}"
DefaultEC2Key: "{{ lookup('aws_ssm', '/config/CKAN/ec2KeyPair', region=region) }}"
CookbookRevision: "{{ CookbookRevision | default('5.2.12') }}"
CookbookRevision: "{{ CookbookRevision | default('5.2.13') }}"
LogBucketName: "{{ lookup('aws_ssm', '/config/CKAN/s3LogsBucket', region=region) }}"
AttachmentsBucketName: "{{ lookup('aws_ssm', '/config/CKAN/' + Environment + '/app/' + service_name_lower + '/s3AttachmentBucket', region=region) }}" #/config/CKAN/PROD/app/opendata/s3AttachmentBucket
SolrSource: "{{ solr7 }}"
Expand Down
6 changes: 3 additions & 3 deletions vars/shared-CKANTest.var.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extensions:
description: "CKAN Extension for Queensland Government Open Data"
type: "git"
url: "https://github.com/qld-gov-au/ckan-ex-qgov.git"
version: "4.0.2"
version: "5.0.0"

CKANExtS3Filestore: &CKANExtS3Filestore
name: "ckanext-s3filestore-{{ Environment }}"
Expand All @@ -47,7 +47,7 @@ extensions:
description: "CKAN Extension for DCAT"
type: "git"
url: "https://github.com/ckan/ckanext-dcat.git"
version: "v0.0.9"
version: "v1.1.3"

CKANExtScheming: &CKANExtScheming
name: "ckanext-scheming-{{ Environment }}"
Expand All @@ -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.1.0"
version: "6.2.0"

CKANExtODICertificates: &CKANExtODICertificates
name: "ckanext-odi-certificates-{{ Environment }}"
Expand Down
6 changes: 3 additions & 3 deletions vars/shared-OpenData.var.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ extensions:
description: "CKAN Extension for Queensland Government Open Data"
type: "git"
url: "https://github.com/qld-gov-au/ckan-ex-qgov.git"
version: "4.0.2"
version: "5.0.0"

CKANExtS3Filestore: &CKANExtS3Filestore
name: "ckanext-s3filestore-{{ Environment }}"
Expand All @@ -47,7 +47,7 @@ extensions:
description: "CKAN Extension for DCAT"
type: "git"
url: "https://github.com/ckan/ckanext-dcat.git"
version: "v0.0.9"
version: "v1.1.3"

CKANExtScheming: &CKANExtScheming
name: "ckanext-scheming-{{ Environment }}"
Expand All @@ -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.1.0"
version: "6.2.0"

CKANExtODICertificates: &CKANExtODICertificates
name: "ckanext-odi-certificates-{{ Environment }}"
Expand Down
4 changes: 2 additions & 2 deletions vars/shared-Publications.var.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ extensions:
description: "CKAN Extension for Queensland Government sites"
type: "git"
url: "https://github.com/qld-gov-au/ckan-ex-qgov.git"
version: "4.0.2"
version: "5.0.0"

CKANExtS3Filestore: &CKANExtS3Filestore
name: "ckanext-s3filestore-{{ Environment }}"
Expand All @@ -38,7 +38,7 @@ extensions:
type: "git"
description: "CKAN Extension for Queensland Government Publications theme"
url: "https://github.com/qld-gov-au/ckanext-publications-qld-theme.git"
version: "1.1.0"
version: "1.1.2"

CKANExtResourceTypeValidation: &CKANExtResourceTypeValidation
name: "ckanext-resource-type-validation-{{ Environment }}"
Expand Down

0 comments on commit d90cf36

Please sign in to comment.