File tree Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Expand file tree Collapse file tree 2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change 1919require_once (__DIR__ . '/../../../../lib/behat/behat_base.php ' );
2020require_once (__DIR__ . '/behat_app_helper.php ' );
2121
22+ use Behat \Behat \Hook \Scope \ScenarioScope ;
2223use Behat \Gherkin \Node \TableNode ;
2324use Behat \Mink \Exception \DriverException ;
2425use Behat \Mink \Exception \ExpectationException ;
@@ -45,6 +46,27 @@ class behat_app extends behat_app_helper {
4546
4647 protected $ windowsize = '360x720 ' ;
4748
49+ /**
50+ * @BeforeScenario
51+ */
52+ public function before_scenario (ScenarioScope $ scope ) {
53+ if (!$ scope ->getFeature ()->hasTag ('app ' )) {
54+ return ;
55+ }
56+
57+ global $ CFG ;
58+
59+ $ performanceLogs = $ CFG ->behat_profiles ['default ' ]['capabilities ' ]['extra_capabilities ' ]['goog:loggingPrefs ' ]['performance ' ] ?? null ;
60+
61+ if ($ performanceLogs !== 'ALL ' ) {
62+ return ;
63+ }
64+
65+ // Enable DB Logging only for app tests with performance logs activated.
66+ $ this ->getSession ()->visit ($ this ->get_app_url () . '/assets/env.json ' );
67+ $ this ->execute_script ("document.cookie = 'MoodleAppDBLoggingEnabled=true;path=/'; " );
68+ }
69+
4870 /**
4971 * Opens the Moodle App in the browser and optionally logs in.
5072 *
Original file line number Diff line number Diff line change 66
77defined ('MOODLE_INTERNAL ' ) || die;
88
9- $ plugin ->version = 2022121600 ;
9+ $ plugin ->version = 2023012400 ;
1010$ plugin ->requires = 2016052300 ;
1111$ plugin ->maturity = MATURITY_STABLE ;
1212$ plugin ->release = '4.1.0 ' ;
You can’t perform that action at this time.
0 commit comments