diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..0bc45d58c --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,51 @@ +# This is a basic workflow to help you get started with Actions + +name: Auto-publish website + +# Controls when the workflow will run +on: + schedule: + - cron: "0 * * * *" + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_PAT }} + + - name: authorize + run: | + git config --local user.email "${GITHUB_ACTOR}@bots.github.com" + git config --local user.name "github-actions[bot]" + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + php-version: 8.1 + + - name: Install dependencies + run: composer install --prefer-dist --no-progress + + - name: Build docs + run: ./vendor/bin/robo build:docs + + - name: Build changelog + run: ./vendor/bin/robo changelog + env: + GH_PAT: ${{ secrets.GH_PAT }} + + - name: Publish docs + run: ./vendor/bin/robo publish + diff --git a/.gitignore b/.gitignore index 6cf3e5783..e954f2dc2 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,11 @@ _site/ .jekyll-metadata /build /composer.lock +Gemfile.lock /docs/modules/AbstractAsserts.md +/docs/modules/Phalcon.md +/docs/modules/Phalcon4.md /package/composer.lock /package/vendor /vendor +.jekyll-cache diff --git a/Gemfile b/Gemfile index 8d6cbe75b..52816f1c6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,9 +1,12 @@ source 'https://rubygems.org' -gem 'jekyll', '~> 3.6.3' +gem 'jekyll', '~> 4.3.3' gem 'kramdown' gem 'rouge' +gem 'webrick' +gem 'wdm', '~> 0.1.1', :install_if => Gem.win_platform? + group :jekyll_plugins do - gem 'algoliasearch-jekyll', '~> 0.9.0' -end \ No newline at end of file + gem 'jekyll-algolia', '~> 1.7.1' +end diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 85f3139f4..000000000 --- a/Gemfile.lock +++ /dev/null @@ -1,79 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.7.0) - public_suffix (>= 2.0.2, < 5.0) - algoliasearch (1.27.4) - httpclient (~> 2.8, >= 2.8.3) - json (>= 1.5.1) - algoliasearch-jekyll (0.9.1) - algoliasearch (~> 1.12) - appraisal (~> 2.1.0) - awesome_print (~> 1.6) - json (>= 1.8.6) - nokogiri (~> 1.7, >= 1.7.2) - verbal_expressions (~> 0.1.5) - appraisal (2.1.0) - bundler - rake - thor (>= 0.14.0) - awesome_print (1.8.0) - colorator (1.1.0) - ffi (1.13.1) - forwardable-extended (2.6.0) - httpclient (2.8.3) - jekyll (3.6.3) - addressable (~> 2.4) - colorator (~> 1.0) - jekyll-sass-converter (~> 1.0) - jekyll-watch (~> 1.1) - kramdown (~> 1.14) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (>= 1.7, < 3) - safe_yaml (~> 1.0) - jekyll-sass-converter (1.5.2) - sass (~> 3.4) - jekyll-watch (1.5.1) - listen (~> 3.0) - json (2.3.1) - kramdown (1.17.0) - liquid (4.0.3) - listen (3.2.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - mini_portile2 (2.5.0) - nokogiri (1.11.1) - mini_portile2 (~> 2.5.0) - racc (~> 1.4) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (4.0.6) - racc (1.5.2) - rake (13.0.1) - rb-fsevent (0.10.4) - rb-inotify (0.10.1) - ffi (~> 1.0) - rouge (2.2.1) - safe_yaml (1.0.5) - sass (3.7.4) - sass-listen (~> 4.0.0) - sass-listen (4.0.0) - rb-fsevent (~> 0.9, >= 0.9.4) - rb-inotify (~> 0.9, >= 0.9.7) - thor (1.0.1) - verbal_expressions (0.1.5) - -PLATFORMS - ruby - -DEPENDENCIES - algoliasearch-jekyll (~> 0.9.0) - jekyll (~> 3.6.3) - kramdown - rouge - -BUNDLED WITH - 2.1.4 diff --git a/README.md b/README.md index cf3f4c537..925d83538 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ -# Codeception Site +# Codeception.com Website -http://codeception.com +https://codeception.com If you want to improve the site, please submit your pull requests. Most of design changes are welcome! To run site locally (published with Github pages) you need to install [Jekyll](https://jekyllrb.com/) - -**Documentation is copied** from main [Codeception repo](https://github.com/codeception/codeception), changes to **Guides** or **Module Reference** should be sent into it. diff --git a/RoboFile.php b/RoboFile.php index 33c5a5c34..cb6a82e2f 100644 --- a/RoboFile.php +++ b/RoboFile.php @@ -10,7 +10,9 @@ class RoboFile extends \Robo\Tasks use DocumentationHelpers; const REPO_BLOB_URL = 'https://github.com/Codeception/Codeception/blob'; - const STABLE_BRANCH = '4.1'; + const BRANCH_4x = '4.2'; + const BRANCH_5x = '5.1'; + const BRANCH_MAIN = 'main'; function post() { @@ -41,76 +43,7 @@ function publish() ->push() ->run(); } - - - /** - * builds docs for specific branch - */ - function docsBranch($branch) - { - $this->yell("Creating docs for $branch"); - $dir = "docs-$branch"; - - $this->taskGitStack() - ->cloneRepo('git@github.com:Codeception/Codeception.git', 'source') - ->run(); - - $this->taskGitStack() - ->dir('source') - ->checkout($branch) - ->run(); - - $this->taskCleanDir($dir)->run(); - - $this->taskWriteToFile("_includes/doc_$branch.html") - ->text('
') - ->text('You are viewing documentation for Codeception ' . $branch . '. ') - ->text('Switch to latest stable »') - ->text('
') - ->run(); - - - $indexFile = $this->taskWriteToFile($dir . '/index.md') - ->line('---') - ->line('layout: doc') - ->line("title: Codeception $branch Documentation") - ->line('---') - ->text("\n\n{% include doc_$branch.html %}\n\n\n") - ->line("# Codeception $branch Guides\n\n"); - - $guides = Finder::create() - ->ignoreVCS(true) - ->depth('== 0') - ->name('*.md') - ->sortByName() - ->in('source/docs'); - - - foreach ($guides as $file) { - $contents = file_get_contents($file->getRealPath()); - $name = substr($file->getBasename(), 0, -3); - $title = preg_replace("(\d+-)", '', $name); - if (preg_match('/^# (.*)$/m', $contents, $matches)) { - $title = $matches[1]; - } - $indexFile->line("* [$title](/$dir/$name)"); - - $this->taskWriteToFile($dir . '/' . $file->getBasename()) - ->line('---') - ->line('layout: doc') - ->line('title: Codeception Documentation') - ->line('---') - ->line('') - ->line('') - ->text("{% include doc_$branch.html %}") - ->line('') - ->line('') - ->text($contents) - ->run(); - } - $indexFile->run(); - // $this->taskDeleteDir('source')->run(); - } + /** * @desc generates modules reference from source files @@ -118,7 +51,7 @@ function docsBranch($branch) public function buildDocs() { $this->say('generating documentation from source files'); - $this->taskComposerUpdate()->run(); + $this->taskComposerUpdate()->preferSource()->run(); $this->buildDocsModules(); $this->buildDocsUtils(); $this->buildDocsCommands(); @@ -132,7 +65,7 @@ public function buildDocsModules() { $this->taskCleanDir('docs/modules')->run(); $this->say("Modules"); - $modules = Finder::create()->files()->name('*.php')->in(__DIR__ . '/vendor/codeception/module-*/src/Codeception/Module'); + $modules = Finder::create()->files()->name('*.php')->in(__DIR__ . '/vendor/codeception/module-*/src/Codeception/Module')->depth('== 0'); foreach ($modules as $module) { $moduleName = basename(substr($module, 0, -4)); $className = 'Codeception\Module\\' . $moduleName; @@ -150,6 +83,12 @@ public function buildDocsModules() $this->taskFilesystemStack()->symlink('Mezzio.md', 'docs/modules/ZendExpressive.md')->run(); $this->taskFilesystemStack()->symlink('Laravel.md', 'docs/modules/Laravel5.md')->run(); $this->taskFilesystemStack()->symlink('Laminas.md', 'docs/modules/ZF2.md')->run(); + + // Don't update old Phalcon modules + $this->taskGitStack() + ->stopOnFail() + ->checkout('-- docs/modules/Phalcon.md docs/modules/Phalcon4.md') + ->run(); } private function postProcessModuleDocFile($documentationFile, $name, $source) @@ -159,17 +98,9 @@ private function postProcessModuleDocFile($documentationFile, $name, $source) $buttons = [ 'source' => $source, ]; - // building version switcher - foreach ([ - '3.1', - '2.5', - '1.8' - ] as $branch) { - $buttons[$branch] = self::REPO_BLOB_URL . "/$branch/docs/modules/$name.md"; - } $buttonHtml = "\n\n" . '
'; $releasesUrl = "https://github.com/Codeception/module-$name/releases"; - $buttonHtml .= 'Changelog'; + $buttonHtml .= 'Releases'; foreach ($buttons as $link => $url) { if ($link == 'source') { $link = "$link"; @@ -188,18 +119,21 @@ public function buildDocsUtils() $utils = [ 'Autoload' => null, 'Fixtures' => null, - 'Locator' => null, - 'XmlBuilder' => null, + 'Locator' => 'lib-web', + 'XmlBuilder' => 'lib-xml', 'JsonType' => 'module-rest', 'HttpCode' => 'lib-innerbrowser', ]; - //JsonType is in module-rest, HttpCode - in lib-innerbrowser foreach ($utils as $utilName => $repositoryName) { $className = '\Codeception\Util\\' . $utilName; - $documentationFile = 'docs/reference/' . $utilName . '.md'; - $this->documentApiClass($documentationFile, $className, false, $repositoryName); - $this->postProcessFile($utilName, $documentationFile); + try { + $documentationFile = 'docs/reference/' . $utilName . '.md'; + $this->documentApiClass($documentationFile, $className, false, $repositoryName); + $this->postProcessFile($utilName, $documentationFile); + } catch (\Exception $err) { + + } } } @@ -330,7 +264,7 @@ public function buildDocsExtensions() ->prepend("# Official Extensions\n") ->processClassSignature(function (ReflectionClass $r, $text) { $name = $r->getShortName(); - return "## $name\n\n[See Source](" . self::REPO_BLOB_URL . "/" . self::STABLE_BRANCH . "/ext/$name.php)"; + return "## $name\n\n[See Source](" . self::REPO_BLOB_URL . "/" . self::BRANCH_MAIN . "/ext/$name.php)"; }) ->filterMethods(function (ReflectionMethod $r) { return false; @@ -344,7 +278,7 @@ public function buildDocsExtensions() protected function documentApiClass($file, $className, $all = false, $repositoryName = null) { if ($repositoryName === null) { - $repositoryUrl = self::REPO_BLOB_URL . "/" . self::STABLE_BRANCH; + $repositoryUrl = self::REPO_BLOB_URL . "/" . self::BRANCH_5x; } else { $repositoryUrl = 'https://github.com/Codeception/' . $repositoryName . '/blob/master'; } @@ -410,7 +344,7 @@ public function changelog() { ->run(); } - protected function processChangelog() + protected function oldProcessChangelog() { $sortByVersionDesc = function (\SplFileInfo $a, \SplFileInfo $b) { $pattern = '/^CHANGELOG-(\d+\.(?:x|\d+)).md$/'; @@ -479,14 +413,38 @@ private function postProcessFile($pageName, $documentationFile) file_put_contents($documentationFile, $contents); } + public function buildPhar80() + { + $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(); + } + public function buildPhar72() { - $version = self::STABLE_BRANCH . '.' . date('Ymd'); + $version = self::BRANCH_4x . '.' . 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->buildPhar($buildFile); $this->updateVersionFile($buildFile, 'codecept.version'); @@ -502,12 +460,14 @@ public function buildPhar72() public function buildPhar56() { - $version = self::STABLE_BRANCH . '.' . date('Ymd'); + $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); @@ -520,12 +480,19 @@ public function buildPhar56() ->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::STABLE_BRANCH . '.' . date('Ymd'); + $version = self::BRANCH_4x . '.' . date('Ymd'); $releaseDir = "releases/$version"; $this->updateBuildsPage(); @@ -541,12 +508,36 @@ public function release() ->run(); } + public function release80() + { + $version = self::BRANCH_5x . '.' . date('Ymd'); + $releaseDir = "releases/$version"; + $this->updateBuildsPage(); + + $this->taskGitStack() + ->stopOnFail() + ->checkout('-- package/composer.json') + ->add('builds.markdown') + ->add('php80/codecept.phar') + ->add('php80/codecept.version') + ->add($releaseDir) + ->run(); + } + private function setPlatformVersionTo($version) { $this->taskComposerConfig()->workingDir('package')->set('platform.php', $version)->run(); $this->taskComposerUpdate()->preferDist()->optimizeAutoloader()->workingDir('package')->run(); } + private function setCodeceptionVersionTo($version) + { + $this->taskComposerRequire() + ->dependency('codeception/codeception', $version) + ->workingDir('package') + ->run(); + } + /** * @desc creates codecept.phar * @throws Exception @@ -572,6 +563,7 @@ private function packPhar($pharFileName) $finder = Finder::create()->files() ->ignoreVCS(true) ->name('*.php') + ->name('*.php8') ->name('*.css') ->name('*.png') ->name('*.js') @@ -605,6 +597,74 @@ private function packPhar($pharFileName) $pharTask->run(); } + public function processChangelog() + { + $client = new \Github\Client(); + $token = getenv('GH_PAT'); + if ($token) { + $client->authenticate(getenv('GH_PAT'), null, \Github\Client::AUTH_ACCESS_TOKEN); + } + $allReleases = []; + + $repositories = $client->repos()->org('Codeception', ['per_page' => 100]); + foreach ($repositories as $repository) { + $repositoryName = $repository['name']; + if ($repositoryName !== 'Codeception' && !str_starts_with($repositoryName, 'module-') && !str_starts_with($repositoryName, 'lib-')) { + continue; + } + $this->say($repositoryName); + + if ($repository['disabled'] || $repository['archived']) { + continue; + } + try { + $releases = $client->repo()->releases()->all('codeception', $repositoryName); + foreach ($releases as $k=> $release) { + $releases[$k]['repo'] = $repositoryName; + } + $allReleases = array_merge($allReleases, $releases); + } catch (\Exception $err) { +// $this->say("Repository not available " . $repository['name']); +// $this->say($err->getMessage()); + } + } + + usort($allReleases, function($r1, $r2) { + return -(strtotime($r1['published_at']) <=> strtotime($r2['published_at'])); + }); + + $changelog = ""; + + foreach ($allReleases as $release) { + $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](%s) on %s", + $release['author']['avatar_url'] . '&s=16', + $release['author']['login'], + $release['author']['html_url'], + date_format(date_create($release['published_at']),"Y/m/d H:i:s") + ); + + $changelog .= " / [Repository](https://github.com/Codeception/$repo) "; + $changelog .= " / [Releases](https://github.com/Codeception/$repo/releases)\n\n"; + + $body = $release['body']; + //user + + $body = preg_replace('~\s@([\w-]+)~', ' **[$1](https://github.com/$1)**', $body); + //issue + $body = preg_replace( + '~#(\d+)~', + "[#$1](https://github.com/Codeception/$repo/issues/$1)", + $body + ); + $changelog .= "\n\n$body\n"; + } + + return $changelog; + } + public function updateBuildsPage() { $sortByVersion = function (\SplFileInfo $a, \SplFileInfo $b) { @@ -624,7 +684,7 @@ public function updateBuildsPage() foreach ($releases as $release) { $releaseName = $release->getBasename(); - $downloadUrl = "http://codeception.com/releases/$releaseName/codecept.phar"; + $downloadUrl = "https://codeception.com/releases/$releaseName/codecept.phar"; list($major, $minor) = explode('.', $releaseName); if ("$major.$minor" != $branch) { @@ -634,14 +694,16 @@ public function updateBuildsPage() $releaseFile->line("*Requires: PHP 5.3 and higher + CURL*\n"); } elseif ($major == 2 && $minor < 4) { $releaseFile->line("*Requires: PHP 5.4 and higher + CURL*\n"); - } else { + } elseif ($major < 5) { $releaseFile->line("*Requires: PHP 5.6 and higher + CURL*\n"); + } else { + $releaseFile->line("*Requires: PHP 8.0 and higher + CURL*\n"); } $releaseFile->line("* **[Download Latest $branch Release]($downloadUrl)**"); } if (file_exists("releases/$releaseName/php54/codecept.phar")) { - $downloadUrl2 = "http://codeception.com/releases/$releaseName/php54/codecept.phar"; + $downloadUrl2 = "https://codeception.com/releases/$releaseName/php54/codecept.phar"; if (version_compare($releaseName, '2.4.0', '>=')) { $versionLine = "* [$releaseName for PHP 7]($downloadUrl)"; $versionLine .= ", [for PHP 5.6]($downloadUrl2)"; @@ -654,7 +716,7 @@ public function updateBuildsPage() } } elseif (file_exists("releases/$releaseName/php56/codecept.phar")) { $versionLine = "* [$releaseName for PHP 7.2+]($downloadUrl)"; - $downloadUrl2 = "http://codeception.com/releases/$releaseName/php56/codecept.phar"; + $downloadUrl2 = "https://codeception.com/releases/$releaseName/php56/codecept.phar"; $versionLine .= ", [for PHP 5.6 - 7.1]($downloadUrl2)"; } else { $versionLine = "* [$releaseName]($downloadUrl)"; @@ -677,4 +739,6 @@ private function updateVersionFile($pharFile, $versionFile) } $this->taskWriteToFile($versionFile)->text($hash)->run(); } + + } diff --git a/_config.yml b/_config.yml index d3252cc20..1339b5f28 100644 --- a/_config.yml +++ b/_config.yml @@ -6,8 +6,11 @@ kramdown: syntax_highlighting: rouge highlighter: rouge exclude: [vendor] +sass: + sass_dir: _scss + style: compressed plugins: - - algoliasearch-jekyll + - jekyll-algolia algolia: application_id: 'G160Y1N5OT' index_name: 'codeception' @@ -24,4 +27,6 @@ algolia: - "2014-" banner: # disable content to show last blogpost - content: 'Codeception is on OpenCollective! Support us 💖' + # content: '🎉 Codeception truns 10! Join online celebration on November 30!' + # content: 'Codeception is on OpenCollective! Support us 💖' + content: '🇺🇦 Help Ukraine!' diff --git a/_data/extensions.yml b/_data/extensions.yml index 26300faea..f5c77f180 100644 --- a/_data/extensions.yml +++ b/_data/extensions.yml @@ -1,10 +1,15 @@ +- name: Testomat.io Reporter + link: https://github.com/testomatio/php-reporter + description: Run reports and analytics via [Testomat.io](https://testomat.io) + image: https://testomat.io/wp-content/uploads/2022/03/Real_time_report_test_result-936x573.jpg + - name: Allure Codeception Adapter - link: http://github.com/allure-framework/allure-codeception + link: https://github.com/allure-framework/allure-codeception description: This is a Codeception adapter for [Allure Framework](http://allure.qatools.ru) - name: ReportPortal Agent link: https://github.com/reportportal/agent-php-Codeception - description: Integration with [ReportPortal.io](http://reportportal.io) AI-powered test automation dashboard + description: Integration with [ReportPortal.io](https://reportportal.io/) AI-powered test automation dashboard - name: Wiremock Extension description: Allows developers and testers to use WireMock to mock external services when running codeception tests. codeception-wiremock-extension connects to an already running instance of WireMock or can also run automatically a local standalone one. And, it is able to download the version of wiremock you preffer and run it too @@ -15,11 +20,11 @@ description: Docker Selenium Chrome for Codeception is a extension to integrate automatic selenium with chrome in your codeception tests. - name: PhpBuiltinServer - link: http://github.com/tiger-seo/PhpBuiltinServer + link: https://github.com/tiger-seo/PhpBuiltinServer description: Extension for starting and stopping built-in PHP server. Works on Windows, Mac, Linux. - name: Phantoman - link: http://github.com/site5/phantoman + link: https://github.com/site5/phantoman description: Extension for automatically starting and stopping PhantomJS when running tests. - name: Phiremock @@ -32,34 +37,34 @@ image: /images/extensions/codeception-progress-reporter.png - name: DrushDb - link: http://github.com/pfaocle/DrushDb + link: https://github.com/pfaocle/DrushDb image: https://www.drupal.org/files/druplicon-small.png description: DrushDb is a Codeception extension to populate and cleanup test **Drupal** sites during test runs using Drush aliases and the sql-sync command. - name: Notifier - link: http://github.com/Codeception/Notifier + link: https://github.com/Codeception/Notifier description: Flexible notifications with notificator library. - name: WPBrowser, WPDatabase, WPLoader - link: http://github.com/lucatume/wp-browser + link: https://github.com/lucatume/wp-browser image: https://s.w.org/about/images/desktops/wp-light-lo-640x960.png description: WordPress specific extensions of PHPBrowser and Db modules to allow for more streamlined testing of themes and plugins and a WordPress automated testing suite wrapper. - name: Joomla-Browser - link: http://github.com/joomla-projects/joomla-browser + link: https://github.com/joomla-projects/joomla-browser description: An extended Webdriver Browser to navigate through Joomla sites with Codeception. - image: http://codeception.com/images/frameworks/joomla.png + image: https://codeception.com/images/frameworks/joomla.png - name: TestStatistics - link: http://github.com/redCOMPONENT-COM/teststatistics#teststatistics + link: https://github.com/redCOMPONENT-COM/teststatistics#teststatistics description: TestStatistics is a Codeception Extension to measure the performance of your tests. The extension lists your slower steps, probably meaning that the used locator is not performant. Is a smart tool to improve the speed of your Acceptance tests, and serves as example to create your own reporting extensions. - name: TeamCity - link: http://github.com/neronmoon/TeamcityCodeception + link: https://github.com/neronmoon/TeamcityCodeception description: Integration with TeamCity CI server by service-messages - name: EventsScripting - link: http://github.com/oprudkyi/codeception-events-scripting + link: https://github.com/oprudkyi/codeception-events-scripting description: Run shell scripts on events - before/after suites/environments/full test run - name: PauseOnFail @@ -67,14 +72,14 @@ description: Pause execution on failure/error - allow debugging from failed point onwardss - name: SecureShell - link: http://github.com/edno/codeception-secureshell + link: https://github.com/edno/codeception-secureshell description: The Codeception module for SSH commands, SFTP access and SSH tunnels - name: TestRail - link: http://github.com/bookitcom/codeception-testrail + link: https://github.com/bookitcom/codeception-testrail image: https://blog.gurock.com/wp-content/themes/gurock/assets/images/blog/bottom-testrail-ad.png - description: Integration with [TestRail TestCase Management](http://www.gurock.com/testrail/) + description: Integration with [TestRail TestCase Management](https://www.gurock.com/testrail/) - name: Gherkin-Dependsload - link: http://github.com/labbots/codeception-gherkin-dependsload + link: https://github.com/labbots/codeception-gherkin-dependsload description: The Codeception extension for Gherkin features to load and execute dependent scenarios. This extension provides `@dependsload` annotation which lets adding dependencies to gherkin scenarios. diff --git a/_data/modules.yml b/_data/modules.yml index 83603b813..06df2206a 100644 --- a/_data/modules.yml +++ b/_data/modules.yml @@ -1,3 +1,8 @@ +- name: Codeception CRAP reporter + image: https://user-images.githubusercontent.com/6382002/130051733-5a6f18eb-012c-4ef8-96f0-1a12c5b26407.png + link: https://github.com/nebbia-fitness/codecept-coverage-reporter + description: Codeception CRAP reporter is an open-source implementation tool to help you detect PHP code C.R.A.P. – which stands for Change Risk Anti-Patterns. + - name: Amazon S3 Filesystem link: https://github.com/polevaultweb/s3-filesystem description: An Amazon S3 Filesystem module. @@ -40,14 +45,14 @@ link: https://github.com/mendicm/css-regression description: CSS / Visual regression tests integrated in Codeception. This module can be used to compare the current representation of a website element with an expected based on a reference image. This module does not require any JavaScript injections in your website and works with viewport screenshots (chromedriver). Compatible with WebDriver and AngularJS modules. +- name: Database Populator + link: https://github.com/vjik/codeception-db-populator + description: Module for handy populate database. Load only the tables and data that are needed for the current test. This will allow you to create and run tests faster. + color: "#86FF8A" + - name: Date/Time link: https://github.com/nathanmac/datetime-codeception-module - description: This module provides additional helpers for your test to help with date and time comparisons. - -- name: Doctrine1 - link: https://github.com/Codeception/Doctrine1Module - description: Module for Doctrine 1.x ORM (deprecated in Codeception 2.1). - color: "#eee" + description: Additional helpers for date and time comparisons, e.g. seeDateIsToday() - name: Drupal link: https://github.com/guncha25/drupal-codeception @@ -59,7 +64,7 @@ color: "#FFF5C4" - name: GherkinParam - link: http://github.com/edno/codeception-gherkin-param + link: https://github.com/edno/codeception-gherkin-param description: The Codeception module for supporting parameter notation in Gherkin scenario. - name: HighlightCeption @@ -82,10 +87,14 @@ description: Codeception module to test email using MailCare.io (Free, Open Source or paid services). color: "#e65722" +- name: Mailpit + image: ../images/mailpit.svg + link: https://github.com/koehnlein/codeception-email-mailpit + description: Mailpit is a standalone local SMTP server to test email deliveries. The Codeception module provides assertions such as `$I->haveUnreadEmails();` or `$I->seeInOpenedEmailHtmlBody()`. + - name: MailCatcher link: https://github.com/captbaritone/codeception-mailcatcher-module description: MailCatcher is a standalone software which can be configured to catch *any* email sent by your development server, and display it on a webpage. The MailCatcher Module allows you to test the contents of those emails in an acceptance test. - color: "#FFF5C4" - name: MailSMTP link: https://github.com/AhmedSamy/codeception-smtp-mail @@ -144,11 +153,6 @@ link: https://github.com/nicholascus/codeception-stepler description: Enabling step-by-step console execution in bebugging mode. -- name: Symfony1 - link: https://github.com/Codeception/symfony1module - description: Module for symfony 1.x framework (deprecated in Codeception 2.1). - color: "#eee" - - name: VisualCeption link: https://github.com/Codeception/VisualCeption description: Visual regression tests integrated in Codeception. This module can be used to compare the current representation of a website element with an expected. It was written on the shoulders of codeception and integrates in a very easy way. @@ -161,3 +165,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/algolia.html b/_includes/algolia.html index 58043c85f..415a7dad3 100644 --- a/_includes/algolia.html +++ b/_includes/algolia.html @@ -1,24 +1,25 @@ diff --git a/_includes/announcement.html b/_includes/announcement.html deleted file mode 100644 index 3a23886a3..000000000 --- a/_includes/announcement.html +++ /dev/null @@ -1,3 +0,0 @@ - \ No newline at end of file diff --git a/_includes/cloudways.html b/_includes/cloudways.html new file mode 100644 index 000000000..b283aee3a --- /dev/null +++ b/_includes/cloudways.html @@ -0,0 +1,4 @@ + + cloudways + diff --git a/_includes/comment.html b/_includes/comment.html index 7fe39734b..0b52c8748 100644 --- a/_includes/comment.html +++ b/_includes/comment.html @@ -9,4 +9,4 @@ (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); - + diff --git a/_includes/companies.html b/_includes/companies.html index 7706fc0fb..2b796003c 100644 --- a/_includes/companies.html +++ b/_includes/companies.html @@ -1,31 +1,31 @@
- Rebilly + Rebilly
- Deposit Photos + Deposit Photos
- PDF Filler + PDF Filler
- Genesis Tech + Genesis Tech
- Spryker + Spryker
- 2 Amigos + 2 Amigos
- Magma Digital + Magma Digital
- Magma Digital + Magma Digital
\ No newline at end of file diff --git a/_includes/extensions.md b/_includes/extensions.md index 6bff0e392..9d9df2b06 100644 --- a/_includes/extensions.md +++ b/_includes/extensions.md @@ -2,10 +2,10 @@ ## DotReporter -[See Source](https://github.com/Codeception/Codeception/blob/4.1/ext/DotReporter.php) +[See Source](https://github.com/Codeception/Codeception/blob/main/ext/DotReporter.php) DotReporter provides less verbose output for test execution. -Like PHPUnit printer it prints dots "." for successful testes and "F" for failures. +Like PHPUnit printer it prints dots "." for successful tests and "F" for failures. ![](https://cloud.githubusercontent.com/assets/220264/26132800/4d23f336-3aab-11e7-81ba-2896a4c623d2.png) @@ -38,7 +38,7 @@ Use this extension as an example for building custom reporters. ## Logger -[See Source](https://github.com/Codeception/Codeception/blob/4.1/ext/Logger.php) +[See Source](https://github.com/Codeception/Codeception/blob/main/ext/Logger.php) Log suites/tests/steps using Monolog library. Monolog should be installed additionally by Composer. @@ -66,16 +66,16 @@ extensions: ## Recorder -[See Source](https://github.com/Codeception/Codeception/blob/4.1/ext/Recorder.php) +[See Source](https://github.com/Codeception/Codeception/blob/main/ext/Recorder.php) -Saves a screenshot of each step in acceptance tests and shows them as a slideshow on one HTML page (here's an [example](http://codeception.com/images/recorder.gif)) -Activated only for suites with WebDriver module enabled. +Saves a screenshot of each step in acceptance tests and shows them as a slideshow on one HTML page (here's an [example](https://codeception.com/images/recorder.gif)). +Works only for suites with WebDriver module enabled. The screenshots are saved to `tests/_output/record_*` directories, open `index.html` to see them as a slideshow. #### Installation -Add this to the list of enabled extensions in `codeception.yml` or `acceptance.suite.yml`: +Add this to the list of enabled extensions in `codeception.yml` or `Acceptance.suite.yml`: ``` yaml extensions: @@ -106,7 +106,7 @@ extensions: ``` #### Skipping recording of steps with annotations -It is also possible to skip recording of steps for specified tests by using the @skipRecording annotation. +It is also possible to skip recording of steps for specified tests by using the `@skipRecording` annotation. ```php /** @@ -116,16 +116,15 @@ It is also possible to skip recording of steps for specified tests by using the public function testLogin(AcceptanceTester $I) { $I->login(); - $I->amOnUrl('http://codeception.com'); + $I->amOnUrl('https://codeception.com'); } ``` - ## RunBefore -[See Source](https://github.com/Codeception/Codeception/blob/4.1/ext/RunBefore.php) +[See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunBefore.php) Extension for execution of some processes before running tests. @@ -156,9 +155,9 @@ HINT: you can use different configurations per environment. ## RunFailed -[See Source](https://github.com/Codeception/Codeception/blob/4.1/ext/RunFailed.php) +[See Source](https://github.com/Codeception/Codeception/blob/main/ext/RunFailed.php) -Saves failed tests into tests/_output/failed in order to rerun failed tests. +Saves failed tests into `tests/_output/failed` in order to rerun failed tests. To rerun failed tests just run the `failed` group: @@ -170,9 +169,9 @@ To change failed group name add: ``` --override "extensions: config: Codeception\Extension\RunFailed: fail-group: another_group1" ``` -Remember: if you run tests and they generated custom-named fail group, to run this group, you should add override too +Remember: If you run tests and they generated custom-named fail group, to run this group, you should add override too -Starting from Codeception 2.1 **this extension is enabled by default**. +**This extension is enabled by default.** ``` yaml extensions: @@ -185,15 +184,16 @@ On each execution failed tests are logged and saved into `tests/_output/failed` ## RunProcess -[See Source](https://github.com/Codeception/Codeception/blob/4.1/ext/RunProcess.php) +[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, etc. +Can be used to start/stop selenium server, chromedriver, [MailCatcher](https://mailcatcher.me/), 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 configured in suite config: +Can be enabled in suite config: ```yaml -# acceptance.suite.yml +# Acceptance.suite.yml extensions: enabled: - Codeception\Extension\RunProcess: @@ -203,8 +203,7 @@ extensions: Multiple parameters can be passed as array: ```yaml -# acceptance.suite.yml - +# Acceptance.suite.yml extensions: enabled: - Codeception\Extension\RunProcess: @@ -214,8 +213,7 @@ 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 `sleep` option. In this case you need configuration to be specified as object: ```yaml extensions: @@ -226,13 +224,13 @@ extensions: sleep: 5 # wait 5 seconds for processes to boot ``` -HINT: you can use different configurations per environment. +HINT: You can use different configurations per environment. ## SimpleReporter -[See Source](https://github.com/Codeception/Codeception/blob/4.1/ext/SimpleReporter.php) +[See Source](https://github.com/Codeception/Codeception/blob/main/ext/SimpleReporter.php) This extension demonstrates how you can implement console output of your own. Recommended to be used for development purposes only. diff --git a/_includes/for.html b/_includes/for.html deleted file mode 100644 index 06f122a6e..000000000 --- a/_includes/for.html +++ /dev/null @@ -1,55 +0,0 @@ -
- - - -
- -
- - - - -
- diff --git a/_includes/frameworks.html b/_includes/frameworks.html new file mode 100644 index 000000000..e8e305b13 --- /dev/null +++ b/_includes/frameworks.html @@ -0,0 +1,35 @@ +
+ + + + +
+ diff --git a/_includes/guides.html b/_includes/guides.html index 50630bbb8..040143aef 100644 --- a/_includes/guides.html +++ b/_includes/guides.html @@ -1 +1,17 @@ -
  • Introduction
  • Getting Started
  • Acceptance Tests
  • Functional Tests
  • Unit Tests
  • Modules And Helpers
  • Reusing Test Code
  • Advanced Usage
  • BDD
  • Customization
  • Data
  • API Testing
  • Codecoverage
  • Continuous Integration
  • Parallel Execution
  • \ No newline at end of file +
  • Introduction
  • +
  • Getting Started
  • +
  • Acceptance Tests
  • +
  • Functional Tests
  • +
  • Unit Tests
  • +
  • Debugging
  • +
  • Modules And Helpers
  • +
  • Reusing Test Code
  • +
  • Advanced Usage
  • +
  • BDD
  • +
  • Customization
  • +
  • Data
  • +
  • API Testing
  • +
  • Codecoverage
  • +
  • Reporting
  • +
  • Continuous Integration
  • +
  • Parallel Execution
  • \ No newline at end of file diff --git a/_includes/hero.html b/_includes/hero.html index 01e5e6ec5..b63456449 100644 --- a/_includes/hero.html +++ b/_includes/hero.html @@ -1,24 +1,19 @@ - -
    -
    -
    - code example - -

    PHP Testing for
    everyone_

    - -

    - Codeception collects and shares best practices and solutions for testing PHP web applications. With a flexible - set of included modules tests are easy to write, easy to use and easy to maintain.
    -

    - - +
    +
    + code example +

    PHP Testing for
    everyone_

    +

    + Codeception collects and shares best practices and solutions for testing PHP web applications. With a + flexible + set of included modules tests are easy to write, easy to use and easy to maintain.
    +

    + +
    -
    - diff --git a/_includes/joomla_hero.html b/_includes/joomla_hero.html index 4e2b2405e..efea67de8 100644 --- a/_includes/joomla_hero.html +++ b/_includes/joomla_hero.html @@ -1,15 +1,14 @@
    -
    -
    -
    -
    -

    - Codeception for - - Joomla

    - +
    +
    +
    +
    +

    + Codeception for + Joomla +

    +
    +
    -
    -
    -
    \ No newline at end of file +
    diff --git a/_includes/js.html b/_includes/js.html index 114469142..8bee78f05 100644 --- a/_includes/js.html +++ b/_includes/js.html @@ -1,5 +1,7 @@ - + \ No newline at end of file diff --git a/_includes/laravel_hero.html b/_includes/laravel_hero.html index 300478491..fad0bacef 100644 --- a/_includes/laravel_hero.html +++ b/_includes/laravel_hero.html @@ -1,15 +1,14 @@
    -
    -
    -
    -
    -

    - Codeception for - - Laravel Framework Laravel -

    +
    +
    +
    +
    +

    + Codeception for + Laravel Framework Laravel +

    +
    +
    -
    -
    \ No newline at end of file diff --git a/_includes/modules.html b/_includes/modules.html index 064f069d6..1a27a238f 100644 --- a/_includes/modules.html +++ b/_includes/modules.html @@ -4,7 +4,7 @@
  • Cli
  • DataFactory
  • Db
  • -
  • Doctrine2
  • +
  • Doctrine
  • FTP
  • Filesystem
  • Laminas
  • @@ -23,4 +23,4 @@
  • SOAP
  • Symfony
  • WebDriver
  • -
  • Yii2
  • \ No newline at end of file +
  • Yii2
  • diff --git a/_includes/phalcon_hero.html b/_includes/phalcon_hero.html index c208c7aaa..5ae0f4a36 100644 --- a/_includes/phalcon_hero.html +++ b/_includes/phalcon_hero.html @@ -1,15 +1,13 @@
    -
    -
    -
    -
    -

    - Codeception for - - Phalcon

    - +
    +
    +
    +
    +

    + Codeception for + Phalcon

    +
    +
    -
    -
    diff --git a/_includes/phar.html b/_includes/phar.html index 19f7f37f6..203c45952 100644 --- a/_includes/phar.html +++ b/_includes/phar.html @@ -1,97 +1,110 @@ -
    -
    -