From 442a3651ec71a29aab639292691a6b0e3861c273 Mon Sep 17 00:00:00 2001 From: Rajesh Taneja Date: Thu, 19 May 2016 16:03:21 +0800 Subject: [PATCH] MDL-54640 behat: add 1 sec delay before running tasks Also just execute task, as running whole cron is not required --- .../behat/block_completionstatus_manual_other.feature | 10 ++++++++-- .../behat/block_completionstatus_manual_self.feature | 5 ++++- .../tests/behat/teacher_manual_completion.feature | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature index 1aaed0a3989..eb859d0b09e 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus_manual_other.feature @@ -39,7 +39,10 @@ Feature: Enable Block Completion in a course using manual completion by others And I follow "Course 1" And I navigate to "Course completion" node in "Reports" And I follow "Click to mark user complete" - And I trigger cron + # Running completion task just after clicking sometimes fail, as record + # should be created before the task runs. + And I wait "1" seconds + And I run the scheduled task "core\task\completion_regular_task" And I am on site homepage And I log out And I log in as "student1" @@ -87,7 +90,10 @@ Feature: Enable Block Completion in a course using manual completion by others And I follow "Course 1" And I navigate to "Course completion" node in "Reports" And I follow "Click to mark user complete" - And I trigger cron + # Running completion task just after clicking sometimes fail, as record + # should be created before the task runs. + And I wait "1" seconds + And I run the scheduled task "core\task\completion_regular_task" And I am on site homepage And I log out And I log in as "student1" diff --git a/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature b/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature index 8441d375321..81b02980442 100644 --- a/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature +++ b/blocks/completionstatus/tests/behat/block_completionstatus_manual_self.feature @@ -35,7 +35,10 @@ Feature: Enable Block Completion in a course using manual self completion And I should see "Confirm self completion" And I press "Yes" And I should see "Status: In progress" in the "Course completion status" "block" - And I trigger cron + # Running completion task just after clicking sometimes fail, as record + # should be created before the task runs. + And I wait "1" seconds + And I run the scheduled task "core\task\completion_regular_task" And I am on site homepage And I follow "Course 1" Then I should see "Status: Complete" in the "Course completion status" "block" diff --git a/completion/tests/behat/teacher_manual_completion.feature b/completion/tests/behat/teacher_manual_completion.feature index 0a7390163fd..ca0c35d90f0 100644 --- a/completion/tests/behat/teacher_manual_completion.feature +++ b/completion/tests/behat/teacher_manual_completion.feature @@ -37,10 +37,10 @@ Feature: Allow teachers to manually mark users as complete when configured And I follow "View course report" And I should see "Student First" And I follow "Click to mark user complete" - # Running cron just after clicking sometimes fail, as record - # should be created before the cron runs. + # Running completion task just after clicking sometimes fail, as record + # should be created before the task runs. And I wait "1" seconds - And I trigger cron + And I run the scheduled task "core\task\completion_regular_task" And I am on site homepage And I log out Then I log in as "student1" -- 2.43.0