537 Commits

Author SHA1 Message Date
Ferran Recio
1c839f9072 MDL-65974 course: move format_base to core_course\course_format 2021-03-11 17:36:34 +01:00
sam marshall
9ddb51b07e MDL-45242 Testing: Generators for user profile fields 2021-03-08 09:20:17 +00:00
Eloy Lafuente (stronk7)
08ae245926 MDL-70876 php80: 5th param removed from custom error handlers
It was deprecated in php72 and now it's gone.

Have used this regexp to find all the uses in core:

ag set_error_handler | uniq

And then checked all them manually, that parameter was not
being used in the 3 methods where we are removing it.
2021-02-26 13:08:27 +01:00
Jun Pataleta
28dadc2fb9 Merge branch 'MDL-47410-master' of git://github.com/andrewnicols/moodle 2021-02-18 11:21:23 +08:00
Andrew Nicols
d6e50d14d2 Merge branch 'MDL-64554-master' of git://github.com/andrewnicols/moodle 2021-02-18 10:21:55 +08:00
Andrew Nicols
708ae8aa0f MDL-47410 behat: Perform exact match for date_time selectors 2021-02-18 09:34:45 +08:00
Marina Glancy
440073ff20 MDL-64554 user: make private files editor modal/ajax form 2021-02-17 18:06:57 +01:00
Andrew Nicols
ab024ac209 Merge branch 'MDL-47410-master' of git://github.com/mihailges/moodle 2021-02-17 09:34:22 +08:00
François Moreau
3776fbafb2 MDL-69762 core_contentbank: let users hide their content 2021-02-15 13:26:32 -05:00
Mihail Geshoski
3ac452047f MDL-47410 behat: Support selection from the datetime selector element
Adds behat support for selecting date and time from a datetime selector
element. The passed values should represent a textual date and time
description wrapped in '##' (e.g. '##first day of January 2020 08:00##',
'##1 Jan 2020 10:30##'). Also, the value 'disabled' is valid and can be
used to disable the datetime selector element.
2021-02-11 12:04:46 +08:00
Mihail Geshoski
b7bef8f297 MDL-47410 behat: Support date selection from the date selector element
Adds behat support for selecting a date from the date selector element.
The passed values should represent a textual date description wrapped
in '##' (e.g. '##first day of January 2020##', '##1 Jan 2020##'). Also,
the value 'disabled' is valid and can be used to disable the date
selector element.
2021-02-11 11:58:44 +08:00
Mihail Geshoski
afd1cf81b5 MDL-47410 behat: Create custom selector for the date and datetime fields
Creates a custom field selector to locate the requested date or datetime
form fields.
2021-02-11 11:49:18 +08:00
Mihail Geshoski
dbb58833ba MDL-47410 behat: Move logic from guess_type() to a separate method
Moves the logic from guess_type() to a separate protected method
get_field_instance_for_element(). This would be quite useful for
form field classes as they can now use this method when there is
a need to determine the type of a given node element.
2021-02-11 11:40:30 +08:00
Mihail Geshoski
896364e4c4 MDL-47410 behat: Use data-fieldtype attribute to guess the field type
The data-fieldtype attribute (if present) should be also utilized in
guess_field_type() and match the behavior in get_field_node_type().
2021-02-11 11:38:00 +08:00
Andrew Nicols
793f131019 MDL-70734 behat: Increase the WebDriver Curl timeout 2021-01-31 18:21:41 +08:00
Andrew Nicols
bead2a1d96 MDL-66979 behat: Add a step to set a timeout factor for a test 2021-01-29 14:15:24 +08:00
Andrew Nicols
05fca85d8e MDL-66979 behat: Warn about old behat.yml file location 2021-01-23 20:43:20 +08:00
Andrew Nicols
14a267e862 MDL-66979 behat: Rename and warn on old config 2021-01-22 14:52:12 +08:00
Andrew Nicols
c876d6298e MDL-66979 behat: availability field extends textarea
The availability behat field extends the textarea type, and therefore
needs to include this type.
2021-01-22 14:52:11 +08:00
Andrew Nicols
a9bd31810f MDL-66979 behat: Improve chromeOptions configuration
Simplify the chromeOptions configuration to improve readability.
2021-01-22 14:52:11 +08:00
Andrew Nicols
7d777911af MDL-66979 behat: Remove unused var 2021-01-22 14:52:11 +08:00
Andrew Nicols
d5f211d00f MDL-66979 behat: Whitespace fix 2021-01-22 14:52:11 +08:00
Andrew Nicols
afecc583aa MDL-66979 behat: Remove manually triggered events
Behat should not trigger Synthetic browser events. It is incorrect to do
so as the UI should be used to trigger events correctly.

The W3C WebDriver specification explicitly states when and where these
events will be triggered from (the browser) and therefore there is no
ambiguity and no need to synthetically trigger them from Behat.
2021-01-22 14:52:10 +08:00
Andrew Nicols
fd5621554a MDL-66979 behat: Update passwordunmask form field control
Update the passwordunmask form field type for behat to interact with the
form element as a human would rather than via synthetic event triggers.
2021-01-22 14:52:10 +08:00
Andrew Nicols
2a969d891a MDL-66979 behat: iFrames must have a name for switchTo
The W3C WebDriver protocol supports switching of contexts using a named
context, and not the class asscoiated with that context.
2021-01-22 14:52:10 +08:00
Andrew Nicols
041b75f00a MDL-66979 behat: Handle JS on elements better
This change introduces a new function to execute Javascript directly on
a node.

This should not, ordinarily, be used directly by steps, but may be
required in other parts of the Behat interaction.
2021-01-22 14:52:10 +08:00
Andrew Nicols
c96cde27ea MDL-66979 behat: Rename selenium config to webdriver
The PHP WebDriver Mink Driver does not necessarily require Selenium. It
supports Selenium 3 upwards, and can be used directly with ChromeDriver,
EdgeDriver, SafariDriver, GeckoDriver, and others.

