forked from coollabsio/coolify
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bb7184b
commit 2eef8ee
Showing
10 changed files
with
117 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,4 @@ yarn-error.log | |
.rnd | ||
/.ssh | ||
.ignition.json | ||
.env.dusk.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,4 @@ _ide_helper_models.php | |
/.ssh | ||
scripts/load-test/* | ||
.ignition.json | ||
.env.dusk.local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class DuskServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register Dusk's browser macros. | ||
*/ | ||
public function boot(): void | ||
{ | ||
\Laravel\Dusk\Browser::macro('loginWithRootUser', function () { | ||
return $this->visit('/login') | ||
->type('email', '[email protected]') | ||
->type('password', 'password') | ||
->press('Login'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,10 @@ class LoginTest extends DuskTestCase | |
*/ | ||
public function testLogin() | ||
{ | ||
$email = '[email protected]'; | ||
$password = 'password'; | ||
$this->browse(function (Browser $browser) use ($password, $email) { | ||
$browser->visit('/login') | ||
->type('email', $email) | ||
->type('password', $password) | ||
->press('Login') | ||
$this->browse(callback: function (Browser $browser) { | ||
$browser->loginWithRootUser() | ||
->assertPathIs('/') | ||
->screenshot('login'); | ||
->assertSee('Dashboard'); | ||
}); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Tests\Browser; | ||
|
||
use Laravel\Dusk\Browser; | ||
use Tests\DuskTestCase; | ||
use Throwable; | ||
|
||
class ProjectAddNewTest extends DuskTestCase | ||
{ | ||
/** | ||
* A basic test for the projects page. | ||
* Login with the test user and assert that the user is redirected to the projects page. | ||
* | ||
* @return void | ||
* | ||
* @throws Throwable | ||
*/ | ||
public function testLogin() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$browser->loginWithRootUser() | ||
->visit('/projects') | ||
->pressAndWaitFor('+ Add', 1) | ||
->assertSee('New Project') | ||
->screenshot('project-add-new-1') | ||
->type('name', 'Test Project') | ||
->screenshot('project-add-new-2') | ||
->press('Continue') | ||
->assertSee('Test Project.') | ||
->screenshot('project-add-new-3'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace Tests\Browser; | ||
|
||
use Laravel\Dusk\Browser; | ||
use Tests\DuskTestCase; | ||
use Throwable; | ||
|
||
class ProjectSearchTest extends DuskTestCase | ||
{ | ||
/** | ||
* A basic test for the projects page. | ||
* Login with the test user and assert that the user is redirected to the projects page. | ||
* | ||
* @return void | ||
* | ||
* @throws Throwable | ||
*/ | ||
public function testLogin() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$browser->loginWithRootUser() | ||
->visit('/projects') | ||
->type('[x-model="search"]', 'joi43j4oi32j4o2') | ||
->assertSee('No project found with the search term "joi43j4oi32j4o2".') | ||
->screenshot('project-search-not-found'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
namespace Tests\Browser; | ||
|
||
use Laravel\Dusk\Browser; | ||
use Tests\DuskTestCase; | ||
use Throwable; | ||
|
||
class ProjectTest extends DuskTestCase | ||
{ | ||
/** | ||
* A basic test for the projects page. | ||
* Login with the test user and assert that the user is redirected to the projects page. | ||
* | ||
* @return void | ||
* | ||
* @throws Throwable | ||
*/ | ||
public function testLogin() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$browser->loginWithRootUser() | ||
->visit('/projects') | ||
->assertSee('Projects'); | ||
}); | ||
} | ||
} |