From 1ca206e118b667b1347638c6f7997b03a1ecd036 Mon Sep 17 00:00:00 2001 From: DerekCrannaford <43056286+DerekCrannaford@users.noreply.github.com> Date: Tue, 2 May 2023 10:19:41 +1000 Subject: [PATCH 1/3] Feature: work to codeception5 (#66) (#68) * First cut working, some kludges * First cut regressions for use * DB config for local * Incremental regressions into CodeSpaces * Correct testrunner config * No subsystem * Abandon auto chmod * As running in space * Check remote can push * GitIgnore UnitTest cache * Check can push from remote * Check can push from remote * Try to fix xdebug * Tentative XDebug OK * Retested Xdebug setup * Try DBug without restart * Still tweaking XDB * Still nudging XDB * Still A/B testing XDB settings * Update CI SeleniumRefs & Lint Docker Compose * Radically simplify XDebug ini * smtp config in template * Additional test env config on mail * Refactor per 8.1 ambitions * Skip questionable linter compatibility * Try alternative linter * Try 8.1 version overtrue * Use checkout v3 --------- Co-authored-by: Derek Crannaford Co-authored-by: Adam Buckley --- .codepipeline/local-dev/local-dev-config.php | 139 ++++++++++++++++++ .codepipeline/local-dev/start.sh | 38 ++--- .../test_agent/configs/test_agent-config.php | 2 +- .github/workflows/ci.yml | 6 +- .gitignore | 2 + README.md | 2 +- cmfiveTests.php | 32 ++-- docker-compose.yml | 34 +---- system | 1 - test/.install/install.sh | 16 +- .../tests/boilerplate/CmfiveUI.php | 2 + .../acceptance/helpers/CmfiveSite.php | 11 +- test_agent-compose.yml | 8 +- 13 files changed, 213 insertions(+), 80 deletions(-) create mode 100644 .codepipeline/local-dev/local-dev-config.php delete mode 160000 system diff --git a/.codepipeline/local-dev/local-dev-config.php b/.codepipeline/local-dev/local-dev-config.php new file mode 100644 index 00000000..cfd9cee4 --- /dev/null +++ b/.codepipeline/local-dev/local-dev-config.php @@ -0,0 +1,139 @@ + "mysqldb", + "username" => "cmfive", + "password" => "cmfive", + "database" => "cmfive", + "driver" => getenv('DB') ?: "mysql", + "backups" => + [ + 'outputExt' => 'sql', + 'commandPath' => [ + 'unix' => '/usr/bin/', + 'windows' => '"C:\\Program Files\\MySQL\\MySQL Server 5.6\\bin\\' + ], + 'backupCommand' => [ + 'unix' => 'mysqldump -u $username -h $hostname -P $port -p\'$password\' $dbname > $filename', + 'windows' => 'mysqldump.exe" -h$hostname -P$port -u$username -p$password $dbname > $filename' + ], + 'restoreCommand' => [ + 'unix' => 'mysql -u $username -h $hostname -P $port -p\'$password\' $dbname < $filename', + 'windows' => 'mysql.exe" -D$dbname -h$hostname -P$port -u$username -p$password < $filename' + ], + ] +]); + +Config::set("report.database", [ + "hostname" => "mysqldb", + "username" => "cmfivero", + "password" => "cmfivero", + "database" => "cmfive", + "driver" => getenv('DB') ?: "mysql", +]); + +//=========== Email Layer Configuration ===================== +Config::append('email', [ + "layer" => "smtp", // smtp or sendmail or aws + "command" => "", // used for sendmail layer only + "host" => "email-smtp.ap-southeast-2.amazonaws.com", + "port" => 465, + "auth" => true, + "username" => getenv('SMTP_USERNAME') ?: '', + "password" => getenv('SMTP_PASSWORD') ?: '', +]); + +//========== TestRunner Configuration ========================== +Config::set("system.environment", "development"); +Config::set("core_template.foundation.reveal.animation", "none"); +Config::set("core_template.foundation.reveal.animation_speed", 0); +//========== must be "ENABLED" to run ========================== +//========== "config" will pass through to CmfiveSite helper === +Config::set('system.environment', "development"); +Config::set( + "tests", + [ + "testrunner" => "ENABLED", + "config" => '', + "yaml" => + [ + "- WebDriver:" => + [ + "url" => "http://webapp:3000", + "browser" => "chrome", + "wait" => "8", + "host" => "seleniumDrv", + "port" => "4444", + "capabilities" => + [ + "acceptInsecureCerts" => true, + "goog:chromeOptions" => [ + "w3c" => "false", + "args" => '[' + .'"--headless=new","--disable-gpu",' + .'"-proxy-bypass-list=*","--proxy-server=direct://","--dns-prefetch-disable",' + .'"--disk-cache-size=0","–-media-cache-size=0",' + .'"--window-size=1920,1200","--disable-remote-fonts",' + .'"--ignore-certificate-errors","--disable-extensions","--no-sandbox",' + // .'"--enable-logging=/var/customlog/ch.log","--v=1' + .'"--disable-dev-shm-usage"' + .']' + ] + ] + ], + "- Db:" => + [ + "dsn" => "mysql:host=mysqldb:3306;dbname=cmfive", + "user" => "cmfive", + "password" => "cmfive", + ], + "- Asserts:" => "", + ] + ] +); + +//========= Anonymous Access ================================ +// bypass authentication if sent from the following IP addresses +// specify an IP address and an array of allowed actions from that IP +Config::set("system.allow_from_ip", [ + // "10.0.0.0" => array("action1", "action2"), +]); + +// or bypass authentication for the following modules +Config::set("system.allow_module", [ + // "rest", // uncomment this to switch on REST access to the database objects. +]); + +// or bypass authentication for the following actions +Config::set('system.allow_action', [ + "auth/login", + "auth/forgotpassword", + "auth/resetpassword", + //"admin/datamigration" +]); + +//========= REST Configuration ============================== +// check the following configuration carefully to secure +// access to the REST infrastructure. +//=========================================================== + +// use the API_KEY to authenticate with username and password +Config::set('system.rest_api_key', "abcdefghijklmnopqrstuvwxyz1234567890"); + +// include class of objects that you want available via REST +// be aware that only the listed objects will be available via +// the REST API +Config::set('system.rest_include', [ + // "Contact" +]); diff --git a/.codepipeline/local-dev/start.sh b/.codepipeline/local-dev/start.sh index b5749176..09e60241 100644 --- a/.codepipeline/local-dev/start.sh +++ b/.codepipeline/local-dev/start.sh @@ -1,26 +1,30 @@ #!/bin/bash -./test/.install/install.sh - #setup for XDebug -if ping -c 1 host.docker.internal; then INTERNAL_HOST_IP=host.docker.internal; \ - else if ping -c 1 docker.for.mac.localhost; then INTERNAL_HOST_IP=docker.for.mac.localhost; \ - else if ping -c 1 docker.for.win.localhost; then INTERNAL_HOST_IP=docker.for.win.localhost; \ - else INTERNAL_HOST_IP=$(ip route show default | awk '/default/ {print $3}'); fi; fi; fi; +# if ping -c 1 host.docker.internal; then INTERNAL_HOST_IP=host.docker.internal; \ +# else if ping -c 1 docker.for.mac.localhost; then INTERNAL_HOST_IP=docker.for.mac.localhost; \ +# else if ping -c 1 docker.for.win.localhost; then INTERNAL_HOST_IP=docker.for.win.localhost; \ +# else INTERNAL_HOST_IP=$(ip route show default | awk '/default/ {print $3}'); fi; fi; fi; + +# echo "zend_extension=xdebug.so" > /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "[xdebug]" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "xdebug.mode=debug" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "xdebug.client_host=${INTERNAL_HOST_IP}" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "xdebug.client_port=9003" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "xdebug.remote_connect_back=On" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "xdebug.remote_handler=dbgp" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "xdebug.remote_log=/tmp/xdebug.log" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ +# && echo "xdebug.max_nesting_level=250" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini + # && echo "xdebug.start_with_request=yes" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini echo "zend_extension=xdebug.so" > /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "[xdebug]" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.remote_enable=1" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.remote_host=${INTERNAL_HOST_IP}" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.remote_connect_back=0" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.remote_autostart=1" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.remote_handler=dbgp" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.max_nesting_level=250" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.client_host=${INTERNAL_HOST_IP}" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.mode=debug" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.start_with_request=yes" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ - && echo "xdebug.client_port=9003" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini + && echo "[xdebug]" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ + && echo "xdebug.mode=debug,develop" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ + && echo "xdebug.discover_client_host=true" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ + && echo "xdebug.max_nesting_level=250" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini \ + && echo "xdebug.start_with_request=yes" >> /etc/php/8.1/fpm/conf.d/20-xdebug.ini +service php8.1-fpm restart supervisord -n -c /etc/supervisord.conf \ No newline at end of file diff --git a/.codepipeline/test_agent/configs/test_agent-config.php b/.codepipeline/test_agent/configs/test_agent-config.php index 1a06efc1..d73aec8f 100644 --- a/.codepipeline/test_agent/configs/test_agent-config.php +++ b/.codepipeline/test_agent/configs/test_agent-config.php @@ -73,7 +73,7 @@ "url" => "http://webapp:3000", "browser" => "chrome", "wait" => "60", - "host" => "selenium314", + "host" => "seleniumDrv", "port" => "4444", "capabilities" => [ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87113a34..85145820 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,12 +3,14 @@ name: CI on: pull_request jobs: + # WAS: michaelw90/PHP-Lint@master, stuck on docker PHP7.3! + # WORKS for: StephaneBour/actions-php-lint@8.1 = simply "php -l" phplint: name: PHP Lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: michaelw90/PHP-Lint@master + - uses: actions/checkout@v3 + - uses: overtrue/phplint@5.3.0 php-codesniffer74: name: PHP CS 7.4 runs-on: ubuntu-latest diff --git a/.gitignore b/.gitignore index c46630fd..aa1a09e5 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ /storage/session /log +.phpunit.result.cache + desktop.ini docker-compose.override.yml .env diff --git a/README.md b/README.md index bd4d4bea..46b818a3 100644 --- a/README.md +++ b/README.md @@ -35,4 +35,4 @@ php cmfive.php [select option 3 and fill in the prompts] ``` -From there, navigate to [https://localhost:9002](https://localhost:9002) and log in with your admin account \ No newline at end of file +From there, navigate to: [https://localhost:9002](https://localhost:9002) and log in with your admin account. \ No newline at end of file diff --git a/cmfiveTests.php b/cmfiveTests.php index f6f4fdfa..7ac36fd0 100644 --- a/cmfiveTests.php +++ b/cmfiveTests.php @@ -22,9 +22,9 @@ defined('HELP_DIRECTORY') || define('HELP_DIRECTORY', DS . 'acceptance' . DS . 'helpers'); defined('UNIT_DIRECTORY') || define('UNIT_DIRECTORY', DS . 'unit'); -defined('CEST_DESTINATION') || define('CEST_DESTINATION', TEST_DIRECTORY . DS . 'tests' . DS . 'acceptance'); -defined('STEP_DESTINATION') || define('STEP_DESTINATION', TEST_DIRECTORY . DS . 'tests' . DS . '_support' . DS . 'Step' . DS . 'Acceptance'); -defined('HELP_DESTINATION') || define('HELP_DESTINATION', TEST_DIRECTORY . DS . 'tests' . DS . '_support' . DS . 'Helper'); +defined('CEST_DESTINATION') || define('CEST_DESTINATION', TEST_DIRECTORY . DS . 'tests' . DS . 'Acceptance'); +defined('STEP_DESTINATION') || define('STEP_DESTINATION', TEST_DIRECTORY . DS . 'tests' . DS . 'Support' . DS . 'Step' . DS . 'Acceptance'); +defined('HELP_DESTINATION') || define('HELP_DESTINATION', TEST_DIRECTORY . DS . 'tests' . DS . 'Support' . DS . 'Helper'); defined('UNIT_DESTINATION') || define('UNIT_DESTINATION', 'test' . DS . 'unit'); defined('SHARED_SOURCE') || define('SHARED_SOURCE', 'boilerplate'); @@ -56,7 +56,7 @@ 'UA_TestConfig' => "tests.config" ]; -defined('DEBUG_RUN') || define('DEBUG_RUN', "run --steps --debug acceptance"); +defined('DEBUG_RUN') || define('DEBUG_RUN', "run --steps --debug Acceptance"); defined('PHPUNIT_RUN') || define('PHPUNIT_RUN', ""); ini_set('display_errors', 1); @@ -297,10 +297,10 @@ function allowRunner() } return true; } else { - echo "Test runner not enabled in config\n"; + echo "Test runner not enabled in config\n"; } } else { - echo "system/web.php not found\n"; + echo "system/web.php not found\n"; } return false; } @@ -424,13 +424,13 @@ function purgeTestCode() exec('del ' . CEST_DESTINATION . DS . '*Cest.php'); exec('del ' . STEP_DESTINATION . DS . '*.php'); exec('del ' . HELP_DESTINATION . DS . '*.php'); - exec('del ' . HELP_DESTINATION . DS . '..' . DS . '*.php'); + // exec('del ' . HELP_DESTINATION . DS . '..' . DS . '*.php'); exec('del ' . UNIT_DESTINATION . DS . '*.php'); } else { exec('rm -f ' . CEST_DESTINATION . DS . '*Cest.php'); exec('rm -f ' . STEP_DESTINATION . DS . '*.php'); exec('rm -f ' . HELP_DESTINATION . DS . '*.php'); - exec('rm -f ' . HELP_DESTINATION . DS . '..' . DS . '*.php'); + // exec('rm -f ' . HELP_DESTINATION . DS . '..' . DS . '*.php'); exec('rm -f ' . UNIT_DESTINATION . DS . '*.php'); } } @@ -474,7 +474,7 @@ function reportModules($moduleCapabilities) function registerConfig() { - $destPath = BOILERPLATE_TEST_DIRECTORY . DS . "acceptance.suite.dist.yml"; + $destPath = BOILERPLATE_TEST_DIRECTORY . DS . "Acceptance.suite.dist.yml"; $ConfigYML = fopen($destPath, "w"); if (!$ConfigYML) { @@ -511,21 +511,29 @@ function registerHelpers($moduleCapabilities) // hence could feed test data (CSV,SQL etc) // $sharedParam & registerBoilerplateParametersmake it work - $destPath = BOILERPLATE_TEST_DIRECTORY . DS . "acceptance.suite.yml"; + $destPath = BOILERPLATE_TEST_DIRECTORY . DS . "Acceptance.suite.yml"; $HelperYML = fopen($destPath, "w"); if (!$HelperYML) { return; } - $hdr = "modules:\n enabled:\n"; + $hdr = "actor: CmfiveUI\n" + . "gherkin:\n" + . " contexts:\n" + . " default:\n" + . " - \Tests\Support\AcceptanceTester\n" + . " - \Tests\Support\CmfiveUI\n" + . "modules:\n" + . " enabled:\n"; + fwrite($HelperYML, $hdr); foreach ($moduleCapabilities as $capabilities => $capability) { if ($capabilities == "Helpers") { foreach ($capability as $handler => $resources) { foreach ($resources as $resource) { - fwrite($HelperYML, " - Helper\\" . $resource . ":\n"); + fwrite($HelperYML, " - Tests\\Support\\Helper\\" . $resource . ":\n"); // per notes above, can insert required values here... $from = $moduleCapabilities['Paths'][$handler][0]; $from = substr($from, 0, strpos($from, "acceptance")) . "acceptance" . DS; diff --git a/docker-compose.yml b/docker-compose.yml index 5a0dc209..3e55811b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,6 @@ services: - TZ=Australia/Sydney volumes: - ./:/var/www/html - - codecept:/var/www/html/test/Codeception - ./test/Codeception/tests/boilerplate:/var/www/html/test/Codeception/tests/boilerplate - ./test/Codeception/tests/_output:/var/www/html/test/Codeception/tests/_output ports: @@ -41,46 +40,23 @@ services: links: - mysqldb - seleniumsrv - # ------------------------------------------------------------ - # For IDE&Debug symlinks are best made on the HOST FS - # Otherwise, to customise mounts etc: - # 1) create a docker-compose.override.yml : - # |--------------> - # | version: '3' - # | - # | services: - # | webapp: - # |--------------> - # 2) add your preferences, eg: - # |--------------> - # | volumes: - # | - hostPathTo/myHostFolderFullOfStuff:/var/hostmounts - # |--------------> - # 3) you can make symlinks in container shell under boilerplate, eg: - # |--------------> - # | cd /var/www/html/modules - # | ln -s /var/hostmounts/myModules/cmfiveModule cmfiveModule - # |--------------> - # ------------------------------------------------------------ seleniumsrv: - # promoting: - # docker run --net=cmfive-boilerplate_default --network-alias=selenium314 -p 4444:4444 selenium/standalone-chrome:3.14.0 - image: selenium/standalone-chrome:105.0 - container_name: selenium314 - hostname: selenium314 + image: selenium/standalone-chrome:111.0 + container_name: seleniumDrv + hostname: seleniumDrv ports: - "4444:4444" environment: - TZ=Australia/Sydney + - START_XVFB=false + shm_size: '4gb' networks: - default volumes: dbdata: driver: local - codecept: - driver: local networks: default: diff --git a/system b/system deleted file mode 160000 index db3ebc80..00000000 --- a/system +++ /dev/null @@ -1 +0,0 @@ -Subproject commit db3ebc804b3042e4b2c6971fdd30a90873b72fe0 diff --git a/test/.install/install.sh b/test/.install/install.sh index aa1a92fe..fe3d6a09 100755 --- a/test/.install/install.sh +++ b/test/.install/install.sh @@ -1,6 +1,6 @@ #!/bin/bash -#setup for Codeception +#setup for Codeception: SCRIPTPATH="$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )" cd "${SCRIPTPATH}/../Codeception" @@ -10,17 +10,17 @@ curl -sS https://getcomposer.org/installer | php -- \ --filename=composer \ --install-dir=. ; -./composer -q require codeception/codeception:4.1.31 --dev ; +./composer -q require codeception/codeception:5.0.10 --dev ; ./composer config minimum-stability dev -./composer require -W --no-update codeception/module-asserts:2.0.1 \ -codeception/module-db:2.0.2 \ -codeception/module-webdriver:2.0.2 \ -codeception/module-phpbrowser:2.0.2 +./composer require -W --no-update codeception/module-asserts:3.0.0 \ +codeception/module-db:3.1.0 \ +codeception/module-webdriver:4.0.0 \ +codeception/module-phpbrowser:3.0.0 ./composer update --prefer-source --no-interaction --no-progress --optimize-autoloader --ansi; -vendor/bin/codecept bootstrap ; +php vendor/bin/codecept bootstrap; -chmod -R 774 tests/* ; +chmod -R 777 tests/* ; # mkdir tests/acceptance; diff --git a/test/Codeception/tests/boilerplate/CmfiveUI.php b/test/Codeception/tests/boilerplate/CmfiveUI.php index b5d96e7f..1763293d 100755 --- a/test/Codeception/tests/boilerplate/CmfiveUI.php +++ b/test/Codeception/tests/boilerplate/CmfiveUI.php @@ -1,5 +1,7 @@ getTestDB(); $this->runMigrations(); @@ -168,7 +168,10 @@ public function clickCmfiveNavbar($I, $category, $link) { if ($this->isUsingBootstrap5($I)) { // $I->waitForElement(".navbar-nav .nav-item .nav-link", 2); - $I->click("#topnav_" . str_replace(" ", "_", strtolower($category)) . "_dropdown_link"); // ".navbar-nav .nav-item a.nav-link"); + // $I->click("#topnav_" . str_replace(" ", "_", strtolower($category)) . "_dropdown_link"); // ".navbar-nav .nav-item a.nav-link"); + + $I->waitForElementClickable(".//a[@id='topnav_" . str_replace(" ", "_", strtolower($category)) . "_dropdown_link']",2); + $I->click(".//a[@id='topnav_" . str_replace(" ", "_", strtolower($category)) . "_dropdown_link']"); $I->click($link, "#topnav_" . str_replace(" ", "_", strtolower($category)) . "_dropdown_link + .dropdown-menu"); $I->wait(1); } else { diff --git a/test_agent-compose.yml b/test_agent-compose.yml index 80fa6f3d..30209c62 100644 --- a/test_agent-compose.yml +++ b/test_agent-compose.yml @@ -41,11 +41,9 @@ services: - seleniumsrv seleniumsrv: - # promoting: - # docker run --net=cmfive-boilerplate_default --network-alias=selenium314 -p 4444:4444 selenium/standalone-chrome:3.14.0 - image: selenium/standalone-chrome:3.14.0 - container_name: selenium314 - hostname: selenium314 + image: selenium/standalone-chrome:111.0 + container_name: seleniumDrv + hostname: seleniumDrv ports: - "4444:4444" environment: From ec325759a4e47fdb285727d20f0a9595297e1fa2 Mon Sep 17 00:00:00 2001 From: DerekCrannaford <43056286+DerekCrannaford@users.noreply.github.com> Date: Wed, 17 May 2023 10:34:56 +1000 Subject: [PATCH 2/3] Stop core default as MASTER when no PHPversion (#69) --- cmfive.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/cmfive.php b/cmfive.php index f32db908..89c04d9f 100755 --- a/cmfive.php +++ b/cmfive.php @@ -331,12 +331,19 @@ function sketchComposerForCore($reference, $phpVersion) if (PHP_MAJOR_VERSION === 7 && PHP_MINOR_VERSION === 0) { $reference = "legacy/PHP7.0"; $phpVersion = "7.0"; - } else { - $reference = "master"; + } + if (PHP_MAJOR_VERSION === 7 && PHP_MINOR_VERSION === 4) { + $reference = "legacy/PHP7.4"; + $phpVersion = "7.4"; + } + if (is_null($reference) || is_null($phpVersion)) { + $reference = is_null($reference) ? "master" : $reference; $phpVersion = is_null($phpVersion) ? (PHP_MAJOR_VERSION .".". PHP_MINOR_VERSION) : $phpVersion; } } + echo ("Composer has ref's as " . $reference . " & " . $phpVersion . ".\n"); + $composer_string = << Date: Wed, 15 Nov 2023 07:42:40 +0000 Subject: [PATCH 3/3] Allow test nav helper to be re-entrant --- .../tests/boilerplate/acceptance/helpers/CmfiveSite.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/Codeception/tests/boilerplate/acceptance/helpers/CmfiveSite.php b/test/Codeception/tests/boilerplate/acceptance/helpers/CmfiveSite.php index a9e1fb6e..fce530c1 100755 --- a/test/Codeception/tests/boilerplate/acceptance/helpers/CmfiveSite.php +++ b/test/Codeception/tests/boilerplate/acceptance/helpers/CmfiveSite.php @@ -178,6 +178,12 @@ public function clickCmfiveNavbar($I, $category, $link) //$category, "section.top-bar-section ul.left" $I->waitForElement("//section[@class='top-bar-section']/ul[@class='left']/li/a[contains(text(),'{$category}')]", 2); $I->click("//section[@class='top-bar-section']/ul[@class='left']/li/a[contains(text(),'{$category}')]"); + // New designs now emerging on whole module (not just specific actions) + // So we should check if first step navbar click flipped us into BootStrap: + if ($this->isUsingBootstrap5($I)) { + $I->clickCmfiveNavbar($I, $category, $link); + return; + } $I->moveMouseOver(['css' => '#topnav_' . strtolower($category)]); $I->waitForText($link); $I->click($link, '#topnav_' . strtolower($category));