Every single step that sets or gets a value from a field
has been updated to follow the same behaviour both when
using it through a single step or through generic steps
like "I fill the moodle form with:", to resume all the
changes:
- Created a behat_form_group to re-guess the field type
and act appropriately setting and getting it's value
- Normalize all getters and setters to use behat_form_field
children
- Complete behat_form_checkbox to trigger the appropiate JS
event needed to perform some JS scripts that are listening
- Refactor MDL-43713 multi-select changes and remove
the two new steps introduced there as that behaviour can
be managed from the generic getter
- Added a new step definition to check a capability permission
as we changed the way radio buttons gets it's value
This patch implements:
1) Normalization of options. Before the patch options
in a select were being returned as "op1 op2 op3" by selenium
and "op1 op2 op3" by goutte. With the patch, those lists
are always returned like "op1, op2, op3". If real commas are
needed when handling multiple selects they should
be escaped with backslash in feature files.
2) Support for selecting multiple options. Before the patch
only one option was selected and a new selection was cleaning the
previous one. With the patch it's possible to pass "op1, op2" in
these steps:
- I fill the moodle form with (table)
- I select "OPTION_STRING" from "SELECT_STRING"
3) Ability to match multiple options in this steps. Before the
patch matching of multiple was really random, now every every
passed option ("opt1, opt2") is individually verified. It applies
to these 2 steps:
- the "ELEMENT" select box should contain "OPTIONS"
- the "ELEMENT" select box should not contain "OPTIONS"
4) Two new steps able to verify if a form have some options selected or no:
- the "ELEMENT" select box should contain "OPTIONS" selected
- the "ELEMENT" select box should contain "OPTIONS" not selected
5) Change get_value from xpath search to Mink's getValue() that is immediate
(does not need form submission) and works for all browsers but Safari, that
fails because of the extra ->click() issued.
Note all the changes 1-4 only affect to multi-select fields. Single
selects should continue working 100% the same.
The change 5) causes Safari to fail. The problem has been traced down to
the extra ->click() present there. Anyway there are not test cases
requiring that "immediate" evaluation right now. Only the special feature
file attached verifies it.
Centralise management of all types of cron tasks with registration, scheduling,
parallel task conflicts(blocking) and running once off tasks, all using an
administration screen.
This is a combination of several issues:
MDL-25502: Added "black magic" task allocator for cron
MDL-25503: Add step to cron to run all scheduled tasks
MDL-25504 cron: Refactor to use scheduler
MDL-25505: Add an admin interface to schedule tasks via cron.
MDL-25507: Add support for adhoc tasks.
There are steps where we want to check that
"something" does not appear in the page
or does not exist. We still have to spin
but we don't need to spin for 6 seconds.
Suggested by Petr:
* Don't rely on single user for upgrade
* Make the pathnamehash generation a bit clearer (and add
a test to verify its correctly formed).
This locking system is designed to be used everywhere requiring
locking in Moodle. Each use of the locking system can be configured
to use a different type of locking (or the same type with a different
configuration).
The first supported lock types are memcache, memcached, file (flock),
db (specific handlers for pg, mysql and mariadb).
instance is has been used instead of cmid. This works as all id's are 1
in most cases, but not always.
accesslib_clear_all_caches_for_unit_testing was updated to clear the
$USER->access cache which would fail test when the wrong user's data was used.
It includes 2 more minor fixes:
- Escapes values sent to TinyMCE as it was breaking
when values contained double quotes.
- Adding seconds to the screenshots directory to
avoid using the same folder for multiple runs.
This test was doing work which doesn't make sense as a unit test.
Perhaps the most sensible option would be to use a git hook. Here is
a replacement David Mudrák created:
$ cat .git/hooks/pre-commit
#!/bin/bash
FOUND=$(git diff-index --cached -U0 HEAD -- | grep DONOTCOMMIT | wc -l)
if [[ $FOUND -gt 0 ]]; then
echo "pre-commit hook: DONOTCOMMIT detected, commit not allowed"
exit 1
fi
* Upgrade function to remove duplicates from the grade item duplicates
column. Duplicates were causing sorting to fail in some cases.
* Add some unit tests which simulate sort order duplicate data and
verify that they have been removed.