82 Commits

Author SHA1 Message Date
Eloy Lafuente (stronk7)
9f9fe79c26 MDL-72589 behat: Add @skip_chrome_zerosize to failing scenarios
All the scenarios failing with Chrome zero-size errors are
getting the @skip_chrome_zerosize to be able to keep them apart from
regular runs. See MDL-71108 for more information about
that error.

They will be run by another job, specifically using that tag to
keep them failing and under control.
2021-09-15 20:25:11 +02:00
Adrian Greeve
7d435fb5f2 MDL-70196 navigation: Update to feature files.
- Part of: MDL-69588
A lot of tests rely on the last element of the breadcrumb being
active. This updates feature files to not rely on this anymore.
2021-08-23 17:46:38 +08:00
Paul Holden
42a59cbc66 MDL-71661 cohort: support custom user profile fields. 2021-05-24 15:02:35 +01:00
Eloy Lafuente (stronk7)
8a14a7bd22 MDL-71036 phpunit: assertContains() now performs strict comparison
The methods assertContains() and assertNotContains() now perform
strict (type and value) comparison, pretty much like assertSame()
does.

A couple of new assertContainsEquals() and assertNotContainsEquals()
methods have been created to provide old (non-strict) behavior, pretty
much like assertEquals() do.

Apart from replacing the calls needing a relaxed comparison to those
new methods, there are also a couple of alternative, about how to
fix this, depending of every case:

- If the test is making any array_values() conversion, then it's better
  to remove that conversion and use assertArrayHasKey(), that is not
  strict.
- Sometimes if may be also possible to, simply, cast the expectation
  to the exact type coming in the array. I've not applied this technique
  to any of the cases in core.

Link: https://github.com/sebastianbergmann/phpunit/issues/3426
2021-03-11 23:04:31 +01:00
Andrew Nicols
0d580d2b3e MDL-67668 behat: Update tests for inplace editable field type 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
Eloy Lafuente (stronk7)
40de097e65 MDL-67673 phpunit: Remove deprecated assertContains() uses on strings
Both assertContains() and assertNotContains() are deprecated in PHPUnit 8
for operations on strings. Also the optional case parameter is. All uses
must be changed to one of:

- assertStringContainsString()
- assertStringContainsStringIgnoringCase()
- assertStringNotContainsString()
- assertStringNotContainsStringIgnoringCase()

More info: https://github.com/sebastianbergmann/phpunit/issues/3422

Regexp to find all uses:

ag 'assert(Not)?Contains\('
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
d95c378771 MDL-67673 phpunit: Remove expectedException annotations
While this is not strictly required, because removal will
happen in PHPUnit 9.0, we are already getting rid of all
uses in core.

From release notes:https://phpunit.de/announcements/phpunit-8.html

The annotations `@expectedException`, `@expectedExceptionCode`,
`@expectedExceptionMessage`, and `@expectedExceptionMessageRegExp`
are now deprecated.
Using these annotations will trigger a deprecation warning
in PHPUnit 8 and in PHPUnit 9 these annotations will be removed.

Also, all uses of expectExceptionMessageRegExp() has been moved
to expectExceptionMessageMatches(). See https://github.com/sebastianbergmann/phpunit/issues/3957

TODO: Various weirdness found while doing the changes with these tests:
- vendor/bin/phpunit lib/tests/exporter_test.php (created MDL-69700)
- vendor/bin/phpunit competency/tests/external_test.php (same issue than prev one)
- vendor/bin/phpunit question/engine/tests/questionengine_test.php (created MDL-69624)
- vendor/bin/phpunit lib/tests/event_test.php (created MDL-69688)
2020-10-21 12:46:00 +02:00
Eloy Lafuente (stronk7)
f6711bb394 MDL-67673 phpunit: Fix the return type of template methods
All the setup/teardown/pre/post/conditions template methods
now are required to return void. This was warned with phpunit 7
and now is enforced.

