Skip to content

feat: add share functionality tests and refactor test infrastructure#39

Merged
raven-wing merged 8 commits into
Problematy:mainfrom
raven-wing:multidomain_test
Feb 6, 2026
Merged

feat: add share functionality tests and refactor test infrastructure#39
raven-wing merged 8 commits into
Problematy:mainfrom
raven-wing:multidomain_test

Conversation

@raven-wing

@raven-wing raven-wing commented Feb 5, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added new issue types: "under construction", "has a hole", and "other" (available in test data)
  • Translations

    • Added English and Polish translations for the new issue types
  • Tests

    • Added comprehensive end-to-end share tests (desktop & mobile) and strengthened existing E2E tests for reliability
  • Chores

    • Added environment example, updated ignore rules, adjusted e2e test path handling, and added a stress-test run target

@coderabbitai

coderabbitai Bot commented Feb 5, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds environment and config templates, new share-focused end-to-end tests, introduces reported issue types to test data and translations, and refactors Playwright test fixtures (conftest) to remove webpack-script interception and simplify mobile/page setup; also small test, Makefile, and gitignore edits.

Changes

Cohort / File(s) Summary
Configuration & Environment
\.env.example, \.gitignore, e2e_test_config.template.yml
Adds .env.example with GOODMAP_PATH placeholder; expands .gitignore rules; changes DB path placeholder to __E2E_TESTS_DIR__/e2e_test_data.json.
Test Data Template
e2e_test_data_template.json
Adds map.reported_issue_types array: ["under construction","has a hole","other"].
Translations
translations/en/LC_MESSAGES/messages.po, translations/pl/LC_MESSAGES/messages.po
Adds translation entries for new issue types in English and Polish.
Test infra refactor
tests/conftest.py
Removes webpack-script fixture and pytest hook; centralizes HMR blocking, consolidates window.open stub, simplifies page/mobile_page fixtures and exports, and removes several constants and __all__.
New tests: share flows
tests/basic/test_share.py
Adds desktop and mobile E2E share tests covering clipboard copy, navigator.share stubbing, and shared-link popup behavior.
Test updates & cleanup
tests/basic/test_location_buttons.py, tests/basic/test_left_panel.py, tests/basic/test_map.py
Removes webpack_route usage from a geolocation test, updates one test signature (removes webpack_script param), and adjusts minor formatting/assertion messages.
Helpers & stress tests
tests/helpers.py, tests/stress/test_stress.py
Updates expected problem-type options to match new reported types; stress test now expands clusters to reveal markers and validates popup content after stabilization.
Makefile
Makefile
Adds STRESS_CONFIG_PATH variable and run-e2e-stress-env target to run the app with stress config.
New template file
.env.example
Added with GOODMAP_PATH=/path/to/your/goodmap.

Sequence Diagram(s)

sequenceDiagram
  participant Test as rgba(66,133,244,0.5) Test Runner
  participant Page as rgba(15,157,88,0.5) Browser Page
  participant App as rgba(251,188,5,0.5) Web App (server)
  participant Clipboard as rgba(219,68,55,0.5) Clipboard / OS
  Test->>Page: open base URL / expand cluster / open marker popup
  Page->>App: request popup data (locationId)
  App-->>Page: respond with popup content
  Test->>Page: click "Share"
  Page->>Clipboard: write URL (contains ?locationId=)
  Clipboard-->>Test: confirm copied value
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 I hopped through fixtures, stubbed a share,
Clipboard nibble, navigator’s care.
New issue types in data and song,
Tests stretched their legs and hopped along. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding share functionality tests (test_share.py with desktop/mobile test suites) and refactoring test infrastructure (conftest.py restructuring, removing webpack logic).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tests/conftest.py (1)

4-9: ⚠️ Potential issue | 🟡 Minor

Stale docstring reference to removed functionality.

Line 5 still mentions "Webpack script caching and interception" but this functionality was removed in this PR. Update the docstring to reflect the current fixture capabilities:

-Provides custom fixtures for:
-- Webpack script caching and interception
+Provides fixtures for:
+- Page setup with HMR blocking
 - Window.open() stub tracking
 - Geolocation mocking
 - Performance tracking for stress tests
+- Mobile device emulation
🤖 Fix all issues with AI agents
In `@e2e_test_data_template.json`:
- Around line 50-52: The JSON is invalid because there's a missing comma after
the array that precedes "reported_issue_types"; add the missing comma so the
"reported_issue_types" property (and the following "categories" object) are
properly separated—update the JSON around the "reported_issue_types" key to
ensure a comma separates it from the previous element, verifying
"reported_issue_types" and "categories" are valid sibling properties.

In `@Makefile`:
- Line 34: The command in the Makefile uses '$(CURDIR)/$(CONFIG_PATH)' which
breaks when CONFIG_PATH is already absolute; change it to use make's abspath
function so both relative and absolute CONFIG_PATH values work (replace the
concatenation with $(abspath $(CONFIG_PATH))) while keeping the existing
variables GOODMAP_PATH and CURDIR and preserving the quoted --app argument.
🧹 Nitpick comments (5)
tests/basic/test_location_buttons.py (1)

44-92: Clean refactoring to remove webpack_script dependency.

