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

Development Data Seeds via Cypress #1938

Open
wants to merge 5 commits into
base: edge
Choose a base branch
from
Open

Conversation

ballPointPenguin
Copy link
Contributor

Development Data Seeds via Cypress

What's New

This is an experimental nice-to-have for quickly populating a local db with an array of conversations, comments, participants, and votes.

Within the e2e/ folder, simply run

npm run seed

or CYPRESS_BASE_URL=http://localhost:5001 npm run seed for a non-standard host url

for some default seeding.

Optional parameters include

  • numVoters: how many participants to create and vote with
  • numConversations: how many conversations to create
  • commentsPerConvo: how many (seed) comments to create; all will be voted on

eg.

npm run seed -- --numVoters=10 --numConversations=3 --commentsPerConvo=5

Pros/Cons

Pros

This approach simulates a real user interacting with a headless browser (Electron by default).
Useful for testing the whole stack, and surfacing real bugs, performance issues, etc.
It's also conveniently piggy-backing on existing cypress custom commands and setup.

Cons

This is relatively slow and brittle, compared to seeding the db directly, or with API calls.
For large sequences (over 100 participants), I've had Electron crash after slowing down and running out of resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant