matomo-org / matomo

Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
https://matomo.org/
GNU General Public License v3.0
19.92k stars 2.66k forks source link

Fix overlay test that fails on the first day of the month / Fix overlay #22780

Open caddoo opened 2 days ago

caddoo commented 2 days ago

Description

A particular UI test always failed on the first day of the month. Due to the large shared fixture used for UI tests, probably this bit: https://github.com/matomo-org/matomo/blob/468d12b0bd21193cfcb2a05b6c6b838cc91839f0/tests/PHPUnit/Fixtures/UITestFixture.php#L278

Rather than modify that, I just changed the test to switch the view to 'yesterday' so the layout/values are consistent, as a bonus it also makes sure the period switcher works.

Additional

I also noticed that the sidebar didn't load on first load leading to an infinite spinner, it did work in the UI tests but not in when testing (see here for demo) so I've corrected that as well.

Testing

To test this change, I changed the date when running the UI tests using: exec('sudo date --set="2024-11-01 12:00:00"');

Here is the change running with the date 2024-11-05 and it passing. https://github.com/matomo-org/matomo/actions/runs/11926632491/job/33242601919#step:3:807

Here is the change running with the date 2024-11-01 and it passing. https://github.com/matomo-org/matomo/actions/runs/11927626971/job/33243296429#step:3:805

Review