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
24 changes: 18 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ APP_NAME='Sistema de Estágios'
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000
APP_URL=http://localhost:8000

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_CONNECTION=mariadb
DB_HOST=estagios_mariadb
DB_PORT=3306
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
DB_DATABASE=estagios
DB_USERNAME=estagios
DB_PASSWORD=estagios

BROADCAST_DRIVER=log
CACHE_DRIVER=file
Expand Down Expand Up @@ -112,3 +112,15 @@ SENHAUNICA_CODIGO_UNIDADE=

# Escolha o skin a ser utilizado (default=uspdev)
#USP_THEME_SKIN=


DUSK_DRIVER_URL='http://selenium:4444/wd/hub'
DUSK_START_MAXIMIZED=true
DUSK_HEADLESS_DISABLED=true

SENHAUNICA_KEY=faker
SENHAUNICA_SECRET=faker
SENHAUNICA_CALLBACK_ID=1
SENHAUNICA_ADMINS=111111
REPLICADO_FAKE=1
SENHAUNICA_DEV="http://auth.local:3141/wsusuario/oauth"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
/storage/*.key
/vendor
.env
.env.dusk.local
.env.backup
.phpunit.cache/
.phpunit.result.cache
Homestead.json
Homestead.yaml
Expand Down
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"]
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:
21 changes: 21 additions & 0 deletions tests/Browser/IndexTest.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 IndexTest 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',
];
}
}
Loading