MDL-82373 question: Make window larger in behat tests

I would suggest that this is a stop gap to solve some failing tests. We
really need to look at whether we can improve the usability of this
interface on smaller displays as a longer-term fix.
This commit is contained in:
Andrew Nicols 2024-07-16 12:51:13 +08:00
parent 1f0d1e60a0
commit 9251a72e53
No known key found for this signature in database
GPG Key ID: 6D1E3157C8CFBF14
2 changed files with 9 additions and 2 deletions

View File

@ -149,6 +149,9 @@ class behat_mod_quiz extends behat_question_base {
return new moodle_url('/mod/quiz/review.php', ['attempt' => $attempt->id]);
case 'question bank':
// The question bank does not handle fields at the edge of the viewport well.
// Increase the size to avoid this.
$this->execute('behat_general::i_change_window_size_to', ['window', 'large']);
return new moodle_url('/question/edit.php', [
'cmid' => $this->get_cm_by_quiz_name($identifier)->id,
]);

View File

@ -68,8 +68,12 @@ class behat_core_question extends behat_question_base {
protected function resolve_page_instance_url(string $type, string $identifier): moodle_url {
switch (strtolower($type)) {
case 'course question bank':
return new moodle_url('/question/edit.php',
['courseid' => $this->get_course_id($identifier)]);
// The question bank does not handle fields at the edge of the viewport well.
// Increase the size to avoid this.
$this->execute('behat_general::i_change_window_size_to', ['window', 'large']);
return new moodle_url('/question/edit.php', [
'courseid' => $this->get_course_id($identifier),
]);
case 'course question categories':
return new moodle_url('/question/bank/managecategories/category.php',