Test IDs Reference

This page documents the stable data-testid attributes used throughout PassTheNote for reliable automation testing. All components maintain consistent test IDs across releases to ensure your test suites remain stable.

Test ID Schema Version: 1.0 • Stable as of December 2025

Authentication

Elementdata-testidLocationNotes
Login page containerptn-login-page/auth/loginMain login page wrapper
Email input fieldptn-login-email-input/auth/loginEmail/username input
Password input fieldptn-login-password-input/auth/loginPassword input
Login submit buttonptn-login-submit-button/auth/loginPrimary submit button
Signup name inputptn-signup-name-input/auth/signupFull name field
Signup email inputptn-signup-email-input/auth/signupEmail field
Signup password inputptn-signup-password-input/auth/signupPassword field with strength meter
Forgot password emailptn-forgot-email-input/auth/forgot-passwordEmail for password reset
Reset password pageptn-reset-page/auth/reset-passwordReset password container

Notes & Knowledge Sharing

Elementdata-testidLocationNotes
Notes list viewptn-notes-list-view/notesList view container
Notes grid viewptn-notes-grid-view/notesGrid view container
Note cardptn-note-card-{id}/notesIndividual note card with ID
Note card titleptn-note-card-title/notesNote title text
Search inputptn-notes-search-input/notesKeyword search field
Tag filter buttonsptn-notes-tag-{tag}/notesTag filter chips (multiple)
Type filter buttonsptn-notes-type-{type}/notesNote type filters
Comment submit buttonptn-note-comment-submit-button/notes/[id]Post comment button

E-Commerce

Elementdata-testidLocationNotes
Product cardptn-product-card/app/productsIndividual product (multiple)
Product nameptn-product-name/app/productsProduct title text
Product priceptn-product-price/app/productsPrice display
Add to cart buttonptn-product-add-button/app/productsAdd to cart action
Cart itemptn-cart-item/app/cartEach cart line item
Cart item nameptn-cart-item-name/app/cartProduct name in cart
Cart item quantityptn-cart-item-quantity/app/cartQuantity controls
Cart item removeptn-cart-item-remove/app/cartRemove from cart button
Cart subtotalptn-cart-subtotal/app/cartSubtotal price display
Checkout buttonptn-cart-checkout-button/app/cartProceed to checkout

Admin Dashboard

Elementdata-testidLocationNotes
Dashboard pageptn-dashboard-page/app/dashboardUser dashboard container
Dashboard notes snapshotdashboard-notes-snapshot/app/dashboardRecent notes widget
Quick action buttonsquick-action-{id}/app/dashboardQuick action shortcuts
Activity filter buttonsactivity-filter-{type}/app/dashboardActivity type filters
Feature flag togglesfeature-flag-{id}/app/dashboardTesting mode toggles

API Explorer & Testing

Elementdata-testidLocationNotes
Send request buttonptn-api-explorer-send-button/app/api-explorerExecute API call
Response statusptn-api-explorer-response-status/app/api-explorerHTTP status code display
Endpoint service filtersVarious endpoint IDs/app/api-explorerAuth, Products, Orders, etc.

Practice Challenges

Elementdata-testidLocationNotes
Challenge cardsVarious challenge elements/practice-challengesModule-specific challenge cards
LinkedIn share buttonsPre-filled share links/practice-challengesSocial sharing CTAs

Global Navigation & UI

Elementdata-testidLocationNotes
Top navigationtop-navGlobalMain navbar container
Navbar brand/logoptn-navbar-brandGlobalPassTheNote logo link
Navbar login buttonptn-navbar-login-buttonGlobalLogin CTA in navbar
Navbar signup buttonptn-navbar-signup-buttonGlobalSign up CTA in navbar
User menu dropdowntop-nav-user-menuGlobal (authenticated)User profile dropdown
Logout buttonptn-nav-logout-btnUser menuSign out action
Admin linkptn-nav-admin-linkUser menu (admin only)Admin dashboard link

Usage Tips

  • Selector Strategy: Use data-testid as your primary selector. Example: cy.get('[data-testid="login-form"]') or page.locator('[data-testid="login-form"]')
  • Stability Promise: Test IDs in this schema will remain stable across minor version updates. Breaking changes will be documented with version bumps.
  • Multiple Instances: Elements like note-card, product-card appear multiple times. Use getAllByTestId() or index-based selection.
  • Dynamic Content: In Chaos Mode, test IDs remain stable even when other attributes randomize—perfect for practicing resilient selector strategies.
  • Missing IDs? If you find an element without a test ID that should have one, please report it via the issue tracker.
  • API Testing: For REST API automation, see our API Documentation and download the Postman Collection.