From 62d3f49c21e23feb6403d3ed4eb109456bf0e7e8 Mon Sep 17 00:00:00 2001 From: ThrawnCA Date: Mon, 15 Jul 2024 11:36:08 +1000 Subject: [PATCH] [QOLDEV-915] add scenario test for upgrading CSV usability rating on valid schema --- test/features/data_usability_rating.feature | 10 ++++++++++ test/fixtures/csv_resource_with_schema.csv | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 test/fixtures/csv_resource_with_schema.csv diff --git a/test/features/data_usability_rating.feature b/test/features/data_usability_rating.feature index 93b4901b..c8de02a5 100644 --- a/test/features/data_usability_rating.feature +++ b/test/features/data_usability_rating.feature @@ -20,3 +20,13 @@ Feature: Data usability rating | CSV | csv_resource.csv | 3 | | JSON | json_resource.json | 3 | | RDF | rdf_resource.rdf | 4 | + + Scenario: As a publisher, when I create an open resource with a matching schema, I can verify the score is upgraded from 3 to 4 + Given "TestOrgEditor" as the persona + When I log in + And I create a dataset and resource with key-value parameters "license=other-open" and "format=CSV::upload=csv_resource_with_schema.csv::schema_upload=test-resource_schemea.json" + And I press the element with xpath "//ol[contains(@class, 'breadcrumb')]//a[starts-with(@href, '/dataset/')]" + And I reload page every 3 seconds until I see an element with xpath "//div[contains(@class, 'qa') and contains(@class, 'openness-')]" but not more than 10 times + Then I should see an element with xpath "//div[contains(@class, 'openness-4')]" + When I press "Test Resource" + Then I should see an element with xpath "//div[contains(@class, 'qa openness-4')]" diff --git a/test/fixtures/csv_resource_with_schema.csv b/test/fixtures/csv_resource_with_schema.csv new file mode 100644 index 00000000..4da688c9 --- /dev/null +++ b/test/fixtures/csv_resource_with_schema.csv @@ -0,0 +1,2 @@ +id,location,date,measurement,observations +1,A,01/01/1970,12345,"Lorem ipsum"