Skip to content

Commit

Permalink
Merge pull request #100 from lageIBUSP/cypress
Browse files Browse the repository at this point in the history
Cypress
  • Loading branch information
Lobz authored Apr 10, 2024
2 parents 3872723 + e074c3b commit 70c5688
Show file tree
Hide file tree
Showing 18 changed files with 2,610 additions and 9 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,21 @@ docker exec -t notar_app_1 php artisan migrate
docker exec -t notar_app_1 php artisan migrate:admin novasenha
```

## Rodando os testes de integração

**ATENÇÃO: ESSES TESTES DESTROEM SEU BANCO DE DADOS LOCAL. NÃO RODE EM PRODUÇÃO**

Os testes foram escritos para ajudar no desenvolvimento da plataforma. Todos os dados do banco de dados são destruídos antes dos testes, para evitar conflitos. Os testes foram desenvolvidos em [Cypress](https://www.cypress.io/) usando o pacote de cypress para laravel [laracasts/cypress](https://github.com/laracasts/cypress). Alguns arquivos foram gerados automaticamente usando o comanto `php artisan cypress:boilerplate`.

Para testar e desenvolver a plataforma, instale o notaR no seu ambiente local para testes, seguindo o guia acima. Além disso, é necessário instalar o `npm`. Com isso, para abrir a interface gráfica do `cypress`, basta executar o seguinte comando:

```
npx cypress run
```

Na interface gráfica, selecione **E2E Testing**, e um browser à sua escolha.

Para mais detalhes, consulte a [documentação do Cypress](https://docs.cypress.io/).

## Licença de uso
O código fonte do notaR está disponível sob licença GPLv3.
3 changes: 2 additions & 1 deletion app/Console/Commands/MigrateAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ public function handle()
}
User::create([
'email' => '[email protected]',
'name' => 'Admin',
'is_admin' => true,
'password' => $this->argument('password')
]);

$this->info('User [email protected] created!');

return 0;
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
"fakerphp/faker": "^1.9.1",
"laracasts/cypress": "^3.0",
"laravel/breeze": "^2.0",
"laravel/sail": "^1.29",
"laravel/ui": "^4.0",
Expand Down
61 changes: 60 additions & 1 deletion composer.lock

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

19 changes: 19 additions & 0 deletions cypress.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { defineConfig } = require('cypress')

module.exports = defineConfig({
chromeWebSecurity: false,
retries: 0,
defaultCommandTimeout: 5000,
watchForFileChanges: false,
videosFolder: 'tests/cypress/videos',
screenshotsFolder: 'tests/cypress/screenshots',
fixturesFolder: 'tests/cypress/fixture',
e2e: {
setupNodeEvents(on, config) {
return require('./tests/cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:8000',
specPattern: 'tests/cypress/integration/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'tests/cypress/support/index.js',
},
})
Loading

0 comments on commit 70c5688

Please sign in to comment.