Skip to content

Conversation

@nickrobinson
Copy link
Collaborator

This PR adds an integration test that will run on Browserstack to validate that the javascript-web quickstart is working as expected

This PR adds an integration test that will run on Browserstack to
validate that the javascript-web quickstart is working as expected
@nickrobinson nickrobinson force-pushed the nr/js-integration-test branch from 57caa2b to 8fb515c Compare August 29, 2025 13:54
@nickrobinson nickrobinson marked this pull request as ready for review August 29, 2025 13:55
Copilot AI review requested due to automatic review settings August 29, 2025 13:55

This comment was marked as outdated.

@nickrobinson nickrobinson force-pushed the nr/js-integration-test branch from b1f916b to 5c1e600 Compare August 29, 2025 14:23
- Move inline Python script from workflow to .github/scripts/browserstack-test.py
- Add proper shebang, documentation, and function structure to test script
- Update workflow to reference external script instead of inline creation
- Improve maintainability and version control of test automation code

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@nickrobinson nickrobinson force-pushed the nr/js-integration-test branch 4 times, most recently from 0663962 to 45f2406 Compare August 29, 2025 17:34
@nickrobinson nickrobinson force-pushed the nr/js-integration-test branch from 45f2406 to c3b583e Compare August 29, 2025 17:43
Copy link
Contributor

@teodorciuraru teodorciuraru left a comment

Choose a reason for hiding this comment

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

Awesome idea with the Ditto Cloud sync simple test. CI looks good and is good to go, but I would first address the Copilot review, as they seem relevant.

Another concern here is the bloated CI file, which mixes different types of jobs, making it difficult to follow or switch providers later on. We will be able to clean this up later and also extract GHA tasks to a separate file for easy reuse, so it's not a real problem atm.

teodorciuraru added a commit that referenced this pull request Sep 2, 2025
Following the working pattern from JavaScript BrowserStack workflow (PR #146),
added missing username:password authentication to BrowserStack WebDriver URLs.

This fixes the 'Authorization Required' error that was preventing device
connections during Android and iOS real device testing.

🔧 Changes:
- Fixed Android script: webdriver.Remote() now includes credentials in URL
- Fixed iOS script: webdriver.Remote() now includes credentials in URL
- Follows exact same pattern as proven working JS implementation

✅ Expected result: BrowserStack device connections should now succeed
teodorciuraru added a commit that referenced this pull request Sep 2, 2025
Following JavaScript web example (PR #146), revert from complex UI interaction
testing to proven HTTP API document insertion + sync verification approach.

Workflow changes:
- Insert test documents via Ditto HTTP API before running tests
- Use deterministic document IDs based on GitHub run ID
- Proper task document structure with "text" and "isCompleted" fields

BrowserStack test scripts:
- Completely rewritten to focus on sync verification only
- Wait for HTTP API inserted documents to appear in app UI
- No more complex UI interactions (forms, buttons, navigation)
- Simple, reliable document detection via page source and elements
- Enhanced debugging with element inspection

Benefits:
- Much more reliable than UI automation
- Tests actual Ditto sync functionality (HTTP API → App)
- Follows proven pattern from JavaScript web testing
- Eliminates complex UI interaction failure points
- Focuses on core value: verifying Ditto sync works

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
teodorciuraru added a commit that referenced this pull request Sep 3, 2025
- Use BrowserStack Local daemon with proper start/stop commands
- Follow working pattern from JavaScript Web BrowserStack PR #146
- Replace background process approach with daemon management
- Add proper tunnel cleanup in cleanup step

This should resolve the ERR_CONNECTION_REFUSED errors by establishing
a proper tunnel between BrowserStack browsers and localhost:8080.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
teodorciuraru added a commit that referenced this pull request Sep 3, 2025
…rence

- Switch back to daemon start/stop approach from JavaScript Web PR #146
- Use --status flag for tunnel verification instead of health check URL
- Simplify tunnel management following proven working implementation
- Remove complex PID tracking in favor of daemon lifecycle management

This follows the exact pattern from the successfully tested JavaScript
Web BrowserStack integration workflow.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
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 adds a comprehensive integration test for the JavaScript web quickstart application using BrowserStack for cross-browser testing. The test validates that the application works correctly by creating a test document in Ditto Cloud and verifying it syncs to the web application.

  • Implements automated GitHub Actions workflow for running JavaScript web tests on BrowserStack
  • Creates a Python test script that validates UI functionality and document synchronization across Chrome and Firefox
  • Sets up proper artifact collection and test reporting for debugging failed tests

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
.github/workflows/javascript-web-browserstack.yml GitHub Actions workflow that sets up the test environment, builds the app, and runs BrowserStack tests
.github/scripts/browserstack-test.py Python test script that performs cross-browser testing using Selenium WebDriver on BrowserStack

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
teodorciuraru added a commit that referenced this pull request Sep 3, 2025
- Replace ditto-test-document-insert action with direct curl approach
- Use deterministic document ID: github_android-java_{RUN_ID}_{RUN_NUMBER}
- Set GITHUB_TEST_DOC_ID environment variable for test verification
- Match successful JavaScript workflow pattern from PR #146

This implements the 6-step flow:
1. Lint ✅
2. Build ✅
3. Seed ✅ (now inline HTTP POST to Ditto Cloud)
4. Upload ✅
5. Test ✅ (waits for seeded document)
6. Wait ✅

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
teodorciuraru added a commit that referenced this pull request Sep 3, 2025
Apply identical JavaScript PR #146 pattern to Android Kotlin and C++:

Android Java ✅:    github_android-java_${RUN_ID}_${RUN_NUMBER}
Android Kotlin ✅:  github_android-kotlin_${RUN_ID}_${RUN_NUMBER}
Android C++ ✅:     github_android-cpp_${RUN_ID}_${RUN_NUMBER}

All 3 Android workflows now have consistent 6-step flow:
1. Lint - ./gradlew lintDebug
2. Build - APKs bundle (debug + androidTest)
3. Seed - Direct HTTP POST to Ditto Cloud API (inline curl)
4. Upload - App and test APKs to BrowserStack
5. Test - BrowserStack Espresso tests wait for seeded document to appear
6. Wait - Poll for results across multiple devices

Each app has 1 focused integration test verifying HTTP API → mobile app sync.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Contributor

@pvditto pvditto left a comment

Choose a reason for hiding this comment

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

LGTM! Some of the wait-based synchronisation could fail if the browserstack machines aren't snappy and a great improvement could be capturing Ditto logs from the browser console.

@nickrobinson nickrobinson removed the request for review from konstantinbe September 3, 2025 18:49
@nickrobinson nickrobinson merged commit 4093f86 into main Sep 3, 2025
10 checks passed
@nickrobinson nickrobinson deleted the nr/js-integration-test branch September 3, 2025 20:14
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.

4 participants