272 Commits

Author SHA1 Message Date
Mihail Geshoski
c501d1ac97 MDL-75837 core_grades: Modify the search widget behat step definitions 2022-11-14 10:11:43 +08:00
Mihail Geshoski
3d1bb8e863 MDL-75513 behat: Update existing behat tests 2022-11-02 17:45:52 +08:00
Mihail Geshoski
c2851ed141 MDL-75513 gradereport_user: Update the grade user report
Updates the styling of the grade user reports and introduces
functionality which enables expanding and collapsing grade
categories.
2022-11-02 17:45:52 +08:00
Mathew May
ee71eae12a MDL-75362 gradebook: add group selector into reports 2022-10-20 21:24:51 +08:00
Mathew May
e7c1c2841d MDL-75362 gradereport_user: Roll in zero state work for user report 2022-10-20 21:24:51 +08:00
Mathew May
547bf73ea7 MDL-75362 gradereport_user: CiBot 2022-10-20 21:24:51 +08:00
Jun Pataleta
f96a0feb6b MDL-75156 gradereport: Use large window size for aggregation tests 2022-10-11 21:08:25 +08:00
Ilya Tregubov
b3e05d0e4e MDL-75156 gradebook: Grade summary plugin (grade averages).
Also included updates for existing unit tests and navigation.
2022-10-07 11:31:41 +04:00
Ilya Tregubov
c8d950bde7 MDL-75156 gradebook: Functions to calculate grade averages.
Also include unit tests.
2022-10-07 11:31:41 +04:00
Eloy Lafuente (stronk7)
0ed53be9b2 MDL-66902 tests: Fix all incorrect namespaces
This issue just goes over all the currently incorrect
namespaces in test cases and:

1. Change the namespace to the correct one.
2. Move/rename it to correct location if needed (level 2 and down).
3. Remove not needed MOODLE_INTERNAL check when possible.
4. Remove file phpdoc when the file only has one class.
5. Make small adjustments in case the change of namespace requires it.
2022-09-26 14:12:16 +02:00
Mihail Geshoski
70f9e8bb23 MDL-75153 grade: Fix incorrect xpath in the behat step definitions 2022-09-20 00:17:56 +08:00
Mihail Geshoski
3001995be8 MDL-75153 grade: Update behat tests 2022-09-20 00:17:56 +08:00
Mihail Geshoski
af74a5534b MDL-75153 grade: Deprecate select_in_gradebook_navigation_selector()
Deprecates the select_in_gradebook_navigation_selector() function in
behat_grade.php and removes all usages. The select menu field supports
the same functionality and this function can be simply replaced with
behat_forms::i_set_the_field_to().
2022-09-20 00:17:56 +08:00
Mihail Geshoski
0e1cdfde1d MDL-75153 grade: Update the general tertiary nav selector in gradebook
Updates the general tertiary nav selector in gradebook to use the new
structure that utilizes the existing select_menu output component.
2022-09-20 00:17:56 +08:00
Shamim Rezaie
fa59f35ca4 MDL-75155 grades: Use the select_menu widget 2022-09-06 13:38:28 +10:00
Jun Pataleta
0cb0516211 Merge branch 'MDL-74282' of https://github.com/paulholden/moodle 2022-07-11 20:35:18 +08:00
Paul Holden
7ee1dc421f MDL-74282 grade: omit outcomes report if outcomes aren't enabled. 2022-07-08 10:43:38 +01:00
Paul Holden
e9135d6708 MDL-74314 grade: use repeatable form elements for grade letters. 2022-06-17 10:48:26 +01:00
Jun Pataleta
dfca2aad61 Merge branch 'MDL-73966' of https://github.com/paulholden/moodle 2022-06-15 18:06:30 +08:00
Paul Holden
3596fc1fe6 MDL-72377 grade: fix category form hidden/until fields.
Ensure the saved values for the hidden and hidden until fields are
populated when editing a grade category. Fix behaviour on enabling
the hidden until field.

Re-enable tests commented out in eba1d32c.
2022-06-06 15:31:03 +01:00
Paul Holden
7d693114d1 MDL-73966 grade: fetch required user name fields of unenrolled users. 2022-05-17 16:03:01 +01:00
Eloy Lafuente (stronk7)
caf55abf17 MDL-74413 phpunit: Move more tests to use correct names and namespaces
Applied the following changes to various testcase classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Remove file phpdoc block
- Remove MOODLE_INTERNAL if not needed.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to:

