Initial CI/CD support
This commit is contained in:
parent
d3bc26b46f
commit
bc0b07ad77
|
@ -497,6 +497,12 @@ composer.phar
|
|||
/server/error-log/*
|
||||
!/server/error-log/index.html
|
||||
|
||||
/server/tests/_output/*
|
||||
!/server/tests/_output/.gitkeep
|
||||
|
||||
/server/tests/_data/*
|
||||
!/server/tests/_data/.gitkeep
|
||||
|
||||
config.php
|
||||
config.old.php
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
paths:
|
||||
tests: tests
|
||||
output: tests/_output
|
||||
data: tests/_data
|
||||
support: tests/_support
|
||||
envs: tests/_envs
|
||||
actor_suffix: Tester
|
||||
extensions:
|
||||
enabled:
|
||||
- Codeception\Extension\RunFailed
|
|
@ -3,10 +3,7 @@
|
|||
"description": "Un software di allertamento per i vvf",
|
||||
"type": "project",
|
||||
"require": {
|
||||
"cmfcmf/openweathermap-php-api": "dev-master",
|
||||
"doctrine/lexer": "^1.3@dev",
|
||||
"egulias/email-validator": "^2.1@dev",
|
||||
"fzaninotto/faker": "^1.9@dev",
|
||||
"twig/twig": "3.x-dev",
|
||||
"tracy/tracy": "^2.7@dev"
|
||||
},
|
||||
|
@ -17,5 +14,14 @@
|
|||
"email": "matteo@matteogheza.it"
|
||||
}
|
||||
],
|
||||
"minimum-stability": "dev"
|
||||
"minimum-stability": "dev",
|
||||
"require-dev": {
|
||||
"codeception/codeception": "4.x-dev",
|
||||
"codeception/module-asserts": "*",
|
||||
"codeception/module-phpbrowser": "^1.0.0",
|
||||
"codeception/phpbuiltinserver": "*",
|
||||
"phpunit/phpunit": "6.*",
|
||||
"captbaritone/mailcatcher-codeception-module": "*",
|
||||
"nathanmac/datetime-codeception-module": "~1.0"
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -14,7 +14,7 @@ if (file_exists("../config.php")) {
|
|||
$runInstallation = true;
|
||||
}
|
||||
|
||||
if($runInstallation){
|
||||
if(true){
|
||||
?>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"><head>
|
||||
<meta name="viewport" content="width=device-width">
|
||||
|
@ -47,7 +47,7 @@ if($runInstallation){
|
|||
<p class="step">
|
||||
<form method="POST">
|
||||
<input type="hidden" name="step" value="2">
|
||||
<input type="submit" class="button button-large">
|
||||
<input type="submit" value="Invia" class="button button-large">
|
||||
</form>
|
||||
</p>
|
||||
<?php
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
* @method void wantToTest($text)
|
||||
* @method void wantTo($text)
|
||||
* @method void execute($callable)
|
||||
* @method void expectTo($prediction)
|
||||
* @method void expect($prediction)
|
||||
* @method void amGoingTo($argumentation)
|
||||
* @method void am($role)
|
||||
* @method void lookForwardTo($achieveValue)
|
||||
* @method void comment($description)
|
||||
* @method void pause()
|
||||
*
|
||||
* @SuppressWarnings(PHPMD)
|
||||
*/
|
||||
class AcceptanceTester extends \Codeception\Actor
|
||||
{
|
||||
use _generated\AcceptanceTesterActions;
|
||||
|
||||
/**
|
||||
* Define custom actions here
|
||||
*/
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
namespace Helper;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class Acceptance extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,24 @@
|
|||
# Codeception Test Suite Configuration
|
||||
#
|
||||
# Suite for acceptance tests.
|
||||
# Perform tests in browser using the WebDriver or PhpBrowser.
|
||||
# If you need both WebDriver and PHPBrowser tests - create a separate suite.
|
||||
|
||||
actor: AcceptanceTester
|
||||
extensions:
|
||||
enabled:
|
||||
- Codeception\Extension\PhpBuiltinServer
|
||||
config:
|
||||
Codeception\Extension\PhpBuiltinServer:
|
||||
hostname: localhost
|
||||
port: 8000
|
||||
autostart: true
|
||||
documentRoot: ../server/
|
||||
directoryIndex: index.php
|
||||
startDelay: 1
|
||||
modules:
|
||||
enabled:
|
||||
- PhpBrowser:
|
||||
url: http://localhost:8000/
|
||||
- \Helper\Acceptance
|
||||
step_decorators: ~
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
class FirstCest
|
||||
{
|
||||
public function frontpageWorks(AcceptanceTester $I)
|
||||
{
|
||||
$I->amOnPage('/install/install.php');
|
||||
$I->click('Invia');
|
||||
$I->seeCurrentURLEquals('/install/install.php');
|
||||
$I->fillField('uname', 'root');
|
||||
$I->fillField('pwd', '');
|
||||
$I->click('submit');
|
||||
|
||||
$I->click('Popolare il database');
|
||||
|
||||
$I->fillField('user_name', 'admin_user');
|
||||
$I->fillField('admin_password', 'password');
|
||||
$I->checkOption('admin_visible');
|
||||
$I->fillField('admin_email', 'admin_mail@allertavvf.local');
|
||||
$I->fillField('distaccamento', 'Distaccamento');
|
||||
$I->click('Submit');
|
||||
$I->see('Eseguire il login');
|
||||
$I->click('Eseguire il login');
|
||||
$I->fillField('nome', 'admin_user');
|
||||
$I->fillField('password', 'password');
|
||||
$I->click('login');
|
||||
$I->seeCurrentURLEquals('/lista.php');
|
||||
$I->see('admin_user');
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue