tests / feature (8.4) (push) Successful in 1m50s
tests / feature (8.5) (push) Successful in 1m54s
tests / browser (chrome, chromium) (push) Successful in 7m52s
tests / browser (firefox, firefox) (push) Successful in 11m56s
tests / browser (safari, webkit) (push) Successful in 12m35s
The browser plugin runs every call on a page again when its first attempt takes over a second, and on the runner a press can. For most presses that costs nothing. For two kinds it breaks the test: a press that opens a dialog, a sheet, a full-screen view or a modal rail over its own trigger, whose second press can never land, and a press that changes state a second one would change again — a menu trigger, a toggle, a chip, a range picker's day, a paging key, a Save. The bottom sheet with preset heights timed out on WebKit that way after the date picker had on Firefox. Every such press in the browser suite now goes through pressOnce(), 253 of them across sixteen files, not only the ones the runner happened to catch; focus moves inside an open view, Escape, links and plain "set" actions keep the retry, which is harmless for them. Two samples that were still racing the machine: - The standard side sheet's exit is caught half-way with its motion stretched, as every other mid-exit sample is, and fullSpeed() takes the stretch off again before the test times a reopen against the real exit. Under load on Linux WebKit it had failed two runs in five; it passes ten in ten. - The switch-and-checkbox row measures its widths once, so it now waits for the resize to land and the brand face to load before it does. Browser 300 passed on Firefox and WebKitGTK in a Linux container held to two busy cores, and on Chrome, Firefox and WebKit on macOS. Feature 1159 passed. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
59 lines
2.4 KiB
PHP
59 lines
2.4 KiB
PHP
<?php
|
|
|
|
it('opens the showcase in a real browser', function () {
|
|
visit('/material')
|
|
->assertSee('Livewire Material')
|
|
->assertNoJavaScriptErrors();
|
|
});
|
|
|
|
it('moves between sections through the rail and the next-section link, keeping the rail', function () {
|
|
$page = ready(visit('/material'));
|
|
|
|
$page->click('[data-md-navigation-rail-panel] a[href$="/material/buttons"]')
|
|
->assertSee('Variants')
|
|
->assertScript("document.querySelector('[data-md-navigation-rail-panel] [aria-current=\"page\"]').getAttribute('href').endsWith('/material/buttons')")
|
|
->assertScript("document.title === 'Buttons · Livewire Material'");
|
|
|
|
$page->click('[data-test="next-section"]')
|
|
->assertScript("location.pathname.endsWith('/material/menus')")
|
|
->assertNoJavaScriptErrors();
|
|
});
|
|
|
|
it('finds a component from anywhere and opens its section', function () {
|
|
$page = ready(visit('/material/buttons'));
|
|
|
|
// "/" opens the search view: pressOnce(), tests/Pest.php.
|
|
pressOnce($page)->keys('#content', '/');
|
|
|
|
$page->assertScript("document.activeElement.id === 'showcase-search'");
|
|
|
|
$page->type('#showcase-search', 'datepicker')
|
|
->assertSeeIn('[data-md-search-view]', '<x-datepicker>');
|
|
|
|
$page->keys('#showcase-search', 'Enter')
|
|
->assertScript("location.pathname.endsWith('/material/pickers')")
|
|
->assertScript("document.title === 'Date pickers · Livewire Material'");
|
|
});
|
|
|
|
it('opens an example on another page at the example', function () {
|
|
$page = ready(visit('/material'));
|
|
|
|
// Opens the search view over the field that triggers it: pressOnce(), tests/Pest.php.
|
|
pressOnce($page)->click('#showcase-search');
|
|
|
|
$page->type('#showcase-search', 'split button')
|
|
->click('[data-showcase-result]:has-text("Example")')
|
|
->assertScript("location.pathname.endsWith('/material/buttons') && location.hash.startsWith('#example-')")
|
|
->assertScript('(() => { const box = document.getElementById(decodeURIComponent(location.hash.slice(1))).getBoundingClientRect(); return box.top >= 0 && box.top < innerHeight; })()');
|
|
});
|
|
|
|
it('says so when nothing matches', function () {
|
|
$page = ready(visit('/material'));
|
|
|
|
// Opens the search view over the field that triggers it: pressOnce(), tests/Pest.php.
|
|
pressOnce($page)->click('#showcase-search');
|
|
|
|
$page->type('#showcase-search', 'zzzz')
|
|
->assertSeeIn('[data-md-search-view]', 'Nothing matches');
|
|
});
|