Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixture for e2e testing against records mode in Cypress #6584

Open
steve-kasica opened this issue May 2, 2024 · 0 comments
Open

Fixture for e2e testing against records mode in Cypress #6584

steve-kasica opened this issue May 2, 2024 · 0 comments
Labels
refactoring tests Improving test coverage and speed Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements.

Comments

@steve-kasica
Copy link

It would be helpful for end-to-end testing if there was an example project to write tests against that's representative of data users would work with in records mode. The suite of food fixtures in the fixtures directory; food.mini.*, food.small.*, etc.; does not respond well to records mode since each row corresponds to one record. Cypress specs in rows_records.cy.js use such a project with hierarchical data, where many rows correspond to one record. However, this fixture is not accessible to specs in other files because it's stored in a file variable.

Proposed solution

Move data in jsonValue in rows_records.cy.js into a fixture so other test files can use this data.

Alternatives considered

New tests could define their own records-mode data in the spec. I've done this in the interim with fixture based on Pricerunner dataset.

https://github.com/steve-kasica/OpenRefine/blob/91e975bf03ed10dbfa9545a9a704fa723e8e7cca/main/tests/cypress/cypress/e2e/project/grid/all-column/add-rows.cy.js#L324-L330

But this approach is redundant, and leaving developers to specify their own test data could lead to gaps in test coverage.

Additional context

@steve-kasica steve-kasica added Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements. labels May 2, 2024
@tfmorris tfmorris added tests Improving test coverage and speed refactoring and removed Status: Pending Review Indicates that the issue or pull request is awaiting review by project maintainers or collaborators labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring tests Improving test coverage and speed Type: Feature Request Identifies requests for new features or enhancements. These involve proposing new improvements.
Projects
None yet
Development

No branches or pull requests

2 participants