Update to 6.6

This commit is contained in:
Mathieu Lagace
2019-12-04 20:58:20 -05:00
parent c916e5e580
commit 09523f2bb0
17 changed files with 1666 additions and 605 deletions

1
.phpunit.result.cache Normal file
View File

@@ -0,0 +1 @@
C:30:"PHPUnit\Runner\TestResultCache":187:{a:2:{s:7:"defects";a:1:{s:32:"Tests\Browser\UserTest::testUser";i:3;}s:5:"times";a:2:{s:34:"Tests\Browser\LoginTest::testLogin";d:5.605;s:32:"Tests\Browser\UserTest::testUser";d:14.139;}}}

View File

@@ -5,18 +5,21 @@
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
"php": "^7.1.3", "php": "^7.2",
"barryvdh/laravel-dompdf": "^0.8.4", "barryvdh/laravel-dompdf": "^0.8.4",
"barryvdh/laravel-ide-helper": "v2.6.2", "barryvdh/laravel-ide-helper": "v2.6.6",
"fideloper/proxy": "^4.0", "fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3", "guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.6.*", "laravel/framework": "^6.0",
"laravel/helpers": "^1.1",
"laravel/nexmo-notification-channel": "^2.2",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"nexmo/client": "^1.4" "nexmo/client": "^2.0"
}, },
"require-dev": { "require-dev": {
"filp/whoops": "^2.0", "filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4", "fzaninotto/faker": "^1.4",
"laravel/dusk": "^5.6",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0", "nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0" "phpunit/phpunit": "^7.0"

2063
composer.lock generated

File diff suppressed because it is too large Load Diff

4
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,6 @@
{ {
"/js/app.js": "/js/app.js", "/js/app.js": "/js/app.js",
"/css/app.css": "/css/app.css",
"/css/material-dashboard.css": "/css/material-dashboard.css",
"/css/custom.css": "/css/custom.css" "/css/custom.css": "/css/custom.css"
} }

View File

@@ -25,15 +25,15 @@
<td>{{$item->rank->name}}</td> <td>{{$item->rank->name}}</td>
<td>{{$item->job->name}}</td> <td>{{$item->job->name}}</td>
<td class="td-actions text-right" style="width: 12%;"> <td class="td-actions text-right" style="width: 12%;">
<a class="btn btn-info p-2 text-white" href="/admin/user/edit/{{$item->id}}"><i class="material-icons">edit</i></a> <a class="btn btn-info p-2 text-white" dusk="edit-btn-{{$item->id}}" href="/admin/user/edit/{{$item->id}}"><i class="material-icons">edit</i></a>
<a class="btn btn-danger p-2 text-white" onclick="deleteEvent({{$item->id}});"><i class="material-icons">close</i></a> <a class="btn btn-danger p-2 text-white" dusk="delete-btn-{{$item->id}}" onclick="deleteEvent({{$item->id}});"><i class="material-icons">close</i></a>
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
<hr> <hr>
<a href="/admin/user/add" class="btn btn-primary btn-lg btn-block">Ajouter un utilisateur</a> <a dusk="add-user-btn" href="/admin/user/add" class="btn btn-primary btn-lg btn-block">Ajouter un utilisateur</a>
</div> </div>
</div> </div>
</div> </div>

View File

@@ -109,9 +109,7 @@
</div> </div>
<div class="form-group row"> <div class="form-group row">
<div class="col-md-12"> <div class="col-md-12">
<button type="submit" class="btn btn-primary btn-block"> <input dusk="login-button" type="submit" class="btn btn-primary btn-block" value="Connexion test" />
Connexion
</button>
</div> </div>
</div> </div>
</form> </form>

3
start.sh Normal file
View File

@@ -0,0 +1,3 @@
php artisan serve &
npm run watch &
~/.local/share/umake/web/firefox-dev/./firefox http://127.0.0.1:8000/

View File

@@ -1,2 +1,3 @@
* *
!.gitignore !data/
!.gitignore

2
storage/framework/cache/data/.gitignore vendored Executable file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

View File

@@ -0,0 +1,21 @@
<?php
namespace Tests\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
class LoginTest extends DuskTestCase
{
public function testLogin()
{
$this->browse(function (Browser $browser) {
$browser->visit('/login')
->type('email','admin@exvps.ca')
->type('password','SuperAdmin')
->click('@login-button')
->assertPathIs('/admin');
});
}
}

View File

@@ -0,0 +1,41 @@
<?php
namespace Tests\Browser\Pages;
use Laravel\Dusk\Browser;
class HomePage extends Page
{
/**
* Get the URL for the page.
*
* @return string
*/
public function url()
{
return '/';
}
/**
* Assert that the browser is on the page.
*
* @param \Laravel\Dusk\Browser $browser
* @return void
*/
public function assert(Browser $browser)
{
//
}
/**
* Get the element shortcuts for the page.
*
* @return array
*/
public function elements()
{
return [
'@element' => '#selector',
];
}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace Tests\Browser\Pages;
use Laravel\Dusk\Page as BasePage;
abstract class Page extends BasePage
{
/**
* Get the global element shortcuts for the site.
*
* @return array
*/
public static function siteElements()
{
return [
'@element' => '#selector',
];
}
}

View File

@@ -0,0 +1,43 @@
<?php
namespace Tests\Browser;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Laravel\Dusk\Browser;
use Tests\DuskTestCase;
class UserTest extends DuskTestCase
{
public function testUser()
{
$this->browse(function (Browser $browser) {
$browser->loginAs(\App\User::find(2))
->visit('/admin/user')
->assertSee('Autre visiteur')
->assertSee('Administrateur Administrateur')
->click('@add-user-btn')
->assertPathIs('/admin/user/add')
->type('firstname','Test')
->type('lastname','User')
->type('email','test@exvps.ca')
->type('emailc','test@exvps.ca')
->type('adresse','14 ave Des Rue, Rimouski')
->type('telephone','4187544158')
->select('sexe','Femme')
->type('age','55')
->select('rank','SuperAdmin')
->select('job','Indéterminé')
->type('psw','SuperAdmin')
->type('pswc','SuperAdmin')
->click('#submit')
->assertSee('User Test')
->click('@edit-btn-'.\App\User::all()->where('firstname','=','Test')->first()->id)
->type('lastname','test')
->click('#submit')
->assertSee('test Test')
->click('@delete-btn-'.\App\User::all()->where('firstname','=','Test')->first()->id)
->press('Oui')
->press('OK');
});
}
}

2
tests/Browser/console/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

2
tests/Browser/screenshots/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

43
tests/DuskTestCase.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
namespace Tests;
use Laravel\Dusk\TestCase as BaseTestCase;
use Facebook\WebDriver\Chrome\ChromeOptions;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\Remote\DesiredCapabilities;
abstract class DuskTestCase extends BaseTestCase
{
use CreatesApplication;
/**
* Prepare for Dusk test execution.
*
* @beforeClass
* @return void
*/
public static function prepare()
{
static::startChromeDriver();
}
/**
* Create the RemoteWebDriver instance.
*
* @return \Facebook\WebDriver\Remote\RemoteWebDriver
*/
protected function driver()
{
$options = (new ChromeOptions)->addArguments([
'--disable-gpu',
'--window-size=1920,1080',
]);
return RemoteWebDriver::create(
'http://localhost:9515', DesiredCapabilities::chrome()->setCapability(
ChromeOptions::CAPABILITY, $options
)
);
}
}