Skip to content

GSOC-E2E: Add collections lifecycle test - #4248

Open
Geethegreat wants to merge 3 commits into
processing:developfrom
Geethegreat:collections-flow
Open

GSOC-E2E: Add collections lifecycle test#4248
Geethegreat wants to merge 3 commits into
processing:developfrom
Geethegreat:collections-flow

Conversation

@Geethegreat

Copy link
Copy Markdown
Member

Issue:

Fixes #

Adds a test that covers the full collections management lifecycle for an authenticated user.

Demo:

e2e-collections-1.mp4

Changes:

  • Save a sketch from the editor
  • Navigate to the collections page and confirm no collections exist
  • Create a new collection
  • Confirm redirect to the new collection page with "No sketches in collection" message
  • Add both saved sketches to the collection via File → Add to Collection
  • Verify both sketches appear in the collection table
  • Navigate to the collections list and confirm the sketch count shows 2
  • Rename the collection via the dropdown
  • Verify the new collection name appears in the table
  • Remove the sketch from the collection
  • Verify the sketch count drops to 0
  • Delete the collection
  • Confirm the collection no longer appears in the table

I have verified that this pull request:

  • has no linting errors (npm run lint)
  • has no test errors (npm run test)
  • has no typecheck errors (npm run typecheck)
  • is from a uniquely-named feature branch and is up to date with the develop branch.
  • is descriptively named and links to an issue number, i.e. Fixes #123
  • meets the standards outlined in the accessibility guidelines

Comment thread e2e/specs/collections.spec.ts Outdated
.locator('button[aria-label="Close Add to collection overlay"]')
.click();

await page.locator(`button:has-text("${testUser.username}")`).click();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we update to page.getByRole('menuitem', { name: ${testUser.username}` }).click();

or at least have the other selector methods be consistent throughout this file

@Geethegreat Geethegreat changed the title GSOC-E2E: Add collections lifecycle test- #14 GSOC-E2E: Add collections lifecycle test Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Let's unify how we do selectors on this test, you have a mixture of methods here:

page.locator('.editor-holder');
page.locator('button.editable-input__label')
page.getByRole('menuitem', { name: testUser.username })
page.locator('input#name')
page.getByRole('button', { name: 'Add to collection', exact: true })

etcetc

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I personally prefer page.getByRole for readability

I think some folks also prefer it as it tests accessibility
https://www.reddit.com/r/Playwright/comments/1m91faa/locator_or_getbyrole/

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.

2 participants