At the same time, fix a few wrong function names,
provider data and param types, return statements...
2020-10-21 12:45:59 +02:00
Julien Boulen
93d7220587 MDL-67278 course: Use autocomplete widget for course category selector 2020-09-02 15:30:34 +02:00
Marina Glancy
5ecbc5d9f7 MDL-65782 roles: allow several roles with user/frontpage archetype 2019-06-04 11:49:23 +02:00
Mathew May
e00f1c663c MDL-64506 phpunit: Update unit tests to use classic 2019-04-03 19:34:20 +08:00
Andrew Nicols
f98a300dd8 MDL-62514 behat: Add additional autocomplete validation 2019-01-30 08:24:32 +08:00
Mihail Geshoski
0395106340 MDL-63621 core_cohort: Add support for removal of context users
This issue is part of the MDL-62560 Epic.
2018-10-22 12:50:14 +02:00
Víctor Déniz Falcón
02fda279ed MDL-57281 behat: deprecated step definition I navigate to node in
Definition step deprecated and affected tests modified.
2018-08-20 12:53:26 +01:00
Mark Nelson
8e24041287 MDL-62428 core: fix incorrect early return in privacy providers 2018-05-14 13:06:29 +08:00
Sara Arjona
5a86bf1448 MDL-61998 cohort: Implement privacy API 2018-04-23 11:41:04 +02:00
Andrew Nicols
853508eed3 MDL-61601 cohort: Move theme test to moodle_page 2018-04-09 10:16:54 +08:00
Sara Arjona
88cb8b781d MDL-61601 cohort: Add theme support for cohorts
If enabled $CFG->allowcohortthemes, then themes can be set at the cohort level.
This will affect all users with only one cohort or more than one but with the same theme.
The default theme order will be: course, category, session, user, cohort, site.
2018-04-06 08:28:01 +02:00
Dan Marsden
6b7d74040a MDL-49417 enrol_cohort: fix behat test to use new autocomplete. 2018-03-13 12:37:43 +13:00
Dan Marsden
d406ddca03 MDL-61005 core_cohort: Allow teachers to view site-wide cohorts 2018-02-14 20:02:39 +01:00
Damyon Wiese
a60e8ba51e MDL-59365 enrol_manual: Rewrite the yui enrolment popup in amd
The add/roles thing was only converted to bootstrap 2/4 markup and the yui left in place.

The modal for adding users to a course was unsavable so I rewrote it with an mform in a popup, still calling
the same (barely) modified ajax script.

The webservice for searching cohorts was taken from admin/tool/lp and moved into /cohort. I added a generic "cohort"
mform element at the same time.

