537 Commits

Author SHA1 Message Date
Jun Pataleta
1be10f4249
Merge branch 'MDL-77991' of https://github.com/Chocolate-lightning/moodle 2023-08-03 10:23:24 +08:00
Mathew May
a4b3b0d044 MDL-77991 core: Move tertiary search dropdown component 2023-08-03 09:07:18 +08:00
Andrew Nicols
01a1210954 MDL-78289 courseformat: Amend behat tests to reduce test overheads 2023-08-01 09:45:47 +02:00
Ferran Recio
01e0e56665 MDL-78282 core_courseformat: interactive visibility badges 2023-07-26 15:44:28 +02:00
Andrew Nicols
dff354bb4f
MDL-78673 grade: Switch test to use generators 2023-07-10 11:21:15 +08:00
Eloy Lafuente (stronk7)
dc0869fc12
MDL-78570 behat: Remove the skip-passed legacy option
This option (--skip-passed) was implemented because of some bugs in the initial
versions of Behat 3 with the --rerun option.

After Behat 3.2.0 those bugs were fixed and we switched back to use
the upstream --rerun option, abandoning --skip-passed.

More yet, this option wasn't ever documented much, neither in docs or cli.

So it's time to remove it, one less thing to maintain for nothing.

Note that this commit is a 99.99% revert of the original one that was
applied to the moodle-behat-extension (now in core):

https://github.com/moodlehq/moodle-behat-extension/commit/c4b25158d212509b
2023-06-24 19:28:51 +02:00
David Woloszyn
a183677a87 MDL-75913 behat: Private files data generator 2023-06-19 16:35:46 +10:00
Andrew Nicols
4d15a4ee32
Merge branch 'MDL-69231-master' of https://github.com/lameze/moodle 2023-06-15 10:58:56 +08:00
Jun Pataleta
78c71f408a Merge branch 'MDL-78036' of https://github.com/stronk7/moodle 2023-06-08 11:03:39 +08:00
Eloy Lafuente (stronk7)
10e3afc5d8
MDL-78036 behat: Move all links from old docs to new counterparts 2023-06-06 12:38:01 +02:00
Andrew Nicols
1a4303c9bc MDL-69231 tests: Add role capability setting generator 2023-06-02 12:47:27 +08:00
Ilya Tregubov
9d6e83274a
Merge branch 'MDL-78317-master' of https://github.com/andrewnicols/moodle 2023-06-01 11:17:31 +08:00
Eloy Lafuente (stronk7)
16e101ff72
MDL-78036 behat: Fix php81 deprecation warning 2023-05-26 18:04:11 +02:00
Jun Pataleta
2ec6022d9c
Merge branch 'MDL-77733-master-fix' of https://github.com/lameze/moodle 2023-05-19 11:40:16 +08:00
Andrew Nicols
88b5313950
MDL-78317 behat: Remove finally deprecated methods
These methods are all very old and well out of the deprecation
timeframe. These are all ready for final removal per policy.
2023-05-19 10:57:42 +08:00
Andrew Nicols
1c9e122df7 MDL-77733 behat: Remove extraneous no-axe option
There is no need for no-axe if we make axe a boolean value. We already
have automatic support for negated boolean flags.
2023-05-19 10:32:53 +08:00
Mathew May
f9c6548189 MDL-77903 gradereport_grader: Keyboard accessibility 2023-04-21 13:09:25 +08:00
Andrew Nicols
dfec1a8e00 MDL-77944 behat: Rename chrome options for w3c support
From Selenium 4.8.0, support for non-w3c browser control has ended.

