Skip to content

Commit 4f28274

Browse files
committed
wip
1 parent 699f0aa commit 4f28274

5 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/Autoload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function page(?string $url = null, array $options = []): Page
2222
$page = $browser->newContext($options)->newPage();
2323

2424
if ($url !== null) {
25-
$page->goto($url);
25+
$page->goto($url, $options);
2626
}
2727

2828
return $page;

src/Playwright/Page.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function url(): string
4040
/**
4141
* Navigates to the given URL.
4242
*/
43-
public function goto(string $url): self
43+
public function goto(string $url, array $options = []): self
4444
{
4545
if (! str_starts_with($url, 'http://') && ! str_starts_with($url, 'https://')) {
4646
$url = mb_ltrim($url, '/');
@@ -52,7 +52,10 @@ public function goto(string $url): self
5252
return $this;
5353
}
5454

55-
$response = $this->sendMessage('goto', ['url' => $url, 'waitUntil' => 'load']);
55+
$response = $this->sendMessage('goto', [
56+
...['url' => $url, 'waitUntil' => 'load'],
57+
...$options,
58+
]);
5659

5760
$this->processNavigationResponse($response);
5861

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function boot(): void
3636
}
3737

3838
Client::instance()->connectTo(
39-
ServerManager::instance()->playwright()->url().'?browser=chromium',
39+
'127.0.0.1:8077/?browser=chromium',
4040
);
4141

4242
if (Parallel::isEnabled() === false || Parallel::isWorker()) {

src/Support/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public function url(): string
107107
'port' => $this->port,
108108
'until' => $this->until,
109109
]),
110-
));
110+
));
111111
}
112112

113113
return sprintf('%s:%d', $this->host, $this->port);

tests/Browser/Playwright/Page/WaitForURLTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44

55
it('waits for URL pattern', function (): void {
66
$page = page('/test/frame-tests');
7+
78
$currentUrl = '/test/selector-tests';
9+
810
$page->waitForURL($currentUrl);
911

1012
expect(true)->toBeTrue();

0 commit comments

Comments
 (0)