Skip to content

Commit

Permalink
Fix Admin Servers Test
Browse files Browse the repository at this point in the history
  • Loading branch information
et-nik committed Sep 4, 2021
1 parent aa4f9bb commit cc65a3c
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 63 deletions.
1 change: 1 addition & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion tests/Browser/Admin/GamesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Tests\Browser\Admin;

use Gameap\Models\User;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;

Expand Down Expand Up @@ -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',
]);
}
}
5 changes: 4 additions & 1 deletion tests/Browser/Admin/ServersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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))
Expand Down
41 changes: 0 additions & 41 deletions tests/Browser/Pages/HomePage.php

This file was deleted.

20 changes: 0 additions & 20 deletions tests/Browser/Pages/Page.php

This file was deleted.

16 changes: 16 additions & 0 deletions tests/Context/Browser/Models/GameModContextTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Tests\Context\Browser\Models;

use Gameap\Models\GameMod;

trait GameModContextTrait
{
private function givenGameMod(): GameMod
{
return factory(GameMod::class)->create([
'game_code' => 'test',
'name' => 'Test Game Mod',
]);
}
}

0 comments on commit cc65a3c

Please sign in to comment.