From e0034b0566bdb095336a05eab9911e5230a4ee63 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Sun, 17 Apr 2022 20:27:57 +0200 Subject: [PATCH] MDL-74512 behat: Skip tests requiring lang install/upgrade By adding the step: Given remote langimport tests are enabled We make the execution of scenarios requiring to install / upgrade lang packs optional, based in the existence of the constant: TOOL_LANGIMPORT_REMOTE_TESTS That way, when we are skipping language upgrades with the CFG var: $CFG->skiplangupgrade = true We can decide not not execute those tests. With other words, putting something like this in the config.php file we will be controlling when to execute or no the behat tests: // Disable lang updates on upgrade. $CFG->skiplangupgrade = true; if (empty($CFG->skiplangupgrade)) { // Define it only if we aren't skipping lang upgrades. define('TOOL_LANGIMPORT_REMOTE_TESTS', true); } --- auth/tests/behat/loginform.feature | 3 ++- theme/boost/tests/behat/languagemenu.feature | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/auth/tests/behat/loginform.feature b/auth/tests/behat/loginform.feature index 3a006863845..7915fb3e4df 100644 --- a/auth/tests/behat/loginform.feature +++ b/auth/tests/behat/loginform.feature @@ -17,7 +17,8 @@ Feature: Test if the login form provides the correct feedback Then I should see "Invalid login, please try again" Scenario: Test login language selector - Given I log in as "admin" + Given remote langimport tests are enabled + And I log in as "admin" And I navigate to "Language > Language packs" in site administration And I set the field "Available language packs" to "nl,es" And I press "Install selected language pack(s)" diff --git a/theme/boost/tests/behat/languagemenu.feature b/theme/boost/tests/behat/languagemenu.feature index 46475e0cfd5..f7905d74c57 100644 --- a/theme/boost/tests/behat/languagemenu.feature +++ b/theme/boost/tests/behat/languagemenu.feature @@ -5,7 +5,8 @@ Feature: Language selector menu I need to be presented with a language selector menu Background: - Given the following "courses" exist: + Given remote langimport tests are enabled + And the following "courses" exist: | fullname | shortname | | Course 1 | C1 | And the following "users" exist: