Skip to content

Commit

Permalink
CTP-3973 behat date picker
Browse files Browse the repository at this point in the history
  • Loading branch information
watson8 committed Oct 29, 2024
1 parent 4d58ce1 commit 75fa986
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/behat/behat_mod_coursework.php
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ public function there_is_an_extension_for_the_student_which_has_expired() {
*/
public function i_enter_an_extension_in_the_form(string $timeextension, string $reasoncode = '') {
$newtime = strtotime('3:30pm', strtotime($timeextension));
// Put into ISO08601 format.
// Put into ISO-8601 format.
$newtimestring = date('Y-m-d\TH:i', $newtime);
$script = "const e = document.querySelector('input#extension-extend-deadline');"
. "e.value = '$newtimestring'; e.dispatchEvent(new Event('change'));";
Expand All @@ -1160,8 +1160,8 @@ public function i_enter_an_extension_in_the_form(string $timeextension, string $
*/
public function i_should_see_the_extension_in_the_form(string $timeextension, string $reasoncode = '') {
$newtime = strtotime('3:30pm', strtotime($timeextension));
// Put into format 30-09-2024 15:47.
$newtimestring = date('d-m-Y H:i', $newtime);
// Put into ISO-8601 format.
$newtimestring = date('Y-m-d\TH:i', $newtime);
$script = "document.querySelector('input#extension-extend-deadline').value";
$result = behat_base::evaluate_script_in_session($this->getSession(), $script);
if ($result != $newtimestring) {
Expand Down

0 comments on commit 75fa986

Please sign in to comment.