Commit 4fa9303e authored by Aaron Wells's avatar Aaron Wells Committed by Robert Lyon
Browse files

Making the "I trigger the cron" behat step, reset the cron

This way the cron can be triggered multiple times in the same scenario

Change-Id: I8448f93d097bef3ec0845d4efa29d491c6033428
parent 7d321848
......@@ -779,11 +779,18 @@ class BehatGeneral extends BehatBase {
* This step triggers cron like a user would do going to lib/cron.php.
* This step triggers the cron, through the web interface.
* @Given /^I trigger cron$/
* It resets the "nextrun" on every cron task, so every cron task will run
* every time this step is used.
* @Given /^I trigger (the )?cron$/
public function i_trigger_cron() {
set_field('cron', 'nextrun', null);
foreach(plugin_types() as $plugintype) {
set_field($plugintype . '_cron', 'nextrun', null);
......@@ -24,7 +24,7 @@ Then I should see "You have exceeded the maximum login attempts."
And I should see "Login"
# The cron should reset the limit, allowing me to log in again
When I trigger cron
When I trigger the cron
And I log in as "userA" with password "Password1"
# I'm logged in!
Then I should see "Dashboard"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment