Working on tests

This commit is contained in:
Hillel Coren 2018-03-08 08:54:26 +02:00
parent 44800d985e
commit 7165e73bce
3 changed files with 100 additions and 35 deletions

View File

@ -68,7 +68,7 @@
"require-dev": {
"symfony/dom-crawler": "~3.1",
"codeception/c3": "~2.0",
"codeception/codeception": "2.3.3",
"codeception/codeception": "2.*",
"phpspec/phpspec": "~2.1",
"phpunit/phpunit": "~5.7"
},

119
composer.lock generated
View File

@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"hash": "7ee707d4d8d5e695a06f09148055a914",
"content-hash": "6d17fba6edb89baff674e8d4a89e00e5",
"hash": "dcf45ca36bb89b54343dae0f91025c98",
"content-hash": "db2095745f78028aa6c6152c89f398d9",
"packages": [
{
"name": "abdala/omnipay-pagseguro",
@ -11351,61 +11351,58 @@
},
{
"name": "codeception/codeception",
"version": "2.3.3",
"version": "2.4.0",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Codeception.git",
"reference": "67cd520b4f20cdfc3a52d1a0022924125822a8e6"
"reference": "c50789a9a62cc0eefc0252e88a5f04f8c47b55f4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/67cd520b4f20cdfc3a52d1a0022924125822a8e6",
"reference": "67cd520b4f20cdfc3a52d1a0022924125822a8e6",
"url": "https://api.github.com/repos/Codeception/Codeception/zipball/c50789a9a62cc0eefc0252e88a5f04f8c47b55f4",
"reference": "c50789a9a62cc0eefc0252e88a5f04f8c47b55f4",
"shasum": ""
},
"require": {
"behat/gherkin": "~4.4.0",
"behat/gherkin": "^4.4.0",
"codeception/phpunit-wrapper": "^6.0|^7.0",
"codeception/stub": "^1.0",
"ext-json": "*",
"ext-mbstring": "*",
"facebook/webdriver": ">=1.0.1 <2.0",
"facebook/webdriver": ">=1.1.3 <2.0",
"guzzlehttp/guzzle": ">=4.1.4 <7.0",
"guzzlehttp/psr7": "~1.0",
"php": ">=5.4.0 <8.0",
"phpunit/php-code-coverage": ">=2.2.4 <6.0",
"phpunit/phpunit": ">4.8.20 <7.0",
"phpunit/phpunit-mock-objects": ">2.3 <5.0",
"sebastian/comparator": ">1.1 <3.0",
"sebastian/diff": "^1.4",
"stecman/symfony-console-completion": "^0.7.0",
"symfony/browser-kit": ">=2.7 <4.0",
"symfony/console": ">=2.7 <4.0",
"symfony/css-selector": ">=2.7 <4.0",
"symfony/dom-crawler": ">=2.7.5 <4.0",
"symfony/event-dispatcher": ">=2.7 <4.0",
"symfony/finder": ">=2.7 <4.0",
"symfony/yaml": ">=2.7 <4.0"
"symfony/browser-kit": ">=2.7 <5.0",
"symfony/console": ">=2.7 <5.0",
"symfony/css-selector": ">=2.7 <5.0",
"symfony/dom-crawler": ">=2.7 <5.0",
"symfony/event-dispatcher": ">=2.7 <5.0",
"symfony/finder": ">=2.7 <5.0",
"symfony/yaml": ">=2.7 <5.0"
},
"require-dev": {
"codeception/specify": "~0.3",
"facebook/graph-sdk": "~5.3",
"flow/jsonpath": "~0.2",
"league/factory-muffin": "^3.0",
"league/factory-muffin-faker": "^1.0",
"mongodb/mongodb": "^1.0",
"monolog/monolog": "~1.8",
"pda/pheanstalk": "~3.0",
"php-amqplib/php-amqplib": "~2.4",
"predis/predis": "^1.0",
"squizlabs/php_codesniffer": "~2.0",
"symfony/process": ">=2.7 <5.0",
"vlucas/phpdotenv": "^2.4.0"
},
"suggest": {
"aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module",
"codeception/phpbuiltinserver": "Start and stop PHP built-in web server for your tests",
"codeception/specify": "BDD-style code blocks",
"codeception/verify": "BDD-style assertions",
"flow/jsonpath": "For using JSONPath in REST module",
"league/factory-muffin": "For DataFactory module",
"league/factory-muffin-faker": "For Faker support in DataFactory module",
"phpseclib/phpseclib": "for SFTP option in FTP Module",
"stecman/symfony-console-completion": "For BASH autocompletion",
"symfony/phpunit-bridge": "For phpunit-bridge support"
},
"bin": [
@ -11441,7 +11438,79 @@
"functional testing",
"unit testing"
],
"time": "2017-06-02 00:22:30"
"time": "2018-02-27 00:09:12"
},
{
"name": "codeception/phpunit-wrapper",
"version": "6.0.5",
"source": {
"type": "git",
"url": "https://github.com/Codeception/phpunit-wrapper.git",
"reference": "44e2100c300413a6b40cf8874ad402695010f443"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/44e2100c300413a6b40cf8874ad402695010f443",
"reference": "44e2100c300413a6b40cf8874ad402695010f443",
"shasum": ""
},
"require": {
"phpunit/php-code-coverage": ">=2.2.4 <6.0",
"phpunit/phpunit": ">=4.8.28 <5.0.0 || >=5.6.3 <7.0",
"sebastian/comparator": ">1.1 <3.0",
"sebastian/diff": ">=1.4 <4.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Codeception\\PHPUnit\\": "src\\"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Davert",
"email": "davert.php@resend.cc"
}
],
"description": "PHPUnit classes used by Codeception",
"time": "2018-02-19 13:24:40"
},
{
"name": "codeception/stub",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/Codeception/Stub.git",
"reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Codeception/Stub/zipball/95fb7a36b81890dd2e5163e7ab31310df6f1bb99",
"reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99",
"shasum": ""
},
"require": {
"phpunit/phpunit-mock-objects": ">2.3 <7.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.8 <8.0"
},
"type": "library",
"autoload": {
"psr-4": {
"Codeception\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"description": "Flexible Stub wrapper for PHPUnit's Mock Builder",
"time": "2018-02-18 13:56:56"
},
{
"name": "doctrine/instantiator",

View File

@ -26,15 +26,11 @@ class AcceptanceTester extends \Codeception\Actor
*/
function checkIfLogin(\AcceptanceTester $I)
{
try {
$I->amOnPage('/login?lang=en');
$I->see('Login');
$I->fillField(['name' => 'email'], Fixtures::get('username'));
$I->fillField(['name' => 'password'], Fixtures::get('password'));
$I->click('Login');
} catch (Exception $e) {
// do nothing
}
$I->amOnPage('/login?lang=en');
$I->see('Login');
$I->fillField(['name' => 'email'], Fixtures::get('username'));
$I->fillField(['name' => 'password'], Fixtures::get('password'));
$I->click('Login');
}
function selectDataPicker(\AcceptanceTester $I, $element, $date = 'now')