Commit a617a338 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1711277 - Add a step to check dates"

parents 8ae1f625 6972c504
......@@ -1428,4 +1428,23 @@ JS;
fwrite(STDOUT, "\n\033[93m DEBUG: $text\033[0m\n\n");
}
/**
* Takes a date in a format strtotime() can take and looks for it
* in the specified css element. The default format searched for is
* dd Month YYYY, hh:mm AM/PM. You can pass another format as a string
* defined in langconfig.php or directly as a php date() format.
*
* @Then I should see the date :date in the :element element
* @Then I should see the date :date in the :element element with the format :format
*/
public function i_should_see_date($date, $element, $format = 'strftimedatetime') {
if (string_exists($format, 'langconfig')) {
$date = format_date(strtotime($date), $format);
}
else {
$date = date($format, strtotime($date));
}
$this->assertSession()->elementTextContains('css', $element, $date);
}
}
......@@ -33,5 +33,5 @@ Scenario: Adding collection to group (Bug 1448807)
Then I should see "Access rules were updated for 1 page"
And I choose "Groups" from main menu
And I follow "group 01"
And I should see "Updated" in the "#sharedcollectionlist" element
# the formats "strftimedate" and "j F Y" both resolve to dd Month YYYY, which is wanted here.
And I should see the date "today" in the "#sharedcollectionlist" element with the format "strftimedate"
Markdown is supported
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