Skip to content

Commit 2fd940f

Browse files
committed
e2e: use local url instead of example.org
1 parent 279bbf7 commit 2fd940f

5 files changed

Lines changed: 9 additions & 5 deletions

File tree

tests-e2e/site/app/Sharp/Commands/TestFormCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function executeTestFormCommand(mixed $instanceId, array $data = []): arr
3636
return match ($data['test_action']) {
3737
'download' => $this->download('file.pdf', 'file.pdf', 'fixtures'),
3838
'info' => $this->info('Info message : '.$data['text']),
39-
'link' => $this->link('https://example.org'),
39+
'link' => $this->link(route('test-page')),
4040
'reload' => tap($this->reload(), function () {
4141
TestModel::query()->update(['text' => 'Reloaded']);
4242
}),

tests-e2e/site/app/Sharp/Commands/TestLinkEntityCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public function label(): ?string
1313

1414
public function execute(array $data = []): array
1515
{
16-
return $this->link('https://example.org');
16+
return $this->link(route('test-page'));
1717
}
1818
}

tests-e2e/site/app/Sharp/Commands/TestLinkInstanceCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public function label(): ?string
1313

1414
public function execute(mixed $instanceId, array $data = []): array
1515
{
16-
return $this->link('https://example.org');
16+
return $this->link(route('test-page'));
1717
}
1818
}

tests-e2e/site/routes/web.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@
1919
->values();
2020
})
2121
->name('sharp.remote-autocomplete');
22+
23+
Route::get('/test', function () {
24+
return 'This is a test page';
25+
})->name('test-page');

tests-e2e/tests/commands.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function commandSuite(test: TestType<PlaywrightTestArgs & PlaywrightTestO
5353
await goto();
5454
await openCommandDropdown();
5555
await page.getByRole('menu').getByRole('menuitem', { name: 'Test link command' }).click();
56-
await page.waitForURL('https://example.org', { waitUntil: 'commit' });
56+
await page.waitForURL('/test', { waitUntil: 'commit' });
5757
});
5858
test('refresh', async ({ page, init, goto, openCommandDropdown, contentLocator }) => {
5959
await init();
@@ -114,7 +114,7 @@ export function commandFormResultSuite(test: TestType<PlaywrightTestArgs & Playw
114114
await page.getByRole('menu').getByRole('menuitem', { name: 'Test form command' }).click();
115115
await page.getByRole('dialog').getByRole('radio', { name: 'Link' }).click();
116116
await page.getByRole('dialog').getByRole('button', { name: 'Submit' }).click();
117-
await page.waitForURL('https://example.org', { waitUntil: 'commit' });
117+
await page.waitForURL('/test', { waitUntil: 'commit' });
118118
});
119119
test('reload', async ({ page, init, goto, openCommandDropdown, contentLocator }) => {
120120
await init();

0 commit comments

Comments
 (0)