Skip to content

Commit

Permalink
[QOLDEV-312] make test datasets public by default
Browse files Browse the repository at this point in the history
- Private datasets can't be accessed by job workers on CKAN 2.10 without setting up a token, which is tricky to do in tests,
so just make them public for now
  • Loading branch information
ThrawnCA committed Sep 1, 2023
1 parent d162631 commit 09d4cbb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion test/features/data_qld_theme.feature
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Feature: Theme customisations
Scenario: As a publisher, when I create a resource with an API entry, I can download it in various formats
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "license=other-open::private=False" and "format=CSV::upload=csv_resource.csv"
And I create a dataset and resource with key-value parameters "license=other-open" and "format=CSV::upload=csv_resource.csv"
And I wait for 10 seconds
And I press "Test Resource"
Then I should see an element with xpath "//a[contains(string(), 'Data API')]"
Expand Down
8 changes: 4 additions & 4 deletions test/features/resource_availability.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Re-identification risk governance acknowledgement or Resource visibilit
Scenario: As a publisher, I can view hidden resources
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "name=package-with-invisible-resource::notes=Package with invisible resource::de_identified_data=NO::private=False" and "name=invisible-resource::resource_visible=FALSE"
And I create a dataset and resource with key-value parameters "name=package-with-invisible-resource::notes=Package with invisible resource::de_identified_data=NO" and "name=invisible-resource::resource_visible=FALSE"
Then I should see "invisible-resource"
And I should see "HIDDEN"
When I press "invisible-resource"
Expand All @@ -23,7 +23,7 @@ Feature: Re-identification risk governance acknowledgement or Resource visibilit
Scenario: As an unprivileged user, I cannot see resources with privacy assessment requested and risk governance completed
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "name=package-with-assessed-resource::notes=Package with assessed resource::de_identified_data=NO::private=False" and "name=resource-for-assessment::request_privacy_assessment=YES::governance_acknowledgement=YES::resource_visible=TRUE"
And I create a dataset and resource with key-value parameters "name=package-with-assessed-resource::notes=Package with assessed resource::de_identified_data=NO" and "name=resource-for-assessment::request_privacy_assessment=YES::governance_acknowledgement=YES::resource_visible=TRUE"
Then I should see "resource-for-assessment"

Given "CKANUser" as the persona
Expand All @@ -35,7 +35,7 @@ Feature: Re-identification risk governance acknowledgement or Resource visibilit
Scenario: As an unprivileged user, I can see de-identified resources marked as visible without a privacy assessment
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "name=de-identified-package-with-unassessed-resource::de_identified_data=YES::private=False" and "name=visible-resource::request_privacy_assessment=NO::governance_acknowledgement=YES::resource_visible=TRUE"
And I create a dataset and resource with key-value parameters "name=de-identified-package-with-unassessed-resource::de_identified_data=YES" and "name=visible-resource::request_privacy_assessment=NO::governance_acknowledgement=YES::resource_visible=TRUE"

Given "CKANUser" as the persona
When I log out
Expand Down Expand Up @@ -94,7 +94,7 @@ Feature: Re-identification risk governance acknowledgement or Resource visibilit
Scenario: As an anonymous user, I can see resources without de-identified data
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "name=package-without-de-identified-data::de_identified_data=NO::private=False" and "name=visible-resource::governance_acknowledgement=NO::resource_visible=TRUE"
And I create a dataset and resource with key-value parameters "name=package-without-de-identified-data::de_identified_data=NO" and "name=visible-resource::governance_acknowledgement=NO::resource_visible=TRUE"

When I log out
And I go to dataset "package-without-de-identified-data"
Expand Down
6 changes: 3 additions & 3 deletions test/features/schema_generation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Feature: Schema Generation
Scenario: As a publisher, when I visit my resource, I can generate a validation schema for it
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "notes=package-with-csv-res::schema_json=default::private=False" and "upload=default::format=CSV"
And I create a dataset and resource with key-value parameters "notes=package-with-csv-res::schema_json=default" and "upload=default::format=CSV"
And I take a debugging screenshot
And I go to the first resource in the dataset
And I take a debugging screenshot
Expand Down Expand Up @@ -44,7 +44,7 @@ Feature: Schema Generation
Scenario: System actions following the selection of the set as dataset default dropdown option on the manage data schema GUI page
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "notes=apply-for-dataset-schema::schema_json=default::private=False" and "upload=default::format=CSV"
And I create a dataset and resource with key-value parameters "notes=apply-for-dataset-schema::schema_json=default" and "upload=default::format=CSV"
And I go to the first resource in the dataset
And I reload page every 3 seconds until I see an element with xpath "//*[string() = 'Data Dictionary']" but not more than 6 times
And I visit resource schema generation page
Expand All @@ -60,7 +60,7 @@ Feature: Schema Generation
Scenario: System actions following the selection of the validate only this resource dropdown option on the manage data schema GUI page
Given "TestOrgEditor" as the persona
When I log in
And I create a dataset and resource with key-value parameters "notes=apply-for-resource-schema::schema_json=default::private=False" and "upload=default::format=CSV"
And I create a dataset and resource with key-value parameters "notes=apply-for-resource-schema::schema_json=default" and "upload=default::format=CSV"
And I go to the first resource in the dataset
And I reload page every 3 seconds until I see an element with xpath "//*[string() = 'Data Dictionary']" but not more than 6 times
And I visit resource schema generation page
Expand Down
2 changes: 2 additions & 0 deletions test/features/steps/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ def _create_dataset_from_params(context, params):
When I visit "/dataset/new"
And I fill in default dataset fields
""")
if 'private' not in params:
params = params + "::private=False"
for key, value in _parse_params(params):
if key == "name":
# 'name' doesn't need special input, but we want to remember it
Expand Down

0 comments on commit 09d4cbb

Please sign in to comment.