Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
/vendor
.env
.env.backup
.env.dusk.local
.phpunit.cache/
.phpunit.result.cache
Homestead.json
Homestead.yaml
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
"uspdev/utils": "^1.1.0"
},
"require-dev": {
"spatie/laravel-ignition": "^2.0",
"fakerphp/faker": "^1.9.1",
"laravel/dusk": "^8.6",
"mockery/mockery": "^1.3.1",
"nunomaduro/collision": "^8.1",
"phpunit/phpunit": "^11.0"
"phpunit/phpunit": "^11.0",
"spatie/laravel-ignition": "^2.0"
},
"config": {
"optimize-autoloader": true,
Expand Down
148 changes: 144 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 56 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
services:
estagios:
image: estagios:latest
container_name: estagios
ports:
- "8000:80"
depends_on:
- mariadb
networks:
- estagios-network
volumes:
- ./:/var/www/html
environment:
HOME: /tmp
user: "${UID:-1000}:${GID:-1000}"

mariadb:
image: mariadb:11
container_name: estagios_mariadb
restart: always
environment:
MYSQL_DATABASE: estagios
MYSQL_USER: estagios
MYSQL_PASSWORD: estagios
MYSQL_ROOT_PASSWORD: estagios
volumes:
- mariadb_data:/var/lib/mysql
networks:
- estagios-network

selenium:
image: selenium/standalone-chrome
container_name: estagios_selenium
ports:
- "7900:7900" # VNC (pra ver o browser rodando)
networks:
- estagios-network
shm_size: 2gb

senhaunica-faker:
image: uspdev/senhaunica-faker
container_name: estagios_senhaunica-faker
ports:
- "3141:3141"
environment:
- APP_URL=http://auth.local:3141
networks:
estagios-network:
aliases:
- auth.local

networks:
estagios-network:

volumes:
mariadb_data:
15 changes: 15 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM uspdev/uspdev-php-apache:8.3

RUN sed -i 's|/var/www/html|/var/www/html/public|' \
/etc/apache2/sites-available/000-default.conf

USER www-data

COPY --chown=www-data . .

RUN composer install \
--no-dev \
--optimize-autoloader \
--no-interaction

CMD ["apache2-foreground"]
21 changes: 21 additions & 0 deletions tests/Browser/ExampleTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Tests\Browser;

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

class ExampleTest extends DuskTestCase
{
/**
* A basic browser test example.
*/
public function test_basic_example(): void
{
$this->browse(function (Browser $browser) {
$browser->visit('/')
->assertSee('Estágios');
});
}
}
36 changes: 36 additions & 0 deletions tests/Browser/Pages/HomePage.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

namespace Tests\Browser\Pages;

use Laravel\Dusk\Browser;

class HomePage extends Page
{
/**
* Get the URL for the page.
*/
public function url(): string
{
return '/';
}

/**
* Assert that the browser is on the page.
*/
public function assert(Browser $browser): void
{
//
}

/**
* Get the element shortcuts for the page.
*
* @return array<string, string>
*/
public function elements(): array
{
return [
'@element' => '#selector',
];
}
}
20 changes: 20 additions & 0 deletions tests/Browser/Pages/Page.php
Original file line number Diff line number Diff line change
@@ -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<string, string>
*/
public static function siteElements(): array
{
return [
'@element' => '#selector',
];
}
}
2 changes: 2 additions & 0 deletions tests/Browser/console/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions tests/Browser/screenshots/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions tests/Browser/source/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
Loading