@block @block_recent_activity Feature: View structural changes in recent activity block In order to know when activities were changed As a user In need to see the structural changes in recent activity block Background: # /Users/huong/Work/moodles/integration_500/moodle/blocks/recent_activity/tests/behat/structural_changes.feature:7 Given the following "courses" exist: # behat_data_generators::the_following_entities_exist()  | fullname | shortname | category | | Course 1 | C1 | 0 | And the following "users" exist: # behat_data_generators::the_following_entities_exist()  | username | firstname | lastname | email | | teacher1 | Terry1 | Teacher1 | teacher1@example.com | | assistant1 | Terry2 | Teacher2 | teacher2@example.com | | student1 | Sam1 | Student1 | student1@example.com | | student2 | Sam2 | Student2 | student2@example.com | | student3 | Sam3 | Student3 | student3@example.com | And the following "course enrolments" exist: # behat_data_generators::the_following_entities_exist()  | user | course | role | | teacher1 | C1 | editingteacher | | assistant1 | C1 | teacher | | student1 | C1 | student | | student2 | C1 | student | | student3 | C1 | student | And the following "groups" exist: # behat_data_generators::the_following_entities_exist()  | name | course | idnumber | | Group 1 | C1 | G1 | | Group 2 | C1 | G2 | And the following "groupings" exist: # behat_data_generators::the_following_entities_exist()  | name | course | idnumber | | Grouping 1 | C1 | GG1 | | Grouping 2 | C1 | GG2 | | Grouping 3 | C1 | GG3 | And the following "group members" exist: # behat_data_generators::the_following_entities_exist()  | user | group | | student1 | G1 | | student2 | G2 | | student3 | G1 | | student3 | G2 | | assistant1 | G1 | And the following "grouping groups" exist: # behat_data_generators::the_following_entities_exist()  | grouping | group | | GG1 | G1 | | GG2 | G2 | | GG3 | G1 | | GG3 | G2 | Scenario: Updates and deletes in recent activity block # /Users/huong/Work/moodles/integration_500/moodle/blocks/recent_activity/tests/behat/structural_changes.feature:131 Given the following "activity" exists: # behat_data_generators::the_following_entity_exists()  | activity | forum | | course | C1 | | idnumber | forum1 | | name | ForumNew | When I log in as "teacher1" # behat_auth::i_log_in_as() And I am on "Course 1" course homepage with editing mode on # behat_theme_boost_behat_navigation::i_am_on_course_homepage_with_editing_mode_set_to() And I add the "Recent activity" block # behat_blocks::i_add_the_block() Then I should see "Added Forum" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I should see "ForumNew" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I log out # behat_auth::i_log_out() And I wait "1" seconds # behat_general::i_wait_seconds() And I am on the "Course 1" course page logged in as student1 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should see "Added Forum" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I should see "ForumNew" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I log out # behat_auth::i_log_out() And I wait "1" seconds # behat_general::i_wait_seconds() And I am on the "ForumNew" "forum activity editing" page logged in as teacher1 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I set the following fields to these values: # behat_forms::i_set_the_following_fields_to_these_values()  | name | ForumUpdated | And I press "Save and return to course" # behat_forms::press_button() And I log out # behat_auth::i_log_out() And I wait "1" seconds # behat_general::i_wait_seconds() And I am on the "Course 1" course page logged in as student1 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should not see "Added Forum" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "ForumNew" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should see "Updated Forum" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I should see "ForumUpdated" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I log out # behat_auth::i_log_out() And I wait "1" seconds # behat_general::i_wait_seconds() And I am on the "Course 1" course page logged in as student2 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should see "Added Forum" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I should not see "ForumNew" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "Updated Forum" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should see "ForumUpdated" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I log out # behat_auth::i_log_out() And I wait "1" seconds # behat_general::i_wait_seconds() And I log in as "teacher1" # behat_auth::i_log_in_as() And I am on "Course 1" course homepage with editing mode on # behat_theme_boost_behat_navigation::i_am_on_course_homepage_with_editing_mode_set_to() And I delete "ForumUpdated" activity # behat_course::i_delete_activity() And I run all adhoc tasks # behat_general::i_run_all_adhoc_tasks() │ Execute adhoc task: core_course\task\course_delete_modules │ Adhoc task id: 467001 │ Adhoc task custom data: {"cms":[{"id":"199000","course":"2","module":"8","instance":"250000","section":"204000","idnumber":"forum1","added":"1769762207","score":"0","indent":"0","visible":"1","visibleoncoursepage":"1","visibleold":"1","groupmode":"0","groupingid":"0","completion":"0","completiongradeitemnumber":null,"completionview":"0","completionexpected":"0","completionpassgrade":"0","showdescription":"0","availability":null,"deletioninprogress":"1","downloadcontent":"1","lang":""}],"userid":"3","realuserid":"3"} │ ... started 16:37:00. Current memory use 84.4 MB. │ ... used 0 dbqueries │ ... used 0.00042581558227539 seconds │ ... used 85.4 MB peak memory │ Adhoc task failed: core_course\task\course_delete_modules,Coding error detected, it must be fixed by a programmer: Testing! │ Backtrace: │ * line 523 of /lib/classes/cron.php: call to core_course\task\course_delete_modules->execute() │ * line 1265 of /lib/tests/behat/behat_general.php: call to core\cron::run_inner_adhoc_task() │ * line 110 of /vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php: call to behat_general->i_run_all_adhoc_tasks() │ * line 64 of /vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php: call to Behat\Testwork\Call\Handler\RuntimeCallHandler->executeCall() │ * line 138 of /vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php: call to Behat\Testwork\Call\Handler\RuntimeCallHandler->handleCall() │ * line 96 of /vendor/behat/behat/src/Behat/Testwork/Call/CallCenter.php: call to Behat\Testwork\Call\CallCenter->handleCall() │ * line 138 of /vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php: call to Behat\Testwork\Call\CallCenter->makeCall() │ * line 75 of /vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeStepTester.php: call to Behat\Behat\Tester\Runtime\RuntimeStepTester->testDefinition() │ * line 74 of /vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableStepTester.php: call to Behat\Behat\Tester\Runtime\RuntimeStepTester->test() │ * line 110 of /lib/behat/extension/Moodle/BehatExtension/EventDispatcher/Tester/ChainedStepTester.php: call to Behat\Behat\Hook\Tester\HookableStepTester->test() │ * line 104 of /lib/behat/extension/Moodle/BehatExtension/EventDispatcher/Tester/MoodleEventDispatchingStepTester.php: call to Moodle\BehatExtension\EventDispatcher\Tester\ChainedStepTester->test() │ * line 59 of /vendor/behat/behat/src/Behat/Behat/Tester/StepContainerTester.php: call to Moodle\BehatExtension\EventDispatcher\Tester\MoodleEventDispatchingStepTester->test() │ * line 76 of /vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeScenarioTester.php: call to Behat\Behat\Tester\StepContainerTester->test() │ * line 74 of /vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableScenarioTester.php: call to Behat\Behat\Tester\Runtime\RuntimeScenarioTester->test() │ * line 106 of /vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingScenarioTester.php: call to Behat\Behat\Hook\Tester\HookableScenarioTester->test() │ * line 69 of /vendor/behat/behat/src/Behat/Behat/Tester/Runtime/IsolatingScenarioTester.php: call to Behat\Behat\EventDispatcher\Tester\EventDispatchingScenarioTester->test() │ * line 76 of /vendor/behat/behat/src/Behat/Behat/Tester/Runtime/RuntimeFeatureTester.php: call to Behat\Behat\Tester\Runtime\IsolatingScenarioTester->test() │ * line 75 of /vendor/behat/behat/src/Behat/Behat/Hook/Tester/HookableFeatureTester.php: call to Behat\Behat\Tester\Runtime\RuntimeFeatureTester->test() │ * line 77 of /vendor/behat/behat/src/Behat/Behat/EventDispatcher/Tester/EventDispatchingFeatureTester.php: call to Behat\Behat\Hook\Tester\HookableFeatureTester->test() │ * line 60 of /vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeSuiteTester.php: call to Behat\Behat\EventDispatcher\Tester\EventDispatchingFeatureTester->test() │ * line 70 of /vendor/behat/behat/src/Behat/Testwork/Hook/Tester/HookableSuiteTester.php: call to Behat\Testwork\Tester\Runtime\RuntimeSuiteTester->test() │ * line 72 of /vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingSuiteTester.php: call to Behat\Testwork\Hook\Tester\HookableSuiteTester->test() │ * line 74 of /vendor/behat/behat/src/Behat/Testwork/Tester/Runtime/RuntimeExercise.php: call to Behat\Testwork\EventDispatcher\Tester\EventDispatchingSuiteTester->test() │ * line 76 of /vendor/behat/behat/src/Behat/Testwork/EventDispatcher/Tester/EventDispatchingExercise.php: call to Behat\Testwork\Tester\Runtime\RuntimeExercise->test() │ * line 67 of /vendor/behat/behat/src/Behat/Testwork/Ordering/OrderedExercise.php: call to Behat\Testwork\EventDispatcher\Tester\EventDispatchingExercise->test() │ * line 155 of /vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php: call to Behat\Testwork\Ordering\OrderedExercise->test() │ * line 114 of /vendor/behat/behat/src/Behat/Testwork/Tester/Cli/ExerciseController.php: call to Behat\Testwork\Tester\Cli\ExerciseController->testSpecifications() │ * line 63 of /vendor/behat/behat/src/Behat/Testwork/Cli/Command.php: call to Behat\Testwork\Tester\Cli\ExerciseController->execute() │ * line 279 of /vendor/symfony/console/Command/Command.php: call to Behat\Testwork\Cli\Command->execute() │ * line 1076 of /vendor/symfony/console/Application.php: call to Symfony\Component\Console\Command\Command->run() │ * line 342 of /vendor/symfony/console/Application.php: call to Symfony\Component\Console\Application->doRunCommand() │ * line 140 of /vendor/behat/behat/src/Behat/Testwork/Cli/Application.php: call to Symfony\Component\Console\Application->doRun() │ * line 193 of /vendor/symfony/console/Application.php: call to Behat\Testwork\Cli\Application->doRun() │ * line 34 of /vendor/behat/behat/bin/behat: call to Symfony\Component\Console\Application->run() │ * line 119 of /vendor/bin/behat: call to include() │ │  An adhoc task failed (Behat\Mink\Exception\DriverException) And I log out # behat_auth::i_log_out() And I wait "1" seconds # behat_general::i_wait_seconds() And I am on the "Course 1" course page logged in as student1 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should not see "Added Forum" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "ForumNew" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "Updated Forum" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "ForumUpdated" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should see "Deleted Forum" in the "Recent activity" "block" # behat_general::assert_element_contains_text() And I log out # behat_auth::i_log_out() And I wait "1" seconds # behat_general::i_wait_seconds() And I am on the "Course 1" course page logged in as student3 # behat_theme_boost_behat_navigation::i_am_on_page_instance_logged_in_as() And I should not see "Added Forum" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "ForumNew" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "Updated Forum" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "ForumUpdated" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() And I should not see "Deleted Forum" in the "Recent activity" "block" # behat_general::assert_element_not_contains_text() --- Failed scenarios: /Users/huong/Work/moodles/integration_500/moodle/blocks/recent_activity/tests/behat/structural_changes.feature:131 1 scenario (1 failed) 59 steps (42 passed, 1 failed, 16 skipped) 0m17.98s (84.67Mb)