- Moved to the level2 "privacy" namespace:
  - \mod_assign\privacy\feedback_legacy_polyfill_test
  - \mod_assign\privacy\submission_legacy_polyfill_test

- Moved to the level2 "task" namespace:
  - \core_message\task\migrate_message_data_test
  - \ltiservice_gradebookservices\task\cleanup_test
  - \message_email\task\send_email_test
  - \mod_lti\task\clean_access_tokens_test
  - \mod_workshop\task\cron_task_test

- Moved to the level2 "event" namespace:
  - \core_h5p\event\deleted_test
  - \core_h5p\event\viewed_test

- Renamed to a better name:
  - backup_forum_activity_task_test.php (missing "task")
2022-05-07 20:32:30 +02:00
Eloy Lafuente (stronk7)
4e2b4a138d MDL-74231 grader report: Fix case where old settings are empty / null
There is an edge case in the conversion from old collapse/expand
settings (stored as user preference) to the new ones that can lead
to notices / warnings / errors.

Before PHP 8, they weren't being detected, but now they are.

Basically, if some of the expected components of the preferences
are missing, then some array (array_diff(), array_intersect()..)
operations now are failing, because now those parameter functions
do require to be arrays (so empty strings or nulls aren't allowed).

Also, there were some cases where the old preference was not being
removed ever, so its removal has been moved to a common place at
the end of the function, where it's always evaluated in case
the preference still exists but is empty of contents.

I've tried to cover all the cases I've been able to imagine with
unit tests (empty information, some component not set, all components
not set...), have moved it to a new unit test because the one
already performing some tests with those old preferences was
already too long to add more cases.
2022-03-29 23:46:45 +02:00
Sujith Haridasan
1bb972ae0a MDL-73848 administration: Add tests for breadcrumbs and nav highlights
This change includes addition of tests for verifying the secondary
and tertiary nav highlights.
It also includes the tests to verify the breadcrumbs for the pages.
2022-03-25 17:44:58 +08:00
Eloy Lafuente (stronk7)
43b4e6b339 MDL-73824 test: Cover all the changed code with special decsep tests
Various tests have been added to cover the points fixed in the previous
commit, using a localised decimal separator (#). Using the same
numbering, here there are the details:

A. grade/report/singleview/tests/behat/singleview.feature
   grade/tests/behat/grade_category_validation.feature

B. grade/tests/behat/grade_override_letter.feature

C. (done within various scenarios)

D. grade/report/singleview/tests/behat/singleview.feature

E. admin/tool/behat/tests/behat_form_text_test.php

F. grade/tests/behat/grade_to_pass.feature
   mod/lesson/tests/behat/lesson_informations_at_end.feature

G. quiz/tests/behat/preview.feature

H. mod/quiz/tests/behat/info_page.feature

I. question/type/ddimageortext/tests/behat/edit.feature
2022-03-04 10:22:49 +01:00
Eloy Lafuente (stronk7)
0c53a3dec8 MDL-73476 phpunit: events, external and search tescase names
All events_test, external_test and search_test classes:

- Namespaced with component[\level2-API]
- Moved to level2-API subdirectory when required.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Fix some relative paths and comments here and there.
- All them passing individually.
- Complete runs passing too.

Special mention to lib/external/tests/external_test.php:
- external is not a valid component
- hence, its only valid namespace is "core"
- also, it's testing lib/external/externallib.php
- hence, the file (and class) have been renamed to external_externallib_test.php
  (to avoid conflicts with other external_test that may exist in core)
2022-01-14 16:18:39 +01:00
Eloy Lafuente (stronk7)
511801cb46 MDL-73352 phpunit: lib_test and locallib_test testcase names
All lib_test and locallib_test classes:

- Namespaced with component (and API whenever makes sense).
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed or add new uses.
- All them passing individually.
- Complete runs passing too.

Special mention to tests under login/tests:

1) The core_login component doesn't exist.
2) But login/tests are allowed because there is a suite pointing to it (phpunit.xml).
3) So, the only possible namespace for them is "core".
4) And to avoid problems with other core testcases (under lib/tests)
   they have been renamed to have login_xxxx as prefix.
2021-12-30 16:21:42 +01:00
Jun Pataleta
80c17cd2a0 Merge branch 'MDL-72701-master' of https://github.com/andrewnicols/moodle 2021-12-23 12:10:46 +08:00
Andrew Nicols
3a70983d53 MDL-72701 unit tests: Generate default coverage 2021-12-21 09:24:00 +08:00
Eloy Lafuente (stronk7)
e4a2d9c1d4 MDL-73348 phpunit: normalize all privacy provider tests
As far as now all them have correct privacy level2 namespace:
- Move them to "privacy" subdir.
- Rename the files to "provider_test.php", this includes old
  privacy_test.php and privacy_provider_test.php files
