ckanext-datagovtheme has UI tests
User Story
In order to have confidence in UI changes in datagovtheme, data.gov sysadmins want Cypress tests (or other UI tests) implemented in datagovtheme.
Acceptance Criteria
[ACs should be clearly demoable/verifiable whenever possible. Try specifying them using BDD.]
- [ ] GIVEN a change is made to an html page in datagovtheme
WHEN tests are run on datagovtheme
THEN the tests evaluate the UI as a user would
AND errors are reported if the UI is not as expected
Background
We have a lot of UI bugs that have slipped through to production recently. We want to catch these bugs at the source, and not have to create tests at the catalog level that may be incomplete. We already do this for ckanext-dcat_usmetadata.
Security Considerations (required)
None, all code is already public
Sketch
Use cypress examples from catalog, inventory, and ckanext-dcat_usmetadata. Create test cases for key items:
- [ ] bureau filter section shows up as name and not code
- [ ] the dataset page doesn't have "unique Identifier" as "unknown"
- [ ] the dataset page doesn't have "unknown" for contact point when it has the email (maybe default to "email"?)
Should consider using https://playwright.dev/python/docs/test-runners instead of cypress here, to keep everything in python.
Sentiment leans toward Cypress
@Jin-Sun-tts will create an additional related ticket
created issue #4066 to fix the broken CKAN functions in datagovtheme.
Because datagovtheme does not have all dependencies for creating new harvest source from UI function, we just created test datasets from code, the do the cypress UI tests. This may have limits for some tests, but this make datagovtheme only keeps necessary components.