From 71bb810758eb4f4fa2bbceb05fec528fdbee31f3 Mon Sep 17 00:00:00 2001 From: mioyu-ubiq Date: Tue, 4 Nov 2025 17:20:18 +0800 Subject: [PATCH] MDL-86907 mod_choice: Behat test for adding multiple choice responses --- .../tests/behat/specify_responses.feature | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 mod/choice/tests/behat/specify_responses.feature diff --git a/mod/choice/tests/behat/specify_responses.feature b/mod/choice/tests/behat/specify_responses.feature new file mode 100644 index 00000000000..b70e2a39af4 --- /dev/null +++ b/mod/choice/tests/behat/specify_responses.feature @@ -0,0 +1,41 @@ +@mod @mod_choice +Feature: Specify any number of choice responses + In order to make a choice activity + As a teacher + I need to be able to add any number of responses + + Background: + Given the following "users" exist: + | username | firstname | lastname | email | + | teacher1 | Teacher | 1 | teacher1@example.com | + And the following "courses" exist: + | fullname | shortname | category | + | Course 1 | C1 | 0 | + And the following "course enrolments" exist: + | user | course | role | + | teacher1 | C1 | editingteacher | + And the following "activities" exist: + | activity | name | intro | course | option | + | choice | Choice 1 | Test choice description | C1 | one, two, three | + + Scenario: Teacher can add and display any number of responses in a choice activity + Given I am on the "Choice 1" "choice activity" page logged in as "teacher1" + And I should see "one" + And I should see "two" + And I should see "three" + And I should not see "four" + And I should not see "five" + And I should not see "six" + When I am on the "Choice 1" "choice activity editing" page + And I press "Add 3 field(s) to form" + And I set the following fields to these values: + | Option 4 | four | + | Option 5 | five | + | Option 6 | six | + And I press "Save and display" + Then I should see "one" + And I should see "two" + And I should see "three" + And I should see "four" + And I should see "five" + And I should see "six"