CHANGELOG-2.x.md
loadSessionSnapshot with php-webdriver 1.1.3 by @Naktibalda.formaction attribute in button to submit forms. By @DezzpilseeQueueIsEmpty, dontSeeQueueIsEmpty, seeNumberOfMessagesInQueue, scheduleQueueCleanup method by @kardagan@dataProvider works with yield/generators #5271 by @burned42--phpunit-xml option, which produces xml report having the same structure as PhpUnit's #5004 by @Naktibalda-s #5275 by @Naktibalda_loadDump unconditional like it was in 2.4. Fixed #5195 by @NaktibaldawaitForElementClickable by @FatBoyXPCwork_dir config option to map remote paths to local. See #5225 by @FenikkusugetApplication() API by @SlamdunkgetApplication() by @Slamdunkssession config option to override session class. By @FenikkusuexpectThrowable() method by @burned42*.yaml for params loadingamConnectedToDatabase method added.performInDatabase method added.seeLink now matches the end of a URL, instead of partial matching. By @Slamdunk
$I->seeLink('Delete','/post/1'); matches <a href="/post/199">Delete</a>$I->seeLink('Delete','/post/1'); does NOT match <a href="/post/199">Delete</a>loadSessionSnapshot. Fix by @rajrasToo many connections issue #4926. By @roslovamLoggedInAs() throws TypeError. By @SamMousacodecept_log function to write to logs from any place. Fixes #3551 by @siad007see() and dontSee() are used with array selector. Fix by @Naktibalda.findRecord() by @arjanwestdorpmemory_limit to dry-run command by @siad007. Fixes #5090coverage: show_only_summary configurable. See #5142 by @Quexer69mbstring is available by @siad007. Fixes #4575ssl_cipher - list of one or more permissible ciphers to use for SSL encryptionssl_verify_server_cert - disables certificate CN verificationreconnect is set. By @ashnazgextends property in the codeception.yml and *.suite.yml files now support absolute paths; by @silverfire$expectedCount to seeEmailIsSentdontSeeEmailIsSentignore_steps option to disable recording of specific steps. By @sspat.waitlock config option for the database session to wait for lock in Oracle. By @ashnazg. See #5069seeXmlResponseEquals by @VozivassertNotTrue and assertNotFalse methods; by @johannesschobelHttp Status Ranges with nice "wrappers" (e.g., seeHttpStatusCodeIsSuccessful() checks the code between 200 and 299); by @johannesschobelextends in the codeception.yml and *.suite.yml files; by @johannesschobel.
Allows to inherit current config from a provided file. See example for functional.suite.yml:actor: FunctionalTester
extends: shared.functional.suite.yml
modules:
enabled:
- \App\Modules\X\Tests\Helper\Functional
_after. By @SamMousa. See #4928$settings['configFile'] now supports absolute paths. In you have defined relative path to config in absolute mannerdeleteSessionSnapshot by @vi4okernel_class config option. By @omnilight.expectException by @Slamdunknull values in MSSQL driver by @philek$this->getModule('Yii2'')->app, now you must use \Yii::$app everywhere$settings['path'] in Codeception\Configuration::suiteSettings() on Windows by @olegpro/), you must change it. @silverfirecallArtisan method in Laravel5 module. See #4860 by @mohamed-aimanparse_url. See #4853 by @quantum-xshims for underscore PHPUnit classes > namespaced PHP classes_failed called when test fails_passed called when tests is successful_after is called for failing and successful testsUpgrade Notice: If you face issues with underscore PHPUnit class names (like PHPUnit_Framework_Assert) you have two options:
Codeception\Step\Argument\PasswordArgument to pass sensitive data into tests:<?php
use \Codeception\Step\Argument\PasswordArgument;
$I->amOnPage('/form/password_argument');
$I->fillField('password', new PasswordArgument('thisissecret'));
clearField method to clean up input fields by @eknejmake method to create instances without saving them to database. But @ibpavlovsendPOST() without name, size or type parameter. BY @zebraf1clean command works recursively with included setups. By @davidnewcombCodeception\Util\Stub moved to standalone package Codeception\Stub:
Codeception\Stub instead of Codeception\Util\Stub::once, ::never, etc moved to Codeception\Stub\Expected classCodeception\Util\Stub provides deprecation warning.executeAsyncJS action to run asynchronous scripts.executeJS to pass additional arguments into JavaScript function.setCookie signs cookies when signing enabled. #4656 By @SamMousacreateAndSetCsrfCookie added. #4656 By @SamMousaleague/factory-muffin-faker by @Naktibalda and @Insolita.env files. Fix by @ebuildy--coverage-phpunit option added_getResponseStatusCode hidden method for using in helpers. By @FanchTheSystem:port for cookie domain;->amOnPage('/'); executed when running code coverage with WebDriverinclude config parameter. Fixes #4733 by @ppetpadriewgenerate:test command won't include tester property if actor is not set for this config.seeInDatabse, dontSeeInDatabase, grabFromDatabase and other methods to support SQL comparison operators: <, >, >=, <=, !=, like. Thanks @susgo and @Naktibalda.User-Agent in config via headers. Fixed #4576 by @Naktibalda.dontSeeInPopup by @kpascal.title attribute. See #4586 by @gimler.app property added to public API. Thanks @sky003.tgz files to be accepted for database dumps. #4611 by @Lukazarsee when source code contains <= JS operator. By @tobias-kuendig Fixes #4509.endpoint for AmazonSQS by @gitis.DummyCodeCoverage::stop See #4665 by @network-spyexit(0) was accidentally called. Fixes false-positive test reports. See #4604 by Fenikkusu.path: tests: . in configuration. Fixes #4432 by @marcovtwoutuse section. #4614 by @bscheshirworkDescriptor::getTestSignatureUnique to create unique names for tests. See #4673 by @Tenzian. Fixes #4672setExpectedException() default value for PHPUnit 5.7.23 by @MilesChou. See #4566argv warnings, added check for register_argc_argv. Fixes #4595 by @Naktibaldainit command to codecept.phar by @Naktibalda.And many thanks to our awesome contributors! Thanks to @VolCh for upgrading to Symfony 4, thanks @Naktibalda for patches and reviews and thanks to @carusogabriel for refactoring tests.
haveHttpHeader enhanced to handle special characters. #4541 by @bnpatel1990suite_namespace config option to suite config. Allows to set custom namespace for tests per suite. #4525 by @pohneanupdateInDatabase method_insertInDatabase to insert record without cleanupbackupConfig when initializing yii2 moduleandWhere instead of where in Yii module's findRecord() by @SamMousa. See #4482amNTLMAuthenticated for NTLM authentication using PhpBrowser. By @TenzianExtension\RunFailed. Added fail-group parameter to customize name of a failed group. By @ maxgorovenko\Codeception\Util\Fixtures::exists() method by @eXorusTestParseException exception message by @gaainf. See #4446init command: create the _generated folder before writing a .gitignore file there by @nstapelbroek. See #4449@dataProvider by @sh41. See #4439Codeception/Verify by @ddinchevassertArraySubset protected across all modules by @guidocellaseeInFormFields by @guidocellaseeInField check options' texts and trimmed texts. By @guidocellasubmitForm to submit inputs in disabled fieldsets. Fixes #4426 by @moebrowneamOnUrl with empty path component. If path component was empty, it used previous url. Fixes #4383 by @NaktibaldawebDriver->getCapabilities() for facebook/php-webdriver < 1.3 (could happen on PHP 5.4, 5.5). Fixes #4435wait accept fractional amount of seconds to wait for less than a second. By @gvlasov$_SERVER global instead of $_ENV. See #4401 by @EricTendianhaveInCollection using __toString. See #4442 by @samusenkoiv@prepare annotation to make realtime configuration for tests in Cest and Test classes. See documentation.Example: disabling Doctrine2 database transaction for a test
<?php
/**@prepare disableTransactions */
function testDoctrine()
{
}
protected function disableTransactions(Doctrine2 $module)
{
$module->_reconfigure(['cleanup' => false]);
}
wait* methods. See Documentationstart option to disable autostart of a browser for tests. (can be useful for Cloud testing setups)_capabilities method for setting desired capabilities in runtime (can be combined with @prepare annotation)_initializeSession and _closeSession can be used in Helpers to start and stop browser manually (combine with start: false config)cleanup configuration option (backward-compatible): (#4379 by @leandrogehlen)
cleanup - to cleanup loaded fixturestransaction - wrap tes into transactionassertStringStartsWith and assertArraySubset by @guidocellaupdateInDatabase method by @eXorus. See #4385$module::$excludeActions property for existence before accessing it. Fixes #4381 by @CactusCoderSymfony::extractRawRoles() failed on security collector (Symfony >= 3.3) #4309 by @Bassterdisable_exception_handling functionality. See #4370. By @janhenkgerritsengrabColumnFromDatabase to fetches values from the column in database. By @RebOOter--coverage, --xml, --html options without parameters (Symfony Console 3.3 compatibility).files section from composer.json (regression from 2.3.2) to avoid unintentionally loading shim files. Fixes Yii migration issue.saveScreenshot allows to save screenshots with no name passed in. See #4263 by @eXorusself-update downloads php5.4 build if php version <7.0. Fixes #4269cleanup: false.dump optional if populator is set. Fixes #4247generate:suite command to create a directory for the suite. Fixes #4251codecept run --ext DotReporter
--ext parameter added to load extensions dynamically.cleanup: false, populate: false. Enable them to load dumps between tests.cleanupBefore: 'never' by @hchonangenerate:phpunit removed._bootstrap.php files are disabled by default.actor replaced with actor_suffix in global configclass_name replaced with actor in suite configseeResponseContainsJson doesn't crash when json response is not an array by @NaktibaldagrabEntityFromRepository, grabEntitiesFromRepository methods by @maximelebastard_restart method to restart browser with a new configuration._findClickable to public API so can be used from helpers. By @tiger-seoseeLink compares relative links correctly #4182--override options. By @kusnir. See #4143url config. #4172 by @SG5.InitDbFixture feature #4201_before of a module #4197 by @NaktibaldagrabPageSource method by @Kolyunya$scenario->current('name') #4154 by @NaktibaldadeclareQueue, declareExchange by @NaktibaldabuildAssociationQuery by @jfxninja. See #4195friend->leave method. Clearing base element on closing session. Fixes #4098gherkin:snippets to generate stub function name for non-english features. By @kuntashovOci::cleanup() should be able to drop objects with case sensitive name. By @pavelkovarassertEquals() assertNotEquals() methods by @spideyfusiontest by @samdarkcleanup configuration equals true. #4207 by @Faryshtasession_write_close() from ZF2 module by @tasselchof. Fixes #4112haveBinding, haveSingleton, haveContextualBinding, haveInstance, haveApplicationHandler, clearApplicationHandlers. By @kt81haveFakeRepository updated to work with Doctrine >= 2.5.7 by @laszlo-karpati #4212bootstrap adds support/_generated to gitignore. By @Naktibaldafacebook/webdriver 1.4.0 by @Naktibalda. See #4076 Fixes #4073codecept run tests/unit
Improves recent PHPStorm integration. Codeception tests can be started by running a suite directory.
performOn with ActionSequence; supporting multiple actions of same kind. #4066 by @davertmik. Fixes #4044haveApplicationHandler and clearApplicationHandlers methods. See #4068. By @janhenkgerritsendatabase_migrations_path to by null by default by @timbroder. Fixes #3990cleanup option to skip auto cleanup. By @alexpts. See #3996yii2-codeception by @leandrogehlen. See #4016g:suite allows generate suites with uppercase names. Fixes #4072settings:
report_useless_tests: false
disallow_test_output: false
be_strict_about_changes_to_global_state: false
log_incomplete_skipped: false
switchToIframe regression from 2.2.9 by @lcobucci. PR #4000TestParseException in PHP7 by @Naktibalda. See #4007Codeception\Test\Unit format #4070. Allows to customize injection of support objects into a testcase:<?php
public function _inject(UnitTester $unit)
{
$this->i = $unit;
}
performOn to wait for element, and run actions inside it. See complete reference. #3986wait* methods by @disc. See #3983seeBinaryResponseEquals assert that binary response matches a hashseeBinaryResponseEquals assert that binary response doesn't match a hash--coverage-crap4j option and codeception/c3 2.0.10/ or -json and xml to deleteHeader by @freezy-skopenNewTab opens a new tab and switches to itcloseTab closes a tab and switches to previousswitchToNextTab switches to next tabswitchToPreviousTab switches to previous tabclickWithLeftButton clicks element with offsetclickWithRightButton right clicks on element with offsetjs_error_logging option to print JS logs in console and in HTML report by @ngraf. See #3821seeInField by @gimler. See #3905
pageload_timeout config option added. The amount of time to wait for a page load to complete before throwing an error. This patch allows to reduce issues from phantomjs random freezing. See #3874. Thanks to @oprudkyicheckOption can check option by name #3852. By @gimler<a href='/'>222</a> (DOM Exception 12 errors). See #3865. By @gimlerselect by @JorisVanEijdenseeNumRecords and grabNumRecords methods. See #3816. By @dmoreno@depends to work with @dataprovider. Fixes #3862. Thanks @edno--override option to support deep configs. See #3820$_SERVER with Phalcon Connector by @sergeyklaydontSeeFileFound searches in path by @Naktibalda. Fixes #3877grabValueFrom to work after fillField by @wumouse. Fix #3866part: init with other modules like WebDriver. See #3876. By @margoridontSeeResponseJsonMatchesXpath method by @Naktibalda. Closes #3843exec function to be enabled before using it. By @Naktibalda. See #3886codecept config:validate command. Use it:codecept config:validate
codecept config:validate acceptance
This should help you next time you get messed with YAML formatting.
Gherkin improvements:
$,€,£ and other signs can be used before or after a number inside Gherkin scenario. This char will be ignored inside a PHP variable, so you receive only number.
When I have 100$ => $num === 100
And I have $100 => $num === 100
escaped strings can now be passed into placeholders. Fixes #3676.
Codeception is tested with latest verision of HHVM
Extensions loader refactored:
enabled section (as it is for modules):extensions:
enabled:
Codeception\Extension\Recorder:
delete_successful: false
vlucas/phpdotenv to parse .env files. Please install it if you don't have it yet.generate:suite command to generate actor file for suite.protocol and path config options by @sven-carstens-udg. See #3717<base href=""> meta tag by @Naktibalda. See #3764_fixtures() method of Cest class. See #3655, fixes #3612 by @primipilusremoveInserted for Sqlite by @Naktibalda. Fixes #3680$scenario->getGroups(). By @frantzen. See #3675@example on Windows by @Naktibalda.vendor_dir option. See #3775. By @AdrianSkierniewskiservices part which can be used to grabServiceFromContainer and addServiceToContainer when conflicting module is used. By @sergeyklayassertCount method added by @disc--override (-o) option. Usage Examples:
codecept run -o "settings: shuffle: true": enable shufflecodecept run -o "settings: lint: false": disable lintingrun_database_seeder configuration option. See #3625 and #3630. By @Bouhnosauredatabase_migrations_path configuration option. See #3628. By @janhenkgerritsenhave and haveMultiple methods not being available when using the ORM part of the modules. See #3587. By @janhenkgerritsensee/dontSee output and friends output-- separates options from arguments in codecept run by @Naktibalda. Fixes #3614. See #3615cleanup set to true by default (as it was documented but not enabled).haveFixtures by @Ni-san. Fixes #3456. See #3586_fixtures method in testcase by @iRipVanWinkle. See #3565[PHPUnit_Framework_Exception] implode() while printing debug for security roles by @Prazmok.submitForm can be located by name or strict locator by @imjoehaines. See #3560registerDeprecationErrorHandler method and register_shutdown_function on first SuiteEvent only. By @positronium. See #3572Auth::logout(), Session::flush() and Cache::flush() from after hook. See #3493. By @janhenkgerritsenMemcache::seeInMemcached to check if the key exists alone or with the desired value. By @sergeyklayMemcache::haveInMemcached. By @sergeyklayMemcache::dontSeeInMemcached. By @sergeyklayinit_autoloader optional, because ZF3 uses composer for autoloading #3525. By @Naktibalda_fixtures method of a testcase. See reference. Fixes usage of nested transactions #3520. By @kalyabin and @davertmikseeResponseCodeIs is deprecated in favor of seeSoapResponseCodeIs by @eXorus. See #3512. Fixes #3512Doctrine\ORM\EntityManagerInterface as valid em instance #3467. Fixes #3459. By @akbwmmongorestore command syntax and adds --quiet option to configfacebook/php-sdk-v4 library with facebook/graph-sdk.codeception.yml is not in project root. See #3434. By @loren-osbornerror_level setting #3460. Fixes #3424. By @Naktibalda..). See #3339@webroot directory on running functional tests. See #3387seeResponseIsJson fails when response is empty. See #3401, closes #3400purgeQueue and purgeAllQueues actions. By @niclopezhaveMultiple fixed; corrected the order of arguments in FactoryMuffin->seed. See #3413 by @buffcodeSOAPAction config param to unset SOAPAction header in SOAP >= 1.2. See #3396REQUEST_TIME server variable to be set on request. By @gimler. Fixes #3374init part to initialize Yii app for unit and acceptance testing.entryScript and entryUrl config values for acceptance testing.haveFixtures, grabFixtures methods.amOnRoute method.amloggedInAs method.grabComponent method.seeEmailIsSent, grabLastSentEmail, etc and email part.@example to @group defined in group files. By @eXorus. Fixes #3278ReqiuiresPackage interface to set external dependencies for modules.run_database_migrations configuration option. By @janhenkgerritsen.callArtisan method. By @janhenkgerritsen.disableModelEvents() method and disable_model_events configuration option. Fixes #2897.codeception.yml config. See #3255 Thanks to @LeRondPoint.env.* files. See #3224. By @smoteskoucfirst, strtoupper => mb_strtoupper) by @Naktibalda. See #3211selectOption with similar options by @eXorus. Fixes #3246Codecepion\Util\HttpCode util class with HTTP code constants. See class referencedeleteHeader method by @Naktibalda. Fixes #3161init part added to avoid conflicts with WebDrivergenerate:snippets can accept second parameter to generate snippets from a specific file or folder.grabNumRecords method by @tocsick. See #3175grabServiceFromContainer when conflicting module is used by @Naktibalda.haveBinding, haveSingleton, haveContextualBinding and haveInstance methods. By @janhenkgerritsen. See #2904.Codeception\TestCase replaced with Codeception\TestInterface in code and in module signatures.PHPUnit_Framework_TestCase, so they don't have expectException, getMock, etc.PHPUnit_Framework_Test instead of extending heavy PHPUnit_Framework_TestCase class.@depends annotation. Announcementcodecept dry-run command added to show scenario steps without executing them.createModel method, use have method instead. See #2866makeModel method. See #2866haveModel method to have. See #2866container removedassertLessThen and assertGreaterThenCodeception\Util\Stub are not verified in Cests. See #3005grabAttributeFrom renamed to grabAttributeFromXmlElement to avoid conflictshaveMultiple method to create more than one model per call. See #2866haveRecord, seeRecord, dontSeeRecord and grabRecord methods now also accept Eloquent model class names instead of only database table names. See #2866Phalcon1 and Phalcon2 modules into one Phalcon due the fact that Phalcon Framework v1.3.x no longer supported at allassert* methods from PHPUnit addedexpectException methodselectOption can receive option as strict locator to exactly match option by text or by value. Use ['value' => 'myvalue'] or ['text' => 'optiontext'] to select a proper option. By @gdscei and @davertmik See #3003modules: disabled:.sq('user1') => 'user1_876asd8as87a'. Added prefix` config option.regenerateId of session is disabled.seeLink and dontSeeLinkCodeception\Util\Stub by @davertmik. See #3093 and #3080settings: backup_global to config, to disable backup_global option of PHPUnit by @mkeasling. See #3045. Fixes #3044see matches UTF-8 text case-insensitively by @Naktibalda. Fixes #3114--steps will not disable code coverage. By @Naktibalda. Fixes #2620--quiet by @EspadaV8. See #2370initializeLumen() method has been called twice on start by @kt81. See #3124 #2607seeInDatabase and dontSeeInDatabase with empty criteria. Closes #3116leave() method added to Friend class. See #3068handler and middleware config options to customize Guzzle handlers and middlewaresaveSessionSnapshot with codecoverage. Closes #2923Util\Locator added methods to create locators to match element at their position: elementAt, firstElement, lastElementrebootable_client that reboots client's kernel before each request.seeInField for textarea with whitespaces before and after string. Closes #2921grabServiceFromContainer use grabService instead. For consistency with other frameworks.assert* methods from PHPUnit addedexpectException methodcodecept self-update works with proxy by @gr1ev0uscodeception.yml - settings: lint: falsescrollTo action by @javigomez and @davertmik #2844clearQueue for AmazonSQS by @mikitu #2805amHttpAuthenticated allows null, null as parameters to unset authentication. #2896Util\Locator added contains method to easily locate any element containing a text.guard parameters to seeAuthentication and dontSeeAuthentication methods. By @janhenkgerritsen. See #2876amLoggedAs with an instance of Authenticable. See #2795phantom in WebDriver config in order to use PhantomJS-specific hooks.seeResponseJsonMatchesXpath when JSON contains ampersand. By @Naktibalda.seeNumberNewLines method to check the number of new lines in opened file. By @sergeyklayseeCurrentRouteMatches action by @laszlo-karpati See #2665sqs function to generate unique sequences per suite. #2766 by @johnatannvmdseeOptionIsSelected sees first option as selected if none is selected by @NaktibaldaseeHttpHeader and dontSeeHttpHeader from null to expected value #2697 by @zondorstopFollowingRedirects and startFollowingRedirects by @brutuscatanimate_slides config to disable left-right sliding animation between screenshots by @vml-rmottExternalUrlException when a test tries to open a URL that is not handled by the framework, i.e. an external URL. See #2396ParseException handles syntax error, otherwise linting happens with php -l. @davertmikfilter_var($value, FILTER_VALIDATE_URL)appendField to work with content editable div by @nsanden #2588cache_router added (disabled by default) by @raistlin.services part added to allow access Symfony DIC while wokring with WebDriver or PhpBrowser by @laszlo-karpati See #2629_after by @pfz. See #2572seeInField for textareas by @nsandenenableMiddleware and enableEvents methods. See #2602. By @janhenkgerritsenseeCurrentRouteIs when routes don't match. See #2593. By @maddhatter_getResponseContent hidden method. By @NaktibaldamoveBack method. By @NaktibaldaseeInSource, dontSeeInSource methods to check raw HTML instead of stripped text in see/dontSee. By @zbateson in #2465debugWebDriverLogs in debug mode. Config option debug_log_entries added. See #2471 By @MasonM and @DavertMik.json_last_error_msg function on PHP 5.4. See #2535. By @NaktibaldaseeResponseIsJsonType can now validate emails with string:email definition. By @DavertMikseeResponseIsJsonType: string|null as well as null|string can be used to match null type. #2522 #2500 By @vslovikdepends: Silex in config. By @arduanov #2503expectEvents and added seeEventTriggered and dontSeeEventTriggered. By @janhenkgerritsenseeCurrentRouteIs and seeCurrentActionIs methods. See #2517. By @janhenkgerritsenamOnRoute and seeCurrentRouteIs methods by @sergeyklayseeSessionHasValues by @sergeyklaygetApplication() method by @sergeyklayxdebug.max_nesting_level to 200 only if it is lower. Fixes error hiding #2462 by @mhightowercleanup flag. See #2488. By @ivokundgenerate:suite respect bootstrap setting in #2512. By @dmitrivereshchaginseeResponseMatchesJsonType and dontSeeResponseMatchesJsonType. See #2391_request and _loadPage hidden API methods for performing arbitrary requests.seeInField, dontSeeInField for disabled fields #2378. See #2414.tests/_env by @ZifiusamOnRoute and seeCurrentRouteIs methods by @raistlinamOnRoute and seeCurrentRouteIs methods module, by @NaktibaldaseeCurrentUrlEquals and dontSeeCurrentUrlEquals methods #2324. By @janhenkgerritsen_request() method to send requests to backend from Helper classes.disableEvents(), enableEvents() and expectEvents() methods. By @janhenkgerritsendontSeeFormErrors() method. By @janhenkgerritsenCodeception\Exception\ExternalUrlException when framework module tries to open an external URL #2328. By @NaktibaldaswitchToIframe method. By @Naktibalda_before. 2015-08-08disableMiddleware() and enableMiddleware() methods. By @janhenkgerritsen 2015-08-07tests/_support/_generated directory, it will be created automatically before run.Extension\Recorder navigate over slides with left and right arrow keys, do not create screenshots for comment steps.Extension\Recorder generates index html for all saved records.Extension\Recorder fixed for creating directories twice. Fixed #2216Extension\Logger fixed #2216Stub::makeEmpty on interfaces works again by @Naktibaldagenerate:scenarios fixed for Cest files by @mkudenko See #1962http_proxy and http_proxy_port config options by @jdq22 2015-07-29haveRecord() method in Laravel modules #2217 by @janhenkgerritsen 2015-07-28waitForElementChange fatal error by @stipsanFacebook\WebDriver namespace. Please take that into account when using WebDriver API directly.
Till 2.2 Codeception will keep non-namespaced aliases of WebDriver classes.test.before and test.after events. For instance, WebDriver browser won't be started and Db cleanups won't be executed on incomplete or skipped tests.skip and incomplete enabled in Cest files #2131_findElements($locator) method added to use in Helper classes 2015-07-11
Now you can use $this->getModule('WebDriver')->findElements('.user'); in Helpers to match all elements with user class using WebDriver moduleamOnUrl method to open absolute URLs.fillField using values that contain ampersands by @GawainLynch and @zbateson Issue #2132$scenario->skip(), $scenario->group('firefox'), etc, it is recommended to set scenario metadata with annotations // @skip, // @group firefox.
Annotations can be parsed from line or block comments. $scenario->skip() and $scenario->incomplete() are still valid and can be executed inside conditional statements:
if (!extension_loaded('xdebug')) $scenario->skip('Xdebug required')
tests/_support by default. Actors, Helpers, PageObjects, StepObjects, GroupObjects to follow PSR-4 naming style. Autoloader implemented by @splinter89._inject and explicitly specifying class names as parameters. Implemented by @splinter89._generated namespace. Each *Tester class can be updated with custom methods.enabled section of suite config._conflicts method_inject and _depends methods and relying on dependency injection container.$scenario->current('env') returns current environment name. Fixes #1251tests/_envs, environment generator added. Implemented by By @sjableka. See #1747reconnect option for long running tests, which will connect to database before the test and disconnect after. By @Naktibaldashuffle added to settings. Randomizes order of running tests. See #1504symfony_em_service config option moved from Doctrine2 to Symfony2 module and renamed to em_service 2015-06-03Codeception\Lib\InnerBrowser::getFormFromCrawler(): ID XXX already defined 2015-05-13MODULE_INIT event is fired before initializing modules #1370pcntl_signal. See #1286Codeception\GroupObjectext dir; Base Extension class renamed to Codeception\ExtensionhaveServiceInDi method implemented by @sergeyklayseeNumRecords method added by @sergeyklayconnection_timeout and request_timeout by @n8whnp #2065user and password by @nicklasosStub::construct can be used to set private/protected properties by @Naktibalda #2082route() helper. See #2000. 2015-06-04JsonSerializable object on POST by @Naktibalda and @andersonamuller. See #1988 #1994tput and tries to fit areatput are ignoredSymfony\Component\DomCrawler\Form->getPhpValues() does. Fixes fails of Symfony form tests 2015-05-22FooBar[bar]). Fixes regression #1923 by @davertmik and @zbateson.amOnRoute and amOnAction methods if route or action does not exist 2015-05-04getApplication() methodseeFormHasErrors(), seeFormErrorMessages(array $bindings) and seeFormErrorMessage($key, $errorMessage) methodsseeSessionHasErrors() and seeSessionErrorMessage(array $bindings) methods.g:scenarios --single-file missing linebreaks between scenarios by @Zifius Parially fixes #1866[ErrorException] Array to string conversion when using strict locators. Fix by @neochief #1881Db::getPrimaryKeyColumn and Db::deleteQueryMethods by @Naktibalda. See #1912symfony_em_service to specify service name for Doctrine entity manager in Symfony DIC by @danieltuwien #1915haveInDatabase. Fixes #1942 by @satahippyfeature added to xml reports in Codeception\TestCase\Test test report by @tankist. See #1964haveInDatabase works in PostgreSQL on tables with 'id' as primary key. Fix by @akireikin #1846 #1761--no-rebuild option to disable automatic actor classes rebuilds 2015-04-24fillField/submitForm improvements by @zbateson See #1840. Fixes #1828, #1689Symfony\Component\HttpFoundation\Request::route() by @janhenkgerritsenhaveRecord to insert insert unsafe attributes by @nkovacs. Fixes #1775assertSame and assertNotSame added by @hidechae 2015-04-03packages option for application packages by @jonathantorres #1782seeInFormFields method added for checking multiple form field values. See #1795 2015-04-03__mocked property in classes created with Stub by @EVODelavega See #1785 2015-04-03submitForm allows array parameter values by @zbateson 2015-04-03framework_collect_buffer option to disable buffering output by @Noles 2015-04-03bootstrap: false in globall settings or inside suite config. Fixes #1813 2015-04-03submitForm improvements by @zbateson: 2015-02-23Removed submitForm's reliance on using parse_str and parse_url to generate params (which caused unexpected side-effects like failing for values with ampersands).
Modified the css selector for input elements so disabled input elements don't get sent default values.
Modifications to ensure multiple values get sent correctly.
--no-interaction option or simply -nExceptionWrapper messages unpacked into normal and verbose exceptions.$this->params property. Fixes #1682 by @gmhenderson 2015-02-01matchOption to return the option value in case there is no value attribute by @synchrone. See #1663 2015-01-26seeNumElementsInCollection method added by @sahanhgrabCollectionCount, seeElementIsArray, seeElementIsObject by @antoniofrignaniselectOption() to select options not inside forms by @n8whnp See #1638session_id(). See #1606 by @TriAnMansubmitForm by @Revisor. See #1625grabFacebookTestUserId method added by @ipalausNow you can run specific test using shorter format:
codecept run unit tests/unit/Codeception/TestLoaderTest
codecept run unit Codeception
codecept run unit Codeception:testAddCept
codecept run unit Codeception/TestLoaderTest.php
codecept run unit Codeception/TestLoaderTest
codecept run unit Codeception/TestLoaderTest.php:testAddCept
codecept run unit Codeception/TestLoaderTest:testAddCept
codecept run unit tests/unit/Codeception
codecept run unit tests/unit/Codeception:testAddCept
codecept run unit tests/unit/Codeception/TestLoaderTest.php
codecept run unit tests/unit/Codeception/TestLoaderTest.php:testAddCept
codecept run unit tests/unit/Codeception/TestLoaderTest
codecept run unit tests/unit/Codeception/TestLoaderTest:testAddCept
seeInField method to work for radio, checkbox and select fields. Thanks to @zbateson 2014-12-20--no-colors flag by @zbateson. Issue #1562 2014-12-20seeResponseJsonMatchesJsonPath validates response JSON against JsonPath.
Usage of JsonPath requires library flow/jsonpath to be installed.
seeResponseJsonMatchesXpath validates response JSON against XPath. It converts JSON structure into valid XML document and executes XPath for it.
grabDataFromResponseByJsonPath method was added as well to grab data JSONPath.
grabDataFromJsonResponse deprecated in favor of grabDataFromResponseByJsonPath 2014-12-19Unreachable field error while filling [] fields in input and textarea fields. Issues #1585 #1602 2014-12-18submitForm method by @zbateson. See #1518grabValueFrom method by @zbateson. See #1512grabTextFrom doesn't work with regex by @zbateson. See #1519@before and @after annotations. Thanks to @draculus and @zbateson. See #1517c3_url option to code coverage settings. c3_url allows to explicitly set url for index file with c3 included. See #1024In this mode only standard JUnit attributes are added to XML reports, so special attributes like feature won't be included. This improvement fixes usage XML reports with Jenkins #1408
To enable strict xml generation add to codeception.yml:
settings:
strict_xml: true
waitForElement* methods accept strict locators and WebDriverBy as parameters. See #1396 2014-09-29executeInGuzzle uses baseUrl set from config. Fixes #1416 2014-09-29submitForm accepts forms with document-relative paths. Fixes #1274 2014-09-28fillField fails for a form without a submit button by @zbateson 2014-09-28amOnPage now accepts absolute urls 2014-09-27app.url config value for creating requests. Fixes #1095 2014-08-04seeAuthenticated / dontSeeAuthenticated assertions added to check that current user is authenticated 2014-08-04logout action added 2014-08-04amLoggedAs can login user by credentials 2014-08-04amOnRoute, amOnAction, seeCurrentRouteIs, seeCurrentActionIs actions 2014-08-04haveEnabledFilters and haveDisabledFilters actions to toggle filters in runtime 2014-08-04filters option to enable filters on testing 2014-08-04codeception/specify is now available in phar 2014-07-14_bootstrap.php is now loaded before beforeSuite module hooks._bootstrap.php was loaded after test run by @samdark 2014-07-11checkOption now works for checkboxes with array[] name by @TrustNikseeOptionIsSelected and dontSeeOptionIsSelected now works with radiobuttons by @TrustNik 2014-07-05_logs dir to _output by default_helpers dir to _support by defaultgrabAttributeFrom