From 8c3f495c64a5209f0110f49588c4840ff2cd07fe Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Tue, 21 Sep 2021 22:20:13 +0200 Subject: Improves Overlay UI tests (#17920) --- tests/PHPUnit/Fixtures/UITestFixture.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/PHPUnit/Fixtures') diff --git a/tests/PHPUnit/Fixtures/UITestFixture.php b/tests/PHPUnit/Fixtures/UITestFixture.php index 64972ea701..a862e3eef5 100644 --- a/tests/PHPUnit/Fixtures/UITestFixture.php +++ b/tests/PHPUnit/Fixtures/UITestFixture.php @@ -40,6 +40,7 @@ use Piwik\Plugins\UsersManager\Model; use Piwik\Plugins\UsersManager\UserUpdater; use Piwik\Plugins\VisitsSummary\API as VisitsSummaryAPI; use Piwik\ReportRenderer; +use Piwik\Tests\Framework\TestCase\SystemTestCase; use Piwik\Tests\Framework\XssTesting; use Piwik\Plugins\ScheduledReports\API as APIScheduledReports; use Psr\Container\ContainerInterface; @@ -311,7 +312,11 @@ class UITestFixture extends SqlDump public static function getLocalTestSiteUrl() { - return self::getRootUrl() . "tests/resources/overlay-test-site-real/"; + $url = self::getRootUrl() . "tests/resources/overlay-test-site-real/"; + + // when running tests on localhost we use 127.0.0.1 as url instead, so we have a different host in the iframe + // otherwise we would only test on the same host, which causes a lot less issues + return str_replace('localhost', '127.0.0.1', $url); } private function addNewSitesForSiteSelector() -- cgit v1.2.3