initial partically working
This commit is contained in:
parent
1e35e485ad
commit
4cb9d078b1
1 changed files with 45 additions and 0 deletions
45
tests/Browser/UploadImageAdminTest.php
Normal file
45
tests/Browser/UploadImageAdminTest.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace Tests\Browser;
|
||||
|
||||
use Illuminate\Foundation\Testing\DatabaseTruncation;
|
||||
use Laravel\Dusk\Browser;
|
||||
use Tests\Browser\Concerns\AuthenticatesUsers;
|
||||
use Tests\DuskTestCase;
|
||||
|
||||
class LoginTest extends DuskTestCase
|
||||
{
|
||||
use DatabaseTruncation;
|
||||
use AuthenticatesUsers;
|
||||
|
||||
|
||||
|
||||
public function test_image_upload_admin_panel(): void
|
||||
{
|
||||
$user = $this->createTestUser("login-test@example.com");
|
||||
|
||||
$filePath = base_path('tests/Browser/fixtures/robot.webp');
|
||||
|
||||
$this->browse(function (Browser $browser ) use ($user, $filePath) {
|
||||
$this->loginUser($browser, $user);
|
||||
$this->assertWithDebugPause(
|
||||
$browser,
|
||||
fn($b) =>
|
||||
$b->visit('/admin/media')
|
||||
->waitForLocation('/admin/media')
|
||||
->assertPathIs('/admin/media')
|
||||
->assertTitleContains('Media')
|
||||
->clickLink('New media')
|
||||
->waitForText('Create Media')
|
||||
->pause(1000)
|
||||
->assertVisible('.filepond--drop-label')
|
||||
->attach('.filepond--browser', $filePath)
|
||||
->waitforText('Create')
|
||||
->clickLink('Create')
|
||||
// ->assertSee('Upload successful')
|
||||
->pause(10000),
|
||||
1000 // Custom pause time for this test
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue