1. Go to this page and download the library: Download luttje/livewire-gloom library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$parameters = ['John Doe']; // Optional, leave this out if you don't have parameters or wish to match any parameters
$browser->type('@name-input', 'John Doe')
->clickAndWaitUntilLivewireCommitSucceeds('@split-button-debounced', 'splitNameParts', $parameters)
->assertSeeIn('@first-name', 'John');
// ! This test fails sometimes when the button is kinda slow. In that case the waitUntilLivewireCommitSucceeds is in time (but that's not reliable).
$browser->type('@name-input', 'John Doe')
->click('@split-button')
// *🚀 hyperfast split-button somehow already completed a full commit here*
->waitUntilLivewireCommitSucceeds('splitNameParts', ['John Doe']) // test fails here due to timeout
->assertSeeIn('@first-name', 'John');
$browser->type('@name-input', 'John Doe')
->waitUntilLivewireCommitSucceeds(
'splitNameParts',
['John Doe'],
action: function () use ($browser) {
$browser->click('@split-button');
}
)
->assertSeeIn('@first-name', 'John');
class ExampleTest extends BrowserTestCase
{
public function testExample(): void
{
$this->browse(function (Browser $browser) {
$browser->visit('/example')
->type('@name-input', 'John Doe')
->clickAndWaitUntilLivewireCommitSucceeds('@split-button', 'splitNameParts', ['John Doe'])
->assertSeeIn('@first-name', 'John');
});
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.