From 8a0e0b0cc8eac830a08f827b2a260f929ac496ec Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 5 Sep 2022 10:38:02 +0200 Subject: [PATCH] MOBILE-4081 behat: Check site compatibility Whether the version of the moodle site is compatible should be checked automatically, however with the current implementation it's only checked once the app is launched. So in some scenarios, it may be necessary to explicitly tell behat to check the site. --- local_moodleappbehat/tests/behat/behat_app.php | 10 ++++++++++ .../course/tests/behat/basic_usage-311.feature | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/local_moodleappbehat/tests/behat/behat_app.php b/local_moodleappbehat/tests/behat/behat_app.php index 4b644d1f3..84f4f2220 100644 --- a/local_moodleappbehat/tests/behat/behat_app.php +++ b/local_moodleappbehat/tests/behat/behat_app.php @@ -558,6 +558,16 @@ class behat_app extends behat_app_helper { } } + /** + * Check whether the moodle site is compatible with the current feature file + * and skip it otherwise. This will be checked looking at tags such as @lms_uptoXXX + * + * @Given the Moodle site is compatible with this feature + */ + public function the_moodle_site_is_compatible_with_this_feature() { + $this->check_tags(); + } + /** * Clicks on / touches something that is visible in the app. * diff --git a/src/core/features/course/tests/behat/basic_usage-311.feature b/src/core/features/course/tests/behat/basic_usage-311.feature index 99d3f88c7..99b642baf 100755 --- a/src/core/features/course/tests/behat/basic_usage-311.feature +++ b/src/core/features/course/tests/behat/basic_usage-311.feature @@ -72,7 +72,8 @@ Feature: Test basic usage of one course in app | workshop | Test workshop name | Test workshop | C1 | workshop | 0 | 3 | Scenario: Self enrol - Given I log in as "teacher1" + Given the Moodle site is compatible with this feature + And I log in as "teacher1" And I am on "Course 1" course homepage And I add "Self enrolment" enrolment method with: | Custom instance name | Student self enrolment |