Skip to content

Use this repo's issues for test fixtures instead of external repos #14

@richardkmichael

Description

@richardkmichael

Tests currently use issues from microsoft/playwright and facebook/react as test data and navigation targets. These external issues can be closed, deleted, or changed without notice.

Instead, select several issues in this repo and update tests/extension.spec.js to use them exclusively.

Update TEST_ISSUES Pool

Current (line 15 in extension.spec.js):

const TEST_ISSUES = [
  { owner: 'microsoft', repo: 'playwright', number: 38673 },
  { owner: 'microsoft', repo: 'playwright', number: 38674 },
  { owner: 'facebook', repo: 'react', number: 100 },
];

After (assuming test fixture issues created):

const TEST_ISSUES = [
  { owner: 'richardkmichael', repo: 'github-bookmarked-issues', number: TBD },
  { owner: 'richardkmichael', repo: 'github-bookmarked-issues', number: TBD },
  { owner: 'richardkmichael', repo: 'github-bookmarked-issues', number: TBD },
];

Add Repository Helpers

const TEST_REPO = {
  owner: 'richardkmichael',
  repo: 'github-bookmarked-issues',
};

function repoUrl(repo = TEST_REPO) {
  return `https://github.com/${repo.owner}/${repo.repo}`;
}

function issuesListUrl(repo = TEST_REPO) {
  return `https://github.com/${repo.owner}/${repo.repo}/issues`;
}

function issueLinksSelector(repo = TEST_REPO) {
  return `a[href^="/${repo.owner}/${repo.repo}/issues/"]:not([href$="/issues/"])`;
}

Hardcoded URLs and References to Update

All in tests/extension.spec.js:

Hardcoded navigation URLs

  • Line 195: page.goto('https://github.com/microsoft/playwright/issues/11975')
  • Line 261: page.goto('https://github.com/microsoft/playwright/issues')
  • Line 279: page.goto('https://github.com/microsoft/playwright')
  • Line 1056: authPage.goto('https://github.com/microsoft/playwright')

Hardcoded bookmark key checks

  • Line 219: 'microsoft/playwright/issues/11975'
  • Line 415-417: 'microsoft/playwright/issues/38673', etc.

Hardcoded selectors

  • Line 265: a[href^="/microsoft/playwright/issues/"]
  • Line 288: same pattern

Mock route body checks (match on repo name in GraphQL body)

  • Lines 1200, 1252, 1306, 1493: body.includes('microsoft/playwright')

Mock REST API responses with hardcoded URLs

  • Lines 1519-1542: mock responses with microsoft/playwright and facebook/react URLs

Comments referencing repos

  • Line 864: // microsoft/playwright
  • Line 865: // facebook/react

Test Stability Considerations

  • Mark issues with [Test Fixture] prefix
  • Lock issues to prevent comments
  • At least one open and one closed issue needed
  • Issues should have minimal activity

Do NOT Keep External Fallback

Self-contained testing is more reliable:

  • External issues can be closed/deleted
  • Fewer external dependencies
  • Faster tests

Implementation Sequence

  1. Create 2-3 test issues with [Test Fixture] naming
  2. Lock the test issues
  3. Add TEST_REPO constant and helpers
  4. Update TEST_ISSUES array with new issue numbers
  5. Replace all hardcoded URLs, selectors, and mock data
  6. Run tests to verify

Files to Modify

  • tests/extension.spec.js - Update TEST_ISSUES, add helpers, replace all hardcoded references

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions