Skip to content

Conversation

@yomybaby
Copy link
Member

@yomybaby yomybaby commented Nov 20, 2025

Resolves FR-1711

Summary

This PR fix and refactors the showNonInstalledImages E2E test in e2e/config.test.ts to improve reliability and maintainability.

Changes

Test Improvements

  • Removed clipboard-based approach: Previously, the test used complex clipboard copy/paste operations which were fragile. Now directly inspects DOM elements.
  • Better selector strategy: Uses semantic selectors and excludes ant-table-measure-row elements that caused false positives.
  • Page Object Pattern: Integrated StartPage class for better code organization and reusability.
  • Removed unnecessary waits: Eliminated all waitForTimeout calls, relying on Playwright's built-in auto-waiting mechanism.
  • More reliable image detection: Changed from checking badges to checking empty status cells to identify uninstalled images.

Performance

  • Test execution time improved from 20.9s to 8.1s after removing unnecessary timeouts.

Code Quality

  • Applied Page Object Pattern with StartPage class
  • Used explicit waits only when necessary (waitForSelector)
  • Added proper element state checks (state: 'attached')
  • Used force click option to avoid element interception issues

Test Plan

Run the specific test:

pnpm exec playwright test e2e/config.test.ts -g "showNonInstalledImages"

The test should:

  1. Log in as admin
  2. Navigate to Environments page
  3. Find an uninstalled image (empty status cell)
  4. Navigate to Start/Session launcher
  5. Open environment selector
  6. Search for the uninstalled image
  7. Verify the image appears in the dropdown (selectable)

Checklist:

  • Test execution time improved
  • Test reliability improved (no flaky timeouts)
  • Code maintainability improved (Page Object Pattern)
  • Proper Playwright patterns (auto-waiting, semantic selectors)

@github-actions github-actions bot added the size:L 100~500 LoC label Nov 20, 2025
Copy link
Member Author

yomybaby commented Nov 20, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • flow:merge-queue - adds this PR to the back of the merge queue
  • flow:hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has required the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@yomybaby yomybaby changed the title refactor(FR-1711): improve showNonInstalledImages E2E test reliability fix(FR-1711): showNonInstalledImages E2E test Nov 20, 2025
@yomybaby yomybaby marked this pull request as ready for review November 20, 2025 09:19
@graphite-app graphite-app bot changed the base branch from fix/FR-1703-e2e-search-selector to graphite-base/4679 November 20, 2025 09:19
@yomybaby yomybaby force-pushed the refactor/FR-1711-improve-e2e-test branch from 0427c31 to acfddfa Compare November 20, 2025 10:10
@yomybaby yomybaby changed the base branch from graphite-base/4679 to main November 20, 2025 10:10
Copilot AI review requested due to automatic review settings November 21, 2025 08:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the showNonInstalledImages E2E test to improve reliability and performance by replacing clipboard-based operations with direct DOM inspection and implementing the Page Object Pattern.

Key Changes

  • Replaced fragile clipboard copy/paste operations with direct DOM element inspection to identify uninstalled images
  • Integrated StartPage class for better code organization following Page Object Pattern
  • Improved test execution time from 20.9s to 8.1s by removing unnecessary waitForTimeout calls

Copy link
Contributor

@nowgnuesLee nowgnuesLee left a comment

Choose a reason for hiding this comment

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

LGTM

@graphite-app
Copy link

graphite-app bot commented Nov 21, 2025

Merge activity

Resolves FR-1711

## Summary

This PR fix and refactors the `showNonInstalledImages` E2E test in `e2e/config.test.ts` to improve reliability and maintainability.

## Changes

### Test Improvements

- **Removed clipboard-based approach**: Previously, the test used complex clipboard copy/paste operations which were fragile. Now directly inspects DOM elements.
- **Better selector strategy**: Uses semantic selectors and excludes `ant-table-measure-row` elements that caused false positives.
- **Page Object Pattern**: Integrated `StartPage` class for better code organization and reusability.
- **Removed unnecessary waits**: Eliminated all `waitForTimeout` calls, relying on Playwright's built-in auto-waiting mechanism.
- **More reliable image detection**: Changed from checking badges to checking empty status cells to identify uninstalled images.

### Performance

- Test execution time improved from **20\.9s to 8.1s** after removing unnecessary timeouts.

### Code Quality

- Applied Page Object Pattern with `StartPage` class
- Used explicit waits only when necessary (`waitForSelector`)
- Added proper element state checks (`state: 'attached'`)
- Used force click option to avoid element interception issues

## Test Plan

Run the specific test:
```bash
pnpm exec playwright test e2e/config.test.ts -g "showNonInstalledImages"
```

The test should:

1. Log in as admin
2. Navigate to Environments page
3. Find an uninstalled image (empty status cell)
4. Navigate to Start/Session launcher
5. Open environment selector
6. Search for the uninstalled image
7. Verify the image appears in the dropdown (selectable)

**Checklist:**

- [x] Test execution time improved
- [x] Test reliability improved (no flaky timeouts)
- [x] Code maintainability improved (Page Object Pattern)
- [x] Proper Playwright patterns (auto-waiting, semantic selectors)
@graphite-app graphite-app bot force-pushed the refactor/FR-1711-improve-e2e-test branch from ddaf3cf to e03712d Compare November 21, 2025 10:11
@graphite-app graphite-app bot merged commit e03712d into main Nov 21, 2025
8 checks passed
@graphite-app graphite-app bot deleted the refactor/FR-1711-improve-e2e-test branch November 21, 2025 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100~500 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants