Skip to content

playwright coverage increase#2639

Merged
crivetimihai merged 4 commits intomainfrom
playwright-g
Feb 1, 2026
Merged

playwright coverage increase#2639
crivetimihai merged 4 commits intomainfrom
playwright-g

Conversation

@crivetimihai
Copy link
Copy Markdown
Member

@crivetimihai crivetimihai commented Feb 1, 2026

Increase playwright coverage

@crivetimihai crivetimihai changed the title playwright g playwright coverage increase Feb 1, 2026
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
- Use admin_page fixture consistently for authenticated access
- Add explicit waits for modal visibility with :not(.hidden) selector
- Skip tests properly when no tools are available instead of silent pass
- Increase timeout to 10s for modal operations

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
- Add _wait_for_codemirror() to wait for CodeMirror editor initialization
  before interacting with promptArgsEditor
- Remove redundant navigation in test_admin_panel_loads since admin_page
  fixture already handles authentication and navigation
- Add cleanup to all entity create tests (prompts, resources, servers,
  tools) to delete created entities after test completion
- Fix _prepare_tools_table() to use state="attached" instead of requiring
  visibility, preventing timeouts on empty tables
- Apply black/isort formatting fixes

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai
Copy link
Copy Markdown
Member Author

Test Reliability Fixes

Fixed flaky and failing playwright tests:

Issues Fixed

  1. test_prompts.py Error - Added _wait_for_codemirror() to wait for CodeMirror editor (window.promptArgsEditor) to initialize before interacting with it

  2. test_admin_ui.py Failure - Removed redundant admin_ui.navigate() call since admin_page fixture already handles authentication and navigation

  3. test_htmx_interactions.py Timeout - Fixed _prepare_tools_table() to use state="attached" instead of requiring visibility, preventing timeouts when tools table is empty

  4. Idempotency - Added cleanup to all entity create tests to delete created entities after test completion:

    • test_create_new_prompt
    • test_create_new_resource
    • test_create_new_server
    • test_create_new_tool

Test Results

53 passed, 11 skipped, 0 failed

Tests verified to pass on multiple consecutive runs.

- Wait for CodeMirror library to load before checking editor instance
- Increase timeout from 10s to 30s for slower CI environments
- Add null check to editor wait condition

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai
Copy link
Copy Markdown
Member Author

Additional Fix for test_prompts.py

Improved CodeMirror wait reliability:

  • Wait for window.CodeMirror library to load first before checking for editor instance
  • Increased timeout from 10s to 30s for slower CI environments
  • Added null check to editor wait condition: window.promptArgsEditor !== null

This should fix the E. (Error) seen in CI where the CodeMirror library may load slower than locally.

@crivetimihai crivetimihai merged commit 183fdde into main Feb 1, 2026
36 checks passed
@crivetimihai crivetimihai deleted the playwright-g branch February 1, 2026 19:44
hughhennelly pushed a commit to hughhennelly/mcp-context-forge that referenced this pull request Feb 8, 2026
* Increase playwright coverage

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(tests): improve playwright tool modal tests reliability

- Use admin_page fixture consistently for authenticated access
- Add explicit waits for modal visibility with :not(.hidden) selector
- Skip tests properly when no tools are available instead of silent pass
- Increase timeout to 10s for modal operations

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(tests): improve playwright test reliability and idempotency

- Add _wait_for_codemirror() to wait for CodeMirror editor initialization
  before interacting with promptArgsEditor
- Remove redundant navigation in test_admin_panel_loads since admin_page
  fixture already handles authentication and navigation
- Add cleanup to all entity create tests (prompts, resources, servers,
  tools) to delete created entities after test completion
- Fix _prepare_tools_table() to use state="attached" instead of requiring
  visibility, preventing timeouts on empty tables
- Apply black/isort formatting fixes

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(tests): improve CodeMirror wait reliability in prompts test

- Wait for CodeMirror library to load before checking editor instance
- Increase timeout from 10s to 30s for slower CI environments
- Add null check to editor wait condition

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Signed-off-by: hughhennnelly <hughhennelly06@gmail.com>
kcostell06 pushed a commit to kcostell06/mcp-context-forge that referenced this pull request Feb 24, 2026
* Increase playwright coverage

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(tests): improve playwright tool modal tests reliability

- Use admin_page fixture consistently for authenticated access
- Add explicit waits for modal visibility with :not(.hidden) selector
- Skip tests properly when no tools are available instead of silent pass
- Increase timeout to 10s for modal operations

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(tests): improve playwright test reliability and idempotency

- Add _wait_for_codemirror() to wait for CodeMirror editor initialization
  before interacting with promptArgsEditor
- Remove redundant navigation in test_admin_panel_loads since admin_page
  fixture already handles authentication and navigation
- Add cleanup to all entity create tests (prompts, resources, servers,
  tools) to delete created entities after test completion
- Fix _prepare_tools_table() to use state="attached" instead of requiring
  visibility, preventing timeouts on empty tables
- Apply black/isort formatting fixes

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

* fix(tests): improve CodeMirror wait reliability in prompts test

- Wait for CodeMirror library to load before checking editor instance
- Increase timeout from 10s to 30s for slower CI environments
- Add null check to editor wait condition

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
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.

1 participant