Skip to content

Automated browser tests#12

Draft
osbre wants to merge 172 commits intosimpleanalytics:masterfrom
osbre:feat/automated-browser-tests
Draft

Automated browser tests#12
osbre wants to merge 172 commits intosimpleanalytics:masterfrom
osbre:feat/automated-browser-tests

Conversation

@osbre
Copy link
Copy Markdown
Contributor

@osbre osbre commented Apr 14, 2025

(In progress. Will force-push and mark as "Ready" when finished)

@osbre osbre marked this pull request as draft April 14, 2025 03:29
@adriaandotcom adriaandotcom mentioned this pull request Jul 29, 2025
@adriaandotcom
Copy link
Copy Markdown
Contributor

Hey @osbre, I fixed the bug with AI, but I have no clue if it also broke something. Would you mind checking?

… settings

The `test_adds_script_with_ignored_pages` test assumed the plugin was already
active from a previous test, but PHPUnit tests run in isolation and execution
order isn't guaranteed.

- Add `activatePluginIfNeeded()` helper to BrowserTestCase that conditionally
  activates the plugin only if not already active
- Update `test_adds_script_with_ignored_pages` to use the helper

This ensures the test works regardless of execution order or whether the plugin
is already activated.
@osbre
Copy link
Copy Markdown
Contributor Author

osbre commented Nov 28, 2025

I'll take it from here, thank you @adriaandotcom!

It's nice to see the CI pass at this stage. Here's a bit history on the previous progress:

At first, I completed all the test cases in PestPHP's newest browsing testing feature, which uses Playwright underneath. Unfortunately, I had some of the weirdest instability issues and browser failures where they shouldn't have been. The tests were passing, but once I re-ran them 8 times on GitHub CI, they would start failing. I couldn't figure out what was the reason for spontaneous timeouts, so I started by replacing the web server from PHP's built-in one to FrankenPHP. It didn't solve it. I made the decision to move away from anything powered by Playwright. Currently, I'm in the process of rewriting it to Symfony's Panther and zenstruck/browser library and seeing whether I'd be able to get rid of random timeouts this way. Although now that I look at it, the shadow dom likely played a role here.

@osbre osbre marked this pull request as draft November 28, 2025 11:10
@adriaandotcom
Copy link
Copy Markdown
Contributor

Sounds good @osbre, let me know if you need any help!

@osbre osbre removed the request for review from Maimunar December 9, 2025 20:32
@adriaandotcom
Copy link
Copy Markdown
Contributor

Let me know how I can make this faster, @osbre

@osbre
Copy link
Copy Markdown
Contributor Author

osbre commented Mar 16, 2026

@adriaandotcom I'll take another look and should have it done by tomorrow 3pm (London / GMT). Thanks for the ping, had quite a few things going on lately 👀

Upd 2pm: looking into it now.

Upd 2: Coming slighly later today.

Upd 3 Wed morning: stil on it.

Upd 4: Thursday WIP

Upd 5: today Wed 8th Apr.

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.

2 participants