We only use W3C browser control these days, and this was missed as part
of the move to W3C. All browser options must be vendor-prefixed.
2023-04-18 09:03:35 +08:00
Marina Glancy
8fc1486d36 MDL-77164 various: fix incorrect phpdocs 2023-04-13 11:35:06 +01:00
Petr Skoda
176191dab5 MDL-74936 core: tidy up context API 2023-03-31 23:09:39 +02:00
Mathew May
d80fb6ce2c MDL-76143 gradebook: Add search into graderreport 2023-03-30 11:29:01 +08:00
Andrew Nicols
c9cc52aec1 Merge branch 'MDL-77037-master' of https://github.com/laurentdavid/moodle 2023-03-09 21:53:01 +08:00
Laurent David
387371bacd MDL-77037 core_courseformat: Refresh course index
* Refresh course index when language change
2023-03-09 08:41:02 +01:00
Sara Arjona
c0e910cc4b MDL-76925 lib: Upgrade axe to 4.6.3 2023-03-03 11:46:28 +01:00
Eloy Lafuente (stronk7)
2d0c0dbcb6 MDL-77417 behat: behat_error_handler meets deprecation error types
Right now, any E_DEPRECATED, E_USER_DEPRECATED error type leads
to exception in behat runs, because the behat error handled is
not aware of them. See MDL-38041 for the initial implementation.

We don't want that to happen and they must behave like other "low"
error types (notices, warnings...), that will be reported in logs
or output, but won't trigger any exception, so the test can continue.

This commit just adds those 2 "new" error types to the handler,
providing the very same behaviour for them than the rest.
2023-02-27 09:33:08 +01:00
Simey Lameze
64799f9ace MDL-76542 behat: add step to go to user edit page directly 2023-02-08 12:22:29 +08:00
Marina Glancy
b0a83aa7bd MDL-76362 various: Avoid passing nulls to functions that don't allow nulls
PHP 8.1 is more strict on the parameter type. Functions such as trim(), strlen(), str_replace(), etc
show notice when null is passed as an argument
2023-01-23 09:15:54 +08:00
Marina Glancy
b1c97381b4 MDL-76356 various: avoid implicit conversion to int
PHP before version 8.1 automatically converted to int if the function
parameter (or array key) is expected to be int. PHP 8.1 shows notice in
this case
2023-01-10 15:27:11 +01:00
Ilya Tregubov
e93d2b0cbe Merge branch 'MDL-76399' of https://github.com/paulholden/moodle 2022-12-29 09:40:51 +07:00
Mark Johnson
b05efb43a4 MDL-75105 tool_behat: List available data generators
This will find all data generators that can be used in behat via the
'the following "something" exist:' step, and display them in a select
list on the step definitions page.

When a generator is selected, it will fetch the required fields for that
generator and display them on the page.
2022-12-21 08:38:09 +00:00
Paul Holden
7d78fb0928 MDL-76399 behat: improvements to "should exist in" thrown exception. 2022-12-16 12:30:03 +00:00
Paul Holden
e2a2332cc0 MDL-76398 behat: broader action menu partial matching by element.
For action menu elements whose trigger element isn't plain text
(e.g. a pix icon), we should be able to match via the title of
that element.
2022-12-02 09:54:49 +00:00
Marina Glancy
a800e7e62f MDL-74853 various: add second parameter to htmlentities functions
Default value of the $flag argument changed in PHP 8.1 from ENT_COMPAT to ENT_QUOTES | ENT_SUBSTITUTE
To ensure consistent behavior across different PHP version the second parameter is now required for the functions:
htmlspecialchars(), htmlentities(), htmlspecialchars_decode(), html_entity_decode() and get_html_translation_table()
2022-11-28 16:12:20 +01:00
Kevin Percy
7f4ca89a79 MDL-75490 lib: Upgrade axe to v4.5.1 2022-11-11 11:02:32 +08:00
Andrew Nicols
426ea50861 MDL-76169 behat: Normalise exception message in should (not) steps
These steps have accepted a NodeElement instance as an argument for some
time, but were trying to cast it to string when formulating exception
messages, making it harder to debug and, in the case of the 'should see'
step, not work at all.

This patch introduces a new function to produce a consistent naming for
them.
2022-11-03 21:39:15 +08:00
Andrew Nicols
232ebac338 MDL-76169 behat: Add improved steps for using action menus
This commit adds new steps related to action menus to support:
* Choosing an item in a named action menu
* Choosing an item in a named action menu within a container
* Confirming that an action menu item does or does not exist in a named
  action menu