The approach of using add_init_script at the context level to mock geolocation denial before any page script runs is correct.

Consider extracting the HMR blocking logic (lines 77-81) to reuse the _block_hmr helper from conftest.py for consistency:

from tests.conftest import _block_hmr
# ...
page = context.new_page()
_block_hmr(page)

This would reduce duplication, though the current inline approach works fine.

tests/basic/test_share.py (4)

38-58: Consider reusing get_rightmost_marker helper.

This logic to find and click the rightmost marker duplicates the existing get_rightmost_marker helper in tests/helpers.py. Consider importing and using it:

from tests.helpers import get_rightmost_marker

# Then use:
rightmost_marker = get_rightmost_marker(page)
if rightmost_marker:
    rightmost_marker.click()

This would reduce duplication and improve maintainability.


99-100: Remove unused device_name parameter.

The device_name parameter is not used in the test method body. The mobile_page fixture already handles device selection via the parametrization. You can either:

  1. Switch to indirect parametrization (recommended by conftest):
-    `@pytest.mark.parametrize`("device_name", ALL_MOBILE_DEVICES)
-    def test_share_button_triggers_native_share(self, mobile_page: Page, device_name: str):
+    `@pytest.mark.parametrize`("mobile_page", ALL_MOBILE_DEVICES, indirect=True)
+    def test_share_button_triggers_native_share(self, mobile_page: Page):
  1. Or use device_name in the test (e.g., for logging/assertions) to justify keeping it.

128-148: Same duplication: consider reusing get_rightmost_marker helper.

This is the same rightmost marker logic duplicated again. Extract to a shared helper or reuse the existing one from tests/helpers.py.


164-165: Same issue: unused device_name parameter.

Apply the same fix as suggested for line 100 - either switch to indirect parametrization or use the parameter.

Comment thread e2e_test_data_template.json
Comment thread Makefile Outdated
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: ae45855

⚠️ E2E Stress Test Results

Performance data not found. See workflow logs for details.

@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: 4090b9b

📊 E2E Stress Test Performance

Status: PASSED (12738.03ms max < 25000ms limit)

Metric Value
Average Time 11519.73ms
Minimum Time 10604.35ms
Maximum Time 12738.03ms
Completed Runs 5/5
Avg Markers Loaded 73
📈 Individual Run Times
Run Time (ms) Markers
Run 1 10604.35ms 73
Run 2 10910.53ms 73
Run 3 11341.49ms 73
Run 4 12004.23ms 73
Run 5 12738.03ms 73

@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: 91ffef3

📊 E2E Stress Test Performance

Status: PASSED (11809.38ms max < 25000ms limit)

Metric Value
Average Time 10793.26ms
Minimum Time 10388.86ms
Maximum Time 11809.38ms
Completed Runs 5/5
Avg Markers Loaded 67
📈 Individual Run Times
Run Time (ms) Markers
Run 1 10677.49ms 67
Run 2 10388.86ms 67
Run 3 10638.01ms 67
Run 4 11809.38ms 67
Run 5 10452.55ms 67

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/stress/test_stress.py`:
- Around line 103-119: The cluster selector is wrong and the click is unguarded:
update the clusters locator from ".marker-cluster" to ".leaflet-marker-cluster"
and also change the individual_markers selector from
".leaflet-marker-icon:not(.marker-cluster)" to
".leaflet-marker-icon:not(.leaflet-marker-cluster)"; before calling
clusters.first.click() (in the loop that uses clusters, individual_markers,
max_clicks) add a defensive check that clusters.count() > 0 (and raise/assert or
break with a clear message if none) so you never call .first.click() on an empty
locator.

Comment thread tests/stress/test_stress.py
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: 61ef37b

📊 E2E Stress Test Performance

Status: PASSED (11805.64ms max < 25000ms limit)

Metric Value
Average Time 11147.99ms
Minimum Time 10741.1ms
Maximum Time 11805.64ms
Completed Runs 5/5
Avg Markers Loaded 72
📈 Individual Run Times
Run Time (ms) Markers
Run 1 10851.95ms 72
Run 2 11564.53ms 72
Run 3 11805.64ms 72
Run 4 10776.71ms 72
Run 5 10741.1ms 72

@raven-wing raven-wing changed the title feat: added multiple tests feat: add share functionality tests and refactor test infrastructure Feb 5, 2026
@github-actions

github-actions Bot commented Feb 5, 2026

Copy link
Copy Markdown

🧪 E2E Test Results

📊 View full workflow run
🔗 Commit: a0fb305

📊 E2E Stress Test Performance

Status: PASSED (12680.47ms max < 25000ms limit)

Metric Value
Average Time 12059.41ms
Minimum Time 11438.15ms
Maximum Time 12680.47ms
Completed Runs 5/5
Avg Markers Loaded 69
📈 Individual Run Times
Run Time (ms) Markers
Run 1 11745.87ms 69
Run 2 12121.17ms 69
Run 3 12311.38ms 69
Run 4 12680.47ms 69
Run 5 11438.15ms 69

@raven-wing raven-wing merged commit 8d26c08 into Problematy:main Feb 6, 2026
2 checks passed
@raven-wing raven-wing deleted the multidomain_test branch February 6, 2026 18:49
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