diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0bc45d58c..fc8539063 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,7 +33,7 @@ jobs: env: COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - php-version: 8.1 + php-version: 8.2 - name: Install dependencies run: composer install --prefer-dist --no-progress diff --git a/RoboFile.php b/RoboFile.php index cb6a82e2f..d8cce2d4d 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -10,8 +10,7 @@ class RoboFile extends \Robo\Tasks use DocumentationHelpers; const REPO_BLOB_URL = 'https://github.com/Codeception/Codeception/blob'; - const BRANCH_4x = '4.2'; - const BRANCH_5x = '5.1'; + const BRANCH_5x = '5.3'; const BRANCH_MAIN = 'main'; function post() @@ -413,102 +412,34 @@ private function postProcessFile($pageName, $documentationFile) file_put_contents($documentationFile, $contents); } - public function buildPhar80() + public function buildPhar82() { - $version = self::BRANCH_5x . '.' . date('Ymd'); - $releaseDir = "releases/$version"; - $this->stopOnFail(); - - $this->taskFilesystemStack()->mkdir('build/80')->run(); - $this->setCodeceptionVersionTo('^' . self::BRANCH_5x); - $this->setPlatformVersionTo('8.0.2'); - $buildFile = 'build/80/codecept.phar'; - $this->buildPhar($buildFile); - $this->updateVersionFile($buildFile, 'php80/codecept.version'); - $versionedFile = "$releaseDir/codecept.phar"; - $this->taskFilesystemStack() - ->stopOnFail() - ->mkdir($releaseDir) - ->copy($buildFile, $versionedFile) - ->remove('php80/codecept.phar') - ->symlink("../$versionedFile", 'php80/codecept.phar') - ->run(); - } + $ignoredPlatformReqs = array( + 'ext-apcu', + 'ext-mongodb', + 'ext-phalcon', + ); - public function buildPhar72() - { - $version = self::BRANCH_4x . '.' . date('Ymd'); + $version = self::BRANCH_5x . '.' . date('Ymd'); $releaseDir = "releases/$version"; $this->stopOnFail(); - - $this->taskFilesystemStack()->mkdir('build/72')->run(); - $this->setCodeceptionVersionTo('^4.1'); - $this->setPlatformVersionTo('7.2.0'); - $this->requireHoaConsole(); - $buildFile = 'build/72/codecept.phar'; + $this->taskFilesystemStack()->mkdir('build/82')->run(); + $this->setCodeceptionVersionTo('^' . self::BRANCH_5x, $ignoredPlatformReqs); + $this->setPlatformVersionTo('8.2.0', $ignoredPlatformReqs); + $buildFile = 'build/82/codecept.phar'; $this->buildPhar($buildFile); - $this->updateVersionFile($buildFile, 'codecept.version'); + $this->updateVersionFile($buildFile, 'php82/codecept.version'); $versionedFile = "$releaseDir/codecept.phar"; $this->taskFilesystemStack() ->stopOnFail() ->mkdir($releaseDir) ->copy($buildFile, $versionedFile) - ->remove('codecept.phar') - ->symlink($versionedFile, 'codecept.phar') + ->remove('php82/codecept.phar') + ->symlink("../$versionedFile", 'php82/codecept.phar') ->run(); } - public function buildPhar56() - { - $version = self::BRANCH_4x . '.' . date('Ymd'); - $releaseDir = "releases/$version"; - $this->stopOnFail(); - - $this->taskFilesystemStack()->mkdir('build/56')->run(); - $this->setCodeceptionVersionTo('^4.1'); - $this->setPlatformVersionTo('5.6.4'); - $this->requireHoaConsole(); - //filenames must be different, because Phar refuses to build second file with the same name - $buildFile = 'build/56/codecept.phar'; - $this->buildPhar($buildFile); - $this->updateVersionFile($buildFile, 'php56/codecept.version'); - $versionedFile = "$releaseDir/php56/codecept.phar"; - $this->taskFilesystemStack() - ->stopOnFail() - ->mkdir("$releaseDir/php56") - ->copy($buildFile, $versionedFile) - ->remove('php56/codecept.phar') - ->symlink("../$versionedFile", 'php56/codecept.phar') - ->run(); - } - - private function requireHoaConsole(): void - { - $this->taskComposerRequire() - ->dependency('hoa/console') - ->workingDir('package') - ->run(); - } - - public function release() - { - $version = self::BRANCH_4x . '.' . date('Ymd'); - $releaseDir = "releases/$version"; - $this->updateBuildsPage(); - - $this->taskGitStack() - ->stopOnFail() - ->checkout('-- package/composer.json') - ->add('builds.markdown') - ->add('codecept.phar') - ->add('codecept.version') - ->add('php56/codecept.phar') - ->add('php56/codecept.version') - ->add($releaseDir) - ->run(); - } - - public function release80() + public function release82() { $version = self::BRANCH_5x . '.' . date('Ymd'); $releaseDir = "releases/$version"; @@ -518,23 +449,30 @@ public function release80() ->stopOnFail() ->checkout('-- package/composer.json') ->add('builds.markdown') - ->add('php80/codecept.phar') - ->add('php80/codecept.version') + ->add('php82/codecept.phar') + ->add('php82/codecept.version') ->add($releaseDir) ->run(); } - private function setPlatformVersionTo($version) + private function setPlatformVersionTo($version, $ignoredPlatformReqs = array()) { $this->taskComposerConfig()->workingDir('package')->set('platform.php', $version)->run(); - $this->taskComposerUpdate()->preferDist()->optimizeAutoloader()->workingDir('package')->run(); + $composerUpdate = $this->taskComposerUpdate(); + foreach ($ignoredPlatformReqs as $ignoredPlatformReq) { + $composerUpdate->option('--ignore-platform-req', $ignoredPlatformReq); + } + $composerUpdate->preferDist()->optimizeAutoloader()->workingDir('package')->run(); } - private function setCodeceptionVersionTo($version) + private function setCodeceptionVersionTo($version, $ignoredPlatformReqs = array()) { - $this->taskComposerRequire() - ->dependency('codeception/codeception', $version) - ->workingDir('package') + $composerRequire = $this->taskComposerRequire() + ->dependency('codeception/codeception', $version); + foreach ($ignoredPlatformReqs as $ignoredPlatformReq) { + $composerRequire->option('--ignore-platform-req', $ignoredPlatformReq); + } + $composerRequire->workingDir('package') ->run(); } @@ -639,7 +577,7 @@ public function processChangelog() $repo = $release['repo'] ?? 'Codeception'; $changelog .= sprintf("\n\n### %s %s: %s\n\n", $repo, $release['tag_name'], $release['name']); - $changelog .= sprintf("Released by [ %s](%s) on %s", + $changelog .= sprintf('Released by [{:height="16" width="16"} %s](%s) on %s', $release['author']['avatar_url'] . '&s=16', $release['author']['login'], $release['author']['html_url'], @@ -696,8 +634,10 @@ public function updateBuildsPage() $releaseFile->line("*Requires: PHP 5.4 and higher + CURL*\n"); } elseif ($major < 5) { $releaseFile->line("*Requires: PHP 5.6 and higher + CURL*\n"); - } else { + } elseif ($minor < 3) { $releaseFile->line("*Requires: PHP 8.0 and higher + CURL*\n"); + } else { + $releaseFile->line("*Requires: PHP 8.2 and higher + CURL*\n"); } $releaseFile->line("* **[Download Latest $branch Release]($downloadUrl)**"); } diff --git a/_data/modules.yml b/_data/modules.yml index 999b6a164..d36e1192f 100644 --- a/_data/modules.yml +++ b/_data/modules.yml @@ -15,6 +15,10 @@ link: https://github.com/walterwhites/Appium-codeception-module description: Easy Appium integration, iOS Automation +- name: Axeception + link: https://github.com/flowdgmbh/codeception-axeception + description: Run axe-core acceptance tests in codeception + - name: BrowserMob link: https://github.com/edno/codeception-browsermob description: Codeception module for BrowserMob Proxy. @@ -165,3 +169,7 @@ - name: Yandex link: https://github.com/portrino/codeception-yandex-module description: Validation of structured data via yandex API. + +- name: Grpc + link: https://github.com/MercerMorning/codeception-grpc-module + description: Validation of grpc server. diff --git a/_includes/extensions.md b/_includes/extensions.md index 9d9df2b06..0552d693e 100644 --- a/_includes/extensions.md +++ b/_includes/extensions.md @@ -187,7 +187,7 @@ On each execution failed tests are logged and saved into `tests/_output/failed` [See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunProcess.php) Extension to start and stop processes per suite. -Can be used to start/stop selenium server, chromedriver, [MailCatcher](https://mailcatcher.me/), etc. +Can be used to start/stop selenium server, chromedriver, etc. Each command is executed only once, at the beginning of the test suite. To execute a command before each test, see [Before/After Attributes](https://codeception.com/docs/AdvancedUsage#BeforeAfter-Attributes). Can be enabled in suite config: @@ -213,15 +213,15 @@ extensions: In the end of a suite all launched processes will be stopped. -To wait for the process to be launched use `sleep` option. In this case you need configuration to be specified as object: +To wait for the process to be launched use the `sleep` option. In this case you need configuration to be specified as object: ```yaml extensions: enabled: - Codeception\Extension\RunProcess: - 0: java -jar ~/selenium-server.jar - 1: mailcatcher - sleep: 5 # wait 5 seconds for processes to boot + 0: php -S 127.0.0.1:8000 -t tests/data/app + 1: java -jar ~/selenium-server.jar + sleep: 5 # wait 5 seconds for the processes to boot ``` HINT: You can use different configurations per environment. @@ -237,3 +237,9 @@ Recommended to be used for development purposes only. +## SuiteInitSubscriberTrait + +[See Source](https://github.com/Codeception/Codeception/blob/main/ext/SuiteInitSubscriberTrait.php) + + + diff --git a/_layouts/bootstrap.html b/_layouts/bootstrap.html index ff47fefa9..299f8ffea 100644 --- a/_layouts/bootstrap.html +++ b/_layouts/bootstrap.html @@ -122,10 +122,6 @@