* Confirming that an action menu item does or does not exist in a named
  action menu within a container

The existing action menu steps were insufficient as they assume that
there is only one action menu within he container, which is not
necessarily the case.

The existing action menu steps are not non-JS friendly and will error if
JS is disabled, without providing any fallback when one is easily
available.

Unfortunately these steps cannot be used to replace the existing steps
without manual intervention.
2022-11-03 21:39:15 +08:00
Víctor Déniz
d76550da83 Merge branch 'MDL-75969-master' of https://github.com/andrewnicols/moodle 2022-10-27 15:29:40 +01:00
Jun Pataleta
c76a2a05ba Merge branch 'MDL-72558' of https://github.com/NoelDeMartin/moodle 2022-10-26 13:37:45 +08:00
Andrew Nicols
872eef9c9a MDL-75969 behat: Allow the editor field to request a save
Some editors do not immediately store their content to the textarea they
represent and only do so when the form is submitted or they are
requested to.

This change adds to the existing API to allow an (optional)
`store_current_value` function to be defined for the editor type so that
it can use the JavaScript API to persist any current content to the
editor.
2022-10-14 23:46:25 +08:00
Andrew Nicols
febd5d944c MDL-75985 behat: Standardise HTML output when comparing editor content
This commit adds a standardise_html function and updates the matches
function to compare normalised content.

This allows for a wider variety of valid editor output to be handled
using the standard value matching steps in Behat, thus supporting
editors other than Atto better.
2022-10-14 23:44:56 +08:00
Noel De Martin
594a64348a MDL-72558 behat: Remove legacy mobile app code 2022-10-13 09:18:40 +02:00
Simey Lameze
baa1e52530 MDL-75887 behat: Add ability to set value regardless of the editor
Prior to this commit, the behat_form_editor integration was hard-coded
to use Atto.

This change allows other editors to be used to set editor values, and
breaks that hard bond. Following this change, any editor is able to
define a behat_editor_[name].php file defining a function which meets
the following signature:

  set_editor_value(string $editorid, string $value): void

Each editor is responsible for checking whether its own API is available
and calling any relevant functions to force the editor to set the
content.

Please note: Behat is unable to determine the current editor in use on
the page automatically.
2022-10-12 06:44:09 +08:00
Andrew Nicols
13cc3607de MDL-75886 atto: Always use Atto for @atto tests
This change, which should be easy to mimic for other editors.

This will ensure that the correct editor is used for tests relating to
that editor, or its subplugins.
2022-10-05 09:54:21 +08:00
Jun Pataleta
9441d5294e Merge branch 'MDL-75559-master' of https://github.com/andrewnicols/moodle 2022-09-29 10:54:20 +08:00
Andrew Nicols
7bb3291e1c Merge branch 'MDL-75456-master' of https://github.com/lameze/moodle 2022-09-27 11:13:46 +08:00
Mihail Geshoski
460744a6a6 MDL-75153 form: Behat support for group structures in select menu field
Adds behat support for group structures in the select menu field. When
looking for a particular option you can further specify the group under
which this option should be located by using the '>' delimiter
(e.g. "Group name > Option name"). In addition to that, this commit
intorduces new step definition which can be used to check whether the
select menu field contains a particular option.
2022-09-20 00:17:55 +08:00
Andrew Nicols
5412ddbf97 MDL-75559 behat: Sort behat_hooks to top of context list 2022-09-12 12:32:35 +08:00
Shamim Rezaie
5d33ef3c21 MDL-75155 behat: Add select_menu field type
This commit introduces a new partial selector for select_menu fields,
and teaching the field manager how to recognise these, then introducing
a new field type which can handle setting values for this field.
2022-09-06 13:38:28 +10:00
Shamim Rezaie
cad62440e3 Merge branch 'MDL-73876-master' of https://github.com/ilyatregubov/moodle 2022-08-17 02:32:00 +10:00
Simey Lameze
7abd77f565 MDL-75456 behat: final deprecation of get_node_type() and get_field() 2022-08-15 12:58:05 +08:00