bahmutov / bahmutov/cypress-data-session

cleanup feature

Open
#123 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
67
Forks
11
Avg merge
21h 50m
Merged PRs (30d)
3

Description

Best to explain the request with an example from a sample repo.

https://github.com/muratkeremozcan/appsyncmasterclass-backend/tree/main/cypress/e2e

The 3 spec files `image-upload`, `tweet`, `user-profile` all spin up a random user and get a token with it. At the end of each spec the user is cleaned up.

This would be a great use case for data session, however we have to delete the user at the end of each spec. If there was a feature to delete the user once, at the end, after all the specs have run, data-session would be more meaningful.

In theory we could try something in an after block in the e2e.ts, but that would require wrangling the variable, which would then also mean a before block would be necessary in the same file. You can imagine how that will be a mess to maintain with JS, multiple files, and common hooks in the e2e ts file. What if not every test requires these, for example the test `confirm-user-signup` in the repo? All this would be resolved if we could instead deal with the session for cleanup.

Contributor guide

No contributing guide indexed for this repository

Research direction

Review the sample repository's image-upload, tweet, and user-profile specs together with the shared e2e.ts hooks to understand how users and tokens are created and cleaned up. Define how data-session should perform one final cleanup after all relevant specs while leaving tests such as confirm-user-signup unaffected; done should be demonstrated with Cypress coverage for both cleanup paths.

Written by the indexing model from the issue text.

Assessment

Tech stack
cypress, javascript
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.