Skip to content

feat: add expanded suite of tests - #3

Merged
ashmanda-cs merged 38 commits into
gdcc:mainfrom
uncch-rdmc:main
Sep 17, 2026
Merged

ashmanda-cs merged 38 commits into
gdcc:mainfrom
uncch-rdmc:main

Conversation

@ashmanda-cs

@ashmanda-cs ashmanda-cs commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

ashmanda-cs and others added 15 commits August 31, 2026 10:48
Permissions (assign + remove role) apply to both the standard UNC
instance and the 21 CFR Part 11 instance. Tagging with both suites
avoids a duplicate test file while giving full coverage.

Co-Authored-By: Claude <noreply@anthropic.com>
Extends the template test with two previously uncovered checklist items:
- Make Default: clicks the 'Make Default' anchor scoped to the target row,
  asserts the success banner
- Clone: clicks the 'Copy' anchor, saves the pre-filled form, asserts the
  clone name appears in the table

All actions are scoped to the timestamped template name so the test is
safe to run alongside existing templates in the dataverse. Cleanup
deletes only the two templates created by this run.

Also tags the test @standard (in addition to @21cfr) since dataset
templates are a standard-instance feature too.

Co-Authored-By: Claude <noreply@anthropic.com>
Adds synthesised test data files covering every format the checklist
exercises:

  sample-data.csv          tabular data (5 rows, used for Data Explorer)
  demo-code.R              R analysis script
  ro-crate-metadata.json   RO-Crate 1.1 metadata document
  demo-document.pdf        minimal valid PDF 1.4
  demo-data.xlsx           minimal valid XLSX (zipped XML, 3-column table)
  demo-archive.zip         ZIP containing a readme and a CSV
  demo-double-archive.zip  ZIP containing a nested ZIP
  demo-geo.zip             ZIP containing a GeoJSON (NC Research Triangle)
  demo-data.dta            Stata 118 format (minimal, 1 variable, 0 obs)
  demo-data.RData          R serialisation format v2 XDR (NULL object)
  demo-data.sav            SPSS SAV with correct magic bytes and terminator

All files are generated from scratch with Python's stdlib; no external
tools or licenses required.

Co-Authored-By: Claude <noreply@anthropic.com>
Creates a timestamped guestbook with all four account-info fields
required and a multiple-choice custom question (two options). Verifies
the guestbook is created, downloads the all-responses CSV and asserts
the filename is non-null, then deletes the guestbook.

Column-level CSV verification is deferred — see backlog.

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Data Explorer and File Previewer require a cloak function from a
separate repository with a different suite config. Not testable against
the current target instance until that integration is available.

Co-Authored-By: Claude <noreply@anthropic.com>
- Scaffold tests/regression/ project with tsconfig.json
- Add regression-state.ts helper (persists template name and custom terms
  to .regression-template-name and .regression-custom-terms)
- Implement dataset-creation-default-custom-license.spec.ts (22 steps):
    * Create dataset template with unique timestamped name
    * Populate Title, Author, Contact Email, Description, Subject
    * Set Custom Dataset Terms license with All Rights Reserved ToU
    * Make template the collection default
    * Create new dataset and verify it inherits the template title
    * Verify Terms tab shows Custom Dataset Terms and exact ToU text
    * Unset the template default
- Register regression-{chromium,firefox,webkit} projects in playwright.config.ts
  each depending on its own regression-setup-* auth project
- Add .regression-template-name and .regression-custom-terms to .gitignore
- 18-file-upload-formats.spec.ts — non-ingest formats (.csv, .zip, .pdf,
  .R, ro-crate-metadata.json); passing
- 19-file-upload-tabular.spec.ts — tabular ingest formats (.dta, .RData,
  .sav, .xlsx); failing due to known ingest bug, test is intentionally
  kept as a regression detector
- Both specs wait for filenames to appear in the staging area before
  saving, plus a 10s buffer for background ingest processing
…#81, #99, #100)

- 20-preview-url.spec.ts:
    * Creates a fresh unpublished dataset
    * Opens Edit Dataset -> Preview URL via stable IDs
    * Creates General Preview URL, reads token from div.highlight span
    * Navigates to preview URL and verifies Unpublished Dataset Preview
      URL banner scoped to #messagePanel
    * Disables URL via confirmation popup
    * Verifies success message
- 21-dataset-citation-download.spec.ts:
    * Creates its own unpublished dataset (fully self-contained)
    * Verifies DOI https://doi.org/ is present in citation block
    * Downloads EndNote XML, reads file content, asserts <?xml <records>
    * Downloads RIS, reads file content, asserts TY  - DATA and ER  -
    * Opens BibTeX in new tab, asserts @DaTa doi = { url = {
- secure_docs/TEST_COVERAGE.md: m
- 20-preview-url.spec.ts:
    * Create
'
Copilot AI lite review requested due to automatic review settings September 8, 2026 19:02
@ashmanda-cs ashmanda-cs self-assigned this Sep 8, 2026
@ashmanda-cs ashmanda-cs added the enhancement New feature or request label Sep 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Several newly added tests contain clear documentation/expectation mismatches and a test-only dependency is incorrectly scoped as a production dependency.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR expands the Playwright E2E coverage by adding a larger “standard” suite and introducing a new “regression” suite with cross-test state persistence, along with new test data artifacts and Playwright project configuration to run both suites.

Changes:

  • Added multiple new @standard Playwright specs covering uploads, preview URLs, citation downloads, permissions, and guestbooks.
  • Introduced a @regression suite (new specs + state helpers + tsconfig) and updated Playwright config to include tests/**.
  • Added new test-data assets (CSV, RO-Crate JSON, R script) and updated repo metadata (.gitignore, backlog, npm deps).
File summaries
File Description
tests/suite/test-data/sample-data.csv Adds sample CSV used by upload-related tests.
tests/suite/test-data/ro-crate-metadata.json Adds RO-Crate metadata sample for upload coverage.
tests/suite/test-data/demo-code.R Adds a sample R script for upload coverage.
tests/suite/22-dataset-permissions.spec.ts Adds dataset/file permissions management tests.
tests/suite/21-dataset-citation-download.spec.ts Adds citation download coverage (EndNote/RIS/BibTeX).
tests/suite/20-preview-url.spec.ts Adds coverage for preview URL create/verify/disable flow.
tests/suite/19-file-upload-tabular.spec.ts Adds tabular ingest upload coverage for multiple formats.
tests/suite/18-file-upload-formats.spec.ts Adds non-ingest (plus CSV) upload coverage in a single batch.
tests/suite/11-create-edit-metadata-template.spec.ts Expands template test to cover default/clone and safer cleanup.
tests/suite/10-assign-user-group-roles.spec.ts Extends tagging to include standard suite coverage.
tests/suite/07-guestbook.spec.ts Adds guestbook create/download/delete coverage.
tests/regression/tsconfig.json Adds regression-suite TypeScript configuration.
tests/regression/regression-state.ts Adds file-based state persistence utilities for regression steps.
tests/regression/dataset-download-locally-fair.spec.ts Adds regression test for locally FAIR dataverse download behavior.
tests/regression/dataset-creation-default-custom-license.spec.ts Adds regression test for default template + custom license inheritance.
playwright.config.ts Expands testDir and adds regression setup/suite projects per browser.
package.json Adds Axe Playwright integration dependency.
package-lock.json Locks newly added dependencies.
docs/backlog.md Updates backlog with new follow-up items.
.gitignore Ignores regression runtime state files.
Review details

Suppressed comments (1)

tests/suite/18-file-upload-formats.spec.ts:94

  • This comment refers to "9 files" and tabular ingestion, but the test uploads 5 files. The mismatch can confuse why the timeout is 60s.
    // 9 files including tabular ingestion means the server takes longer to
    // respond — extend the timeout well beyond the 5s default.
    await expect(page.getByText("This dataset has been created.")).toBeVisible({
  • Files reviewed: 18/28 changed files
  • Comments generated: 5
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread package.json
Comment on lines 35 to 37
"dependencies": {
"@axe-core/playwright": "^4.13.0",
"dotenv": "^17.4.2"
Comment on lines +91 to +92
// Step 13: Template edited and saved confirmation
await expect(page.getByText("Template has been edited and saved.")).toBeVisible();
Comment on lines +73 to +75
// Wait for every filename to appear in the upload staging area before
// saving — more reliable than a fixed timeout for 9 files with tabular
// ingestion (.dta, .RData, .sav, .xlsx, .csv).
Comment on lines +8 to +10
* Creates a new dataset, uploads the four tabular ingest formats one by one,
* and verifies each filename appears in the file table after save.
*
Comment on lines +7 to +21
* Standard Suite — Tests #72–#78
* Translated from QDR `test_dataset_permissions.py`.
*
* Covers dataset-level permissions (permissions-manage.xhtml) and
* file-level permissions (permissions-manage-files.xhtml).
*
* Tests (in order):
* 1. Permissions page loads — Assign Roles button + table row visible #72–#73
* 2. Assign Curator role to :authenticated-users #74
* 3. Remove the Curator role #74
* 4. File permissions page loads #75
* 5. Grant file access to :authenticated-users; verify table row #76–#77
* 6. Revoke file access; verify row gone #78
*
* Selector reference: secure_docs/SELECTOR_MAP.md

@ashmanda-cs ashmanda-cs left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ashmanda-cs
ashmanda-cs merged commit 219ae01 into gdcc:main Sep 17, 2026
ashmanda-cs added a commit to uncch-rdmc/dataverse-jsf-tests that referenced this pull request Oct 7, 2026
feat: add expanded suite of tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

2 participants