- Rename the testcase to provider_test too (to match file name)

Also, change some relative paths and comments to point to new
locations.
2021-12-17 14:21:02 +01:00
Eloy Lafuente (stronk7)
57e6fb7ad9 MDL-73348 phpunit: privacy and privacy_provider testcase names
All privacy_test and privacy_provider_test classes:

- Namespaced with component\privacy.
- Fixed incorrect use statements with leading backslash.
- Changed code to point to global scope when needed.
- Renamed a few files to make all be privacy_test or privacy_provider_test.php
- All them passing individually.
- Complete runs passing too.
2021-12-17 14:21:02 +01:00
Mihail Geshoski
31f3922cda MDL-72873 core_grades: Add unit tests 2021-12-16 00:10:13 +08:00
Mihail Geshoski
17bfe7e79f MDL-72873 behat: Update behat tests 2021-12-16 00:10:13 +08:00
Mihail Geshoski
c744bdd1d4 MDL-72873 core_grades: Deprecate select_in_gradebook_tabs()
Deprecates the function select_in_gradebook_tabs() in behat_grade.php.
After the tertiary navigation changes in gradebook this function became
obsolete and is now replaced by select_in_gradebook_navigation_selector().
2021-12-16 00:10:13 +08:00
Mihail Geshoski
ddd40c79f1 MDL-72873 core_grades: Update behat step definitions in grades
The behat definition step which is used for navigating to a specific
page in the course gradebook has been updated to reflect the changes
related to the addition of tertiary navitaion in gradebook.
2021-12-16 00:10:13 +08:00
Ilya Tregubov
6f44f008d8 Merge branch 'MDL-73278' of https://github.com/stronk7/moodle 2021-12-10 18:51:40 +02:00
abgreeve
fcd4de8639 MDL-72090 navigation: Update to behat feature files for navigation.
This updates feature files to use the new steps to navigate to certain
pages.
2021-12-09 11:13:35 +08:00
Eloy Lafuente (stronk7)
deb0e76eee MDL-73278 phpunit: Rename already namespaced classes to match file name
These are the only cases 100% safe to apply the renaming of the
testcase class names to match the file names.

All other cases are not safe, because they are missing namespace
and may enter into name conflicts. Adding namespaces is not as
simple as imagined because it implies to, also, add a good number
of modifications to core. See the issue for more details.
2021-12-07 23:54:29 +01:00
Mathew May
b983003e2e MDL-70197 navigation: Remove old navigation elements and migrate behat 2021-11-29 15:47:42 +08:00
Sujith Haridasan
4d2bfb38df MDL-71912 core_grading: Fix behat test
Fix behat test failure.
2021-11-09 11:24:08 +08:00
Mihail Geshoski
d06da2d1a0 MDL-71912 core_grading: Update behat step definitions 2021-11-09 11:24:08 +08:00
Andrew Nicols
924d538235 MDL-71439 core_grade: Coding style tidyup 2021-11-05 11:32:24 +08:00
Andrew Nicols
69ec4376c7 Merge branch 'MDL-71439_master' of https://github.com/mdjnelson/moodle 2021-11-05 11:32:16 +08:00
Angelia Dela Cruz
89c4c803e8 MDL-72655 behat: Use assign generators
Replace steps that manually add assignment instances via the UI
and use Behat generators. This improves the speed of Behat test
runs.
2021-11-03 11:34:26 +08:00
Mark Nelson
4eecb896a2 MDL-71439 core_grades: return result of new method in web services 2021-10-27 12:19:31 +08:00
Mark Nelson
85eda546b3 MDL-71439 core_grades: add new method 'get_formatted_grade_for_user' 2021-10-27 12:19:31 +08:00
Bas Brands
16c726cde7 MDL-71610 core_behat: use new edit mode step in feature files 2021-09-29 09:25:36 +02:00
Bas Brands
6ece030948 MDL-71610 theme_boost: switch to standard editing mode for gradebook
the gradebook need to use the standard $USER->editing to check if editing mode is turned on
2021-09-29 09:25:36 +02:00
Jun Pataleta
385438b463 Merge branch 'MDL-72589' of https://github.com/stronk7/moodle 2021-09-16 09:46:56 +08:00
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