diff --git a/.drone.yml b/.drone.yml index 12a86ab1..f9bdcbcc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -139,6 +139,7 @@ steps: from_secret: s3_secret_key source: - tests/Browser/screenshots/* + - tests/Browser/console/* - /var/log/gameap-daemon/* target: /${DRONE_BRANCH}/${DRONE_BUILD_NUMBER} path_style: true diff --git a/tests/Browser/Admin/GamesTest.php b/tests/Browser/Admin/GamesTest.php index 73165f3c..d11d940c 100644 --- a/tests/Browser/Admin/GamesTest.php +++ b/tests/Browser/Admin/GamesTest.php @@ -3,7 +3,6 @@ namespace Tests\Browser\Admin; use Gameap\Models\User; -use Illuminate\Foundation\Testing\DatabaseMigrations; use Laravel\Dusk\Browser; use Tests\DuskTestCase; @@ -78,5 +77,10 @@ public function testCreateMod() ->assertPathIs('/admin/games') ->assertSee(__('games.mod_create_success_msg')); }); + + $this->assertDatabaseHas('game_mods', [ + 'game_code' => 'test', + 'name' => 'Default', + ]); } } diff --git a/tests/Browser/Admin/ServersTest.php b/tests/Browser/Admin/ServersTest.php index ae0d4f97..f8a32e85 100644 --- a/tests/Browser/Admin/ServersTest.php +++ b/tests/Browser/Admin/ServersTest.php @@ -2,15 +2,16 @@ namespace Tests\Browser\Admin; -use Facebook\WebDriver\WebDriverKeys; use Gameap\Models\User; use Laravel\Dusk\Browser; +use Tests\Context\Browser\Models\GameModContextTrait; use Tests\Context\Browser\Models\ServerContextTrait; use Tests\DuskTestCase; class ServersTest extends DuskTestCase { use ServerContextTrait; + use GameModContextTrait; public function testCreate() { @@ -65,6 +66,8 @@ public function testCreate() public function testEdit() { + $this->givenGameMod(); + $this->browse(function (Browser $browser) { $gameServer = $this->givenGameServer(); $browser->loginAs(User::find(1)) diff --git a/tests/Browser/Pages/HomePage.php b/tests/Browser/Pages/HomePage.php deleted file mode 100644 index 26bf174f..00000000 --- a/tests/Browser/Pages/HomePage.php +++ /dev/null @@ -1,41 +0,0 @@ - '#selector', - ]; - } -} diff --git a/tests/Browser/Pages/Page.php b/tests/Browser/Pages/Page.php deleted file mode 100644 index f8d76222..00000000 --- a/tests/Browser/Pages/Page.php +++ /dev/null @@ -1,20 +0,0 @@ - '#selector', - ]; - } -} diff --git a/tests/Context/Browser/Models/GameModContextTrait.php b/tests/Context/Browser/Models/GameModContextTrait.php new file mode 100644 index 00000000..aa99f98b --- /dev/null +++ b/tests/Context/Browser/Models/GameModContextTrait.php @@ -0,0 +1,16 @@ +create([ + 'game_code' => 'test', + 'name' => 'Test Game Mod', + ]); + } +}