The webservice for searching for users was taken from the original ajax script.
2017-07-11 13:47:26 +01:00
Simey Lameze
fdeeaff954 MDL-58265 core_test: replace I turn editing on steps
Also remove few more unnecessary steps that redirects behat to
site home page to actually get to the course.

Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Simey Lameze
93be3f730c MDL-58265 core_test: remove unnecessary steps
This commmit removes steps that take behat to site home page
to actually get to a course page.

Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Simey Lameze
c987d1b2ef MDL-58265 core_test: replace all uses of I follow course steps
Part of MDL-55611 epic.
2017-04-03 11:37:07 +08:00
Rajesh Taneja
57bee542ab
MDL-56519 behat: Fixed lint errors 2017-01-03 09:12:54 +08:00
Marina Glancy
e5287f9b3b MDL-56614 behat: navigate without navigation and admin blocks 2016-12-06 11:49:14 +08:00
Damyon Wiese
ba5c5083c5 MDL-55074 theme_boost: Behat fixes for latest theme changes
Fix I edit profile steps
Apply fixed header in css
Remove transitions from menus for behat
Be more specific about some "I follow" steps
Navigation path changes
"Current course" node removed from nav tree
Adapt tests because there are no default blocks
Force some space between action menu items
2016-10-21 16:06:54 +08:00
Rajesh Taneja
52f3e060e4
MDL-55091 phpunit: Following has been deprecated.
1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
2016-07-26 10:11:30 +08:00
Rajesh Taneja
eb9ca848fa MDL-53381 behat: Replaced chained steps with api.
Behat 3.x doesn't support chained steps and hence
this is first step to get rid of chained steps in core.
2016-04-06 11:32:49 +08:00
Rajesh Taneja
a1d3a94b1c MDL-49150 behat: Removed unnecessary @javascript tags 2016-03-22 13:54:12 +08:00
David Monllao
4235b98110 Merge branch 'wip-MDL-53026-master' of https://github.com/marinaglancy/moodle 2016-03-16 10:00:28 +08:00
Rajesh Taneja
42ad096fdb MDL-46891 Behat: Added support for behat 3 2016-03-11 10:51:15 +08:00
Marina Glancy
48983fb9e7 MDL-53026 cohorts: edit names and idnumbers in place 2016-03-11 08:14:49 +08:00
Ankit Agarwal
2149326b8c MDL-50049 deprecation: Remove usage of deprecated api and cleanup 2015-06-29 17:15:50 +05:30
Rajesh Taneja
0fe86bbdbb MDL-49799 behat: replaced asd.com with example.com
asd.com is a valid domain, we should use reserved domain names for testing
2015-04-20 11:21:20 +08:00
David Monllao
89a6290fb9 Merge branch 'MDL-45131-master' of git://github.com/jleyva/moodle 2015-04-16 17:04:34 +08:00
Juan Leyva
52ab107698 MDL-45131 cohort: Add validation for returned parameters in WS tests 2015-04-13 16:37:29 +02:00
Damyon Wiese
46a2fbc4b7 MDL-49412 Navigation: Remaining behat fixed for nav branch
Behat is passing after this change.

Part of MDL-45774.
2015-04-10 17:19:28 +08:00
Frederic Massart
5c5721285f MDL-43902 cohort: Fix behat failure because attribute does not exist 2014-12-18 14:34:59 +08:00
Marina Glancy
9b65d0dd62 MDL-36014 cohorts: specify exact cohort names in unittest 2014-10-06 09:50:29 +08:00
Marina Glancy
fbb250f8ef MDL-36014 cohorts: Support cohort visibility in Upload cohorts 2014-10-03 18:26:37 +08:00
Marina Glancy
80f98467f8 MDL-36014 cohorts: Allow teachers to view cohorts
Added property 'visible' for cohorts. Unsetting it hides the cohort from users in the course.

AMOS BEGIN
 CPY [visible,core_moodle],[visible,core_cohort]
AMOS END
2014-10-03 18:26:34 +08:00
Marina Glancy
5076b96171 MDL-35468 cohorts: upload cohorts from csv file 2014-09-12 10:24:04 +08:00
Marina Glancy
274dc06881 MDL-34189 cohorts: Allow admin/manager to see all cohorts on one page 2014-07-28 15:02:27 +08:00
Ankit Agarwal
b63f773296 MDL-44717 events: Fix multiple issues in events
Fix various incorrect urls
Fix incorrect phpdocs and other minor code style issues
Fix missing/incorrect strings

AMOS BEGIN
 MOV [eventblogassociationcreated, core_blog],[eventblogassociationadded, core_blog]
AMOS END
2014-04-01 15:08:34 +08:00
Dan Poltawski
7f42ee92eb Merge branch 'MDL-44440_master' of git://github.com/dmonllao/moodle 2014-03-10 13:45:26 +08:00
David Monllao
1f631c7c63 MDL-44440 behat: Changing , for > as a navigation tree nodes separator
Using greater than as seems a more natural separator
than the comma when separating nodes which have a
hierarchy relation.
2014-03-10 13:35:40 +08:00
David Monllao
759b323e0e MDL-43236 behat: Updating references to deprecated methods 2014-03-07 16:05:21 +08:00
David Monllao
a542553d42 MDL-44440 behat: Refactoring features to use I navigate to
Replacing multiple "I expand node" steps by the
new "I navigate to". Also fixing few I navigate to
when dealing with non-JS.
2014-03-07 14:46:54 +08:00