It therefore uses a slightly different configuraitno path.
2021-01-22 14:52:09 +08:00
Andrew Nicols
50b9866e54 MDL-66979 behat: Core updates for W3C WebDriver
This commit updates core Behat features to make use of the
php-webdriver/webdriver library instead of the legacy Instaclick
library.

Most of these changes relate to use of features of WebDriver which we
are required to use directly rather than through the Mink Driver.
2021-01-22 14:52:09 +08:00
Andrew Nicols
31402aa406 MDL-69107 user: Fix autocomplete usages 2020-12-16 07:50:56 +08:00
Andrew Nicols
f07d3b71d2 MDL-69107 form_autocomplete: Rewrite item selection
The form_autocomplete is essentially a custom element. Unfortunately the
`setValue()` function in Mink has undesired actions so it is necessary
to write our own handling for it.

The standard Mink `setValue()` function focuses the element, sets a
value, and then blurs the element. In the case of the autocomplete this
can cause the autocomplete suggestions list to be closed in some
situations. Instead of using the setValue we click, and type the value,
but do not immediately blur.
2020-12-15 09:08:05 +08:00
Shamim Rezaie
77baa12643 MDL-64982 behat: Remove deprecated behat timeout constants
Behat timeout constants behat_base::TIMEOUT, EXTENDED_TIMEOUT, and
REDUCED_TIMEOUT, which were deprecated in 3.7, have been removed.
2020-12-04 17:07:06 +11:00
Andrew Nicols
fd71823ec7 MDL-67668 behat: Add inplace editable field type
This commit promotes the Inplace Editable field to a first-class form
element by introducing a new partial selector for inplace editable
fields, and teaching the field manager how to recognise these, then
introducing a new field type which can handle setting values for this
field.
2020-11-23 09:01:19 +08:00
Andrew Nicols
548da2ce97 MDL-67668 behat: Share behat_behat functionality with forms
Behat form fields are implemented in a way completely isolated from the
rest of the Behat Context system. Whereas regular step definitions have
access to execute steps, to call `find`, check for JS running, and other
related functionality, the Moodle implementation of a field type does
not have any access to this.

By moving the core functionality of behat_base to a new trait, and the
constants to a new interface, the functionality can also be used in
behat form fields in the same way as elsewhere.
2020-11-23 09:01:19 +08:00
Andrew Nicols
59daa3b548 MDL-67668 behat: Correct js pending check
Pending checks should only run when JS is running, but some uses were
not apply this check.
2020-11-23 09:01:19 +08:00
Andrew Nicols
1144969755 MDL-67668 behat: Support NodeElement when fetching node in container
This is similar to change made in MDL-69136 to allow an already-fetched
NodeElement to be provided to the get_node_in_container() function and
makes it easier to be deterministic when writing steps.
2020-11-23 09:01:19 +08:00
Andrew Nicols
ba34d6e225 MDL-70148 behat: Update steps for keyboard 2020-11-17 15:14:43 +08:00
Andrew Nicols
9c35ea1040 MDL-70148 behat: Add steps to send keys without an element 2020-11-17 15:14:43 +08:00
Shamim Rezaie
b643c88682 MDL-68167 lib: Autocomplete selection to use listbox aria role
The aria-selected state cannot be used for the listitem role. The
autocomplete widget highly uses the aria-selected state internally.
2020-10-30 14:43:00 +11:00
Tim Hunt
3a048549de MDL-69740 Behat init: more progress info at the end of the install 2020-10-02 23:15:50 +01:00
Eloy Lafuente (stronk7)
74ee34fd87 MDL-69521 core: Move all comments in code from 4.1 to 3.11 2020-09-08 18:59:30 +02:00
Noel De Martin
7440ed4ebc MDL-69360 behat: Fix js ready checks for non-moodle sites 2020-09-02 10:19:51 +02:00
Andrew Nicols
41eaa09bbe MDL-67687 behat: Make axe tests optional 2020-08-04 18:56:57 +08:00
Andrew Nicols
06d486d9a3 MDL-67687 behat: Add axe-core 3.5.5 2020-08-04 18:48:11 +08:00
Adrian Greeve
17e99314a2 Merge branch 'MDL-67657-master' of git://github.com/andrewnicols/moodle 2020-07-21 14:47:14 +08:00
Andrew Nicols
083604ea09 MDL-67657 behat: Open course with editing using URL
This is a huge performance improvement for behat.

The current set of steps loads the page
It then looks for the Classic/Clean version of the settings menu
If it fails to find it looks for the Boost Cog
Then it clicks the "Turn editing on" button

This can take a substantial period.

We do not actually need to run these steps as we are able to jump
straight to the URL. We already have access to the sesskey value
required to do this.

There is not loss in testing functionality because the actual testing of
the Turn editing functionality is tested in other places sufficiently.
2020-07-16 11:06:43 +08:00
Andrew Nicols
cd6eadd407 MDL-67657 behat: Convert existing uses of executeScript 2020-07-16 11:06:31 +08:00
Andrew Nicols
6d5d1935ea MDL-67657 behat: Add wrapper for JS execution 2020-07-16 11:05:32 +08:00
Andrew Nicols
b49cb92e82 MDL-69068 behat: New step to support singular generators 2020-07-15 15:27:31 +08:00
Andrew Nicols
3450387277 MDL-69136 behat: Support find on a NodeElement 2020-06-29 11:36:30 +08:00
Andrew Nicols
c7fb9fe55a MDL-66568 behat: Reset theme CSS between scenarios 2020-06-17 07:46:23 +08:00