From f7ed8af52ad09f758f5c92c1b446c6321beb6f2f Mon Sep 17 00:00:00 2001 From: Lance Pioch Date: Thu, 27 Oct 2022 22:39:01 -0400 Subject: [PATCH] Get the port out --- tests/Browser/MainTest.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/Browser/MainTest.php b/tests/Browser/MainTest.php index 27bc542cd..522a16c64 100644 --- a/tests/Browser/MainTest.php +++ b/tests/Browser/MainTest.php @@ -37,7 +37,13 @@ class MainTest extends DuskTestCase $this->artisan('migrate --seed --force'); $this->browse(function (Browser $browser) use ($login, $pass) { - [$protocol, $panelDomain] = explode('://', config('app.url'), 2); + [$panelProtocol, $panelUrl] = explode('://', config('app.url'), 2); + + $panelDomain = $panelUrl; + if (str_contains($panelUrl, ':')) { + [$panelDomain, $panelPort] = explode(':', $panelUrl, 2); + } + $panelPort ??= '80'; // Test Failed Login $browser->visit('/auth/login'); @@ -109,7 +115,7 @@ class MainTest extends DuskTestCase $browser->type('memory_overallocate', '0'); $browser->type('disk', '1024'); $browser->type('disk_overallocate', '0'); - $browser->type('daemonListen', '80'); + $browser->type('daemonListen', $panelPort); $browser->clickAndWaitForReload('button[type=submit]'); $browser->assertPathIs('/admin/nodes/view/1/allocation');