diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index 286cb4f1a..2cbc29c28 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -10,7 +10,7 @@ on: moodle_branch: description: 'Moodle branch' required: true - default: 'master' + default: 'main' moodle_repository: description: 'Moodle repository' required: true @@ -25,7 +25,7 @@ jobs: MOODLE_DOCKER_DB: pgsql MOODLE_DOCKER_BROWSER: chrome MOODLE_DOCKER_PHP_VERSION: '8.1' - MOODLE_BRANCH: ${{ github.event.inputs.moodle_branch || 'master' }} + MOODLE_BRANCH: ${{ github.event.inputs.moodle_branch || 'main' }} MOODLE_REPOSITORY: ${{ github.event.inputs.moodle_repository || 'https://github.com/moodle/moodle' }} BEHAT_TAGS: ${{ github.event.inputs.behat_tags || '~@performance&&~@ionic7_failure' }} @@ -37,7 +37,7 @@ jobs: - name: Additional checkouts run: | git clone --branch $MOODLE_BRANCH --depth 1 $MOODLE_REPOSITORY $GITHUB_WORKSPACE/moodle - git clone --branch master --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker + git clone --branch main --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker - name: Install npm packages run: npm ci --no-audit - name: Create Behat faildumps folder diff --git a/.github/workflows/performance.yml b/.github/workflows/performance.yml index ce6475d27..025956e75 100644 --- a/.github/workflows/performance.yml +++ b/.github/workflows/performance.yml @@ -16,8 +16,8 @@ jobs: node-version-file: '.nvmrc' - name: Additional checkouts run: | - git clone --branch master --depth 1 https://github.com/moodle/moodle $GITHUB_WORKSPACE/moodle - git clone --branch master --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker + git clone --branch main --depth 1 https://github.com/moodle/moodle $GITHUB_WORKSPACE/moodle + git clone --branch main --depth 1 https://github.com/moodlehq/moodle-docker $GITHUB_WORKSPACE/moodle-docker - name: Install npm packages run: npm ci --no-audit - name: Generate Behat tests plugin diff --git a/scripts/langindex.json b/scripts/langindex.json index 3c3c3e1f9..c9c894df6 100644 --- a/scripts/langindex.json +++ b/scripts/langindex.json @@ -72,6 +72,7 @@ "addon.block_starredcourses.nocourses": "block_starredcourses", "addon.block_starredcourses.pluginname": "block_starredcourses", "addon.block_tags.pluginname": "block_tags", + "addon.block_timeline.ariadayfilter": "block_timeline", "addon.block_timeline.duedate": "block_timeline", "addon.block_timeline.next30days": "block_timeline", "addon.block_timeline.next3months": "block_timeline", diff --git a/src/addons/block/timeline/components/timeline/addon-block-timeline.html b/src/addons/block/timeline/components/timeline/addon-block-timeline.html index a5bc3a312..4aca795d0 100644 --- a/src/addons/block/timeline/components/timeline/addon-block-timeline.html +++ b/src/addons/block/timeline/components/timeline/addon-block-timeline.html @@ -14,7 +14,8 @@ - + {{ option.name | translate }} diff --git a/src/addons/block/timeline/lang.json b/src/addons/block/timeline/lang.json index b4cb56414..efd22154f 100644 --- a/src/addons/block/timeline/lang.json +++ b/src/addons/block/timeline/lang.json @@ -1,4 +1,5 @@ { + "ariadayfilter": "Filter timeline by date", "duedate": "Due date", "next30days": "Next 30 days", "next3months": "Next 3 months", diff --git a/src/addons/block/timeline/tests/behat/basic_usage.feature b/src/addons/block/timeline/tests/behat/basic_usage.feature index 34b002473..e8591a04f 100644 --- a/src/addons/block/timeline/tests/behat/basic_usage.feature +++ b/src/addons/block/timeline/tests/behat/basic_usage.feature @@ -46,7 +46,7 @@ Feature: Timeline block. | assign | C3 | assign24 | Assignment 24 | ##+1 year## | | assign | C3 | assign25 | Assignment 25 | ##+1 year## | - @lms_from4.0 @ionic7_failure + @lms_from4.0 Scenario: See courses inside block Given I entered the app as "student1" Then I should find "Assignment 00" within "Timeline" "ion-card" in the app @@ -57,7 +57,7 @@ Feature: Timeline block. But I should not find "Assignment 01" within "Timeline" "ion-card" in the app And I should not find "Course 3" within "Timeline" "ion-card" in the app - When I press "Next 30 days" in the app + When I press "Filter timeline by date" in the app And I press "Overdue" in the app Then I should find "Assignment 01" within "Timeline" "ion-card" in the app And I should find "Course 2" within "Timeline" "ion-card" in the app @@ -66,7 +66,7 @@ Feature: Timeline block. And I should not find "Course 1" within "Timeline" "ion-card" in the app And I should not find "Course 3" within "Timeline" "ion-card" in the app - When I press "Overdue" in the app + When I press "Filter timeline by date" in the app And I press "All" in the app Then I should find "Assignment 19" within "Timeline" "ion-card" in the app And I should find "Course 3" within "Timeline" "ion-card" in the app @@ -76,7 +76,7 @@ Feature: Timeline block. Then I should find "Assignment 21" within "Timeline" "ion-card" in the app And I should find "Assignment 25" within "Timeline" "ion-card" in the app - When I press "All" in the app + When I press "Filter timeline by date" in the app And I press "Next 7 days" in the app And I press "Sort by" in the app And I press "Sort by courses" in the app diff --git a/src/addons/calendar/components/calendar/calendar.ts b/src/addons/calendar/components/calendar/calendar.ts index 3561366a8..6fac088f5 100644 --- a/src/addons/calendar/components/calendar/calendar.ts +++ b/src/addons/calendar/components/calendar/calendar.ts @@ -142,7 +142,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro } /** - * Component loaded. + * @inheritdoc */ ngOnInit(): void { this.canNavigate = typeof this.canNavigate == 'undefined' ? true : CoreUtils.isTrueOrOne(this.canNavigate); @@ -164,7 +164,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro } /** - * Detect and act upon changes that Angular can’t or won’t detect on its own (objects and arrays). + * @inheritdoc */ ngDoCheck(): void { const items = this.manager?.getSource().getItems(); @@ -368,7 +368,7 @@ export class AddonCalendarCalendarComponent implements OnInit, DoCheck, OnDestro } /** - * Component destroyed. + * @inheritdoc */ ngOnDestroy(): void { this.undeleteEventObserver?.off(); diff --git a/src/addons/calendar/pages/day/day.ts b/src/addons/calendar/pages/day/day.ts index 6097d8af7..2a57565f9 100644 --- a/src/addons/calendar/pages/day/day.ts +++ b/src/addons/calendar/pages/day/day.ts @@ -65,15 +65,8 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { protected currentSiteId: string; // Observers. - protected newEventObserver: CoreEventObserver; - protected discardedObserver: CoreEventObserver; - protected editEventObserver: CoreEventObserver; - protected deleteEventObserver: CoreEventObserver; - protected undeleteEventObserver: CoreEventObserver; - protected syncObserver: CoreEventObserver; - protected manualSyncObserver: CoreEventObserver; + protected eventObservers: CoreEventObserver[] = []; protected onlineObserver: Subscription; - protected filterChangedObserver: CoreEventObserver; protected managerUnsubscribe?: () => void; protected logView: () => void; @@ -97,7 +90,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { this.currentSiteId = CoreSites.getCurrentSiteId(); // Listen for events added. When an event is added, reload the data. - this.newEventObserver = CoreEvents.on( + this.eventObservers.push(CoreEvents.on( AddonCalendarProvider.NEW_EVENT_EVENT, (data) => { if (data && data.eventId) { @@ -106,16 +99,16 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { } }, this.currentSiteId, - ); + )); // Listen for new event discarded event. When it does, reload the data. - this.discardedObserver = CoreEvents.on(AddonCalendarProvider.NEW_EVENT_DISCARDED_EVENT, () => { + this.eventObservers.push(CoreEvents.on(AddonCalendarProvider.NEW_EVENT_DISCARDED_EVENT, () => { this.manager?.getSource().markAllItemsUnloaded(); this.refreshData(true, true); - }, this.currentSiteId); + }, this.currentSiteId)); // Listen for events edited. When an event is edited, reload the data. - this.editEventObserver = CoreEvents.on( + this.eventObservers.push(CoreEvents.on( AddonCalendarProvider.EDIT_EVENT_EVENT, (data) => { if (data && data.eventId) { @@ -124,25 +117,25 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { } }, this.currentSiteId, - ); + )); // Refresh data if calendar events are synchronized automatically. - this.syncObserver = CoreEvents.on(AddonCalendarSyncProvider.AUTO_SYNCED, () => { + this.eventObservers.push(CoreEvents.on(AddonCalendarSyncProvider.AUTO_SYNCED, () => { this.manager?.getSource().markAllItemsUnloaded(); this.refreshData(false, true); - }, this.currentSiteId); + }, this.currentSiteId)); // Refresh data if calendar events are synchronized manually but not by this page. - this.manualSyncObserver = CoreEvents.on(AddonCalendarSyncProvider.MANUAL_SYNCED, (data) => { + this.eventObservers.push(CoreEvents.on(AddonCalendarSyncProvider.MANUAL_SYNCED, (data) => { const selectedDay = this.manager?.getSelectedItem(); if (data && (data.source != 'day' || !selectedDay || !data.moment || !selectedDay.moment.isSame(data.moment, 'day'))) { this.manager?.getSource().markAllItemsUnloaded(); this.refreshData(false, true); } - }, this.currentSiteId); + }, this.currentSiteId)); // Update the events when an event is deleted. - this.deleteEventObserver = CoreEvents.on( + this.eventObservers.push(CoreEvents.on( AddonCalendarProvider.DELETED_EVENT_EVENT, (data) => { if (data && !data.sent) { @@ -154,10 +147,10 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { } }, this.currentSiteId, - ); + )); // Listen for events "undeleted" (offline). - this.undeleteEventObserver = CoreEvents.on( + this.eventObservers.push(CoreEvents.on( AddonCalendarProvider.UNDELETED_EVENT_EVENT, (data) => { if (!data || !data.eventId) { @@ -168,9 +161,9 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { this.manager?.getSource().markAsDeleted(data.eventId, false); }, this.currentSiteId, - ); + )); - this.filterChangedObserver = CoreEvents.on( + this.eventObservers.push(CoreEvents.on( AddonCalendarProvider.FILTER_CHANGED_EVENT, async (data) => { this.filter = data; @@ -180,7 +173,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { this.manager?.getSource().filterAllDayEvents(this.filter); }, - ); + )); // Refresh online status when changes. this.onlineObserver = CoreNetwork.onChange().subscribe(() => { @@ -214,7 +207,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { } /** - * View loaded. + * @inheritdoc */ ngOnInit(): void { const types: string[] = []; @@ -470,18 +463,11 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { } /** - * Page destroyed. + * @inheritdoc */ ngOnDestroy(): void { - this.newEventObserver?.off(); - this.discardedObserver?.off(); - this.editEventObserver?.off(); - this.deleteEventObserver?.off(); - this.undeleteEventObserver?.off(); - this.syncObserver?.off(); - this.manualSyncObserver?.off(); + this.eventObservers.forEach((observer) => observer.off()); this.onlineObserver?.unsubscribe(); - this.filterChangedObserver?.off(); this.manager?.getSource().forgetRelatedSources(); this.manager?.destroy(); this.managerUnsubscribe?.(); diff --git a/src/addons/calendar/tests/behat/create_events.feature b/src/addons/calendar/tests/behat/create_events.feature index afde42680..6f995d079 100755 --- a/src/addons/calendar/tests/behat/create_events.feature +++ b/src/addons/calendar/tests/behat/create_events.feature @@ -20,13 +20,14 @@ Feature: Test creation of calendar events in app | teacher1 | C1 | editingteacher | | student1 | C1 | student | - @ionic7_failure + # This test is flaky due to timestamp. Scenario: Create user event as student from monthly view Given I entered the app as "student1" When I press "More" in the app And I press "Calendar" in the app And I press "New event" in the app - Then the field "Date" matches value "## now ##%d/%m/%y, %H:%M##" in the app + # Flaky step, sometimes it fails due to minute change when checking. + Then the field "Date" matches value "## now ##%Y-%m-%dT%H:%M##" in the app And I should not be able to press "Save" in the app # Check that student can only create User events. @@ -36,7 +37,7 @@ Feature: Test creation of calendar events in app # Create the event. When I set the field "Event title" to "User Event 01" in the app - And I set the field "Date" to "2025-04-11T09:00+08:00" in the app + And I set the field "Date" to "2025-04-11T09:00" in the app And I press "Without duration" in the app And I set the field "Description" to "This is User Event 01 description." in the app And I set the field "Location" to "Barcelona" in the app diff --git a/src/addons/competency/tests/behat/navigation.feature b/src/addons/competency/tests/behat/navigation.feature index c891c52e8..484278102 100644 --- a/src/addons/competency/tests/behat/navigation.feature +++ b/src/addons/competency/tests/behat/navigation.feature @@ -297,7 +297,6 @@ Feature: Test competency navigation Then I should find "Desserts are important" in the app But I should not find "Cakes" in the app - @ionic7_failure Scenario: Tablet navigation (student) Given I entered the course "Course 1" as "student1" in the app And I change viewport size to "1200x640" in the app @@ -383,7 +382,6 @@ Feature: Test competency navigation Then I should find "Desserts are important" in the app But I should not find "Cakes" in the app - @ionic7_failure Scenario: Tablet navigation (teacher) Given I entered the course "Course 1" as "teacher1" in the app And I change viewport size to "1200x640" in the app @@ -391,7 +389,7 @@ Feature: Test competency navigation # Participant competencies When I press "Participants" in the app And I press "Student first" in the app - And I press "Competencies" in the app + And I press "Competencies" within "Student first" "page-core-user-participants" in the app Then I should find "Student first" in the app And I should find "Salads are important" in the app And I should find "Good" within "salads" "ion-item" in the app diff --git a/src/addons/messages/tests/behat/basic_usage.feature b/src/addons/messages/tests/behat/basic_usage.feature index 828a310f5..eb3621b0f 100755 --- a/src/addons/messages/tests/behat/basic_usage.feature +++ b/src/addons/messages/tests/behat/basic_usage.feature @@ -19,7 +19,6 @@ Feature: Test basic usage of messages in app | student1 | C1 | student | | student2 | C1 | student | - @ionic7_failure Scenario: View recent conversations and contacts Given I entered the app as "teacher1" When I press "Messages" in the app @@ -217,7 +216,6 @@ Feature: Test basic usage of messages in app Then I should find "heeey student" in the app And I should find "byee" in the app - @ionic7_failure Scenario: Search for messages Given I entered the app as "teacher1" When I press "Messages" in the app @@ -348,7 +346,6 @@ Feature: Test basic usage of messages in app Then I should find "test message" in the app And I should find "Muted conversation" in the app - @ionic7_failure Scenario: Self conversations Given I entered the app as "student1" When I press "Messages" in the app diff --git a/src/addons/mod/glossary/tests/behat/navigation.feature b/src/addons/mod/glossary/tests/behat/navigation.feature index 3213a04b2..fb6ac072b 100644 --- a/src/addons/mod/glossary/tests/behat/navigation.feature +++ b/src/addons/mod/glossary/tests/behat/navigation.feature @@ -146,11 +146,11 @@ Feature: Test glossary navigation When I press the back button in the app And I scroll to "Acerola" in the app And I press "Search" in the app - And I set the field "Search" to "something" in the app + And I set the field "Search query" to "something" in the app And I press enter Then I should find "No entries were found." in the app - When I set the field "Search" to "melon" in the app + When I set the field "Search query" to "melon" in the app And I press enter Then I should find "Honeydew Melon" in the app And I should find "Watermelon" in the app @@ -266,11 +266,11 @@ Feature: Test glossary navigation # Search When I press "Search" in the app - And I set the field "Search" to "something" in the app + And I set the field "Search query" to "something" in the app And I press enter Then I should find "No entries were found." in the app - When I set the field "Search" to "melon" in the app + When I set the field "Search query" to "melon" in the app And I press enter Then I should find "Honeydew Melon" in the app And I should find "Watermelon" in the app diff --git a/src/addons/mod/quiz/tests/behat/basic_usage.feature b/src/addons/mod/quiz/tests/behat/basic_usage.feature index d98846609..d6005859d 100755 --- a/src/addons/mod/quiz/tests/behat/basic_usage.feature +++ b/src/addons/mod/quiz/tests/behat/basic_usage.feature @@ -133,7 +133,6 @@ Feature: Attempt a quiz in app And I should find "Question 1" in the app And I should find "Question 2" in the app - @ionic7_failure Scenario: Attempt a quiz (all question types) Given I entered the quiz activity "Quiz 2" on course "Course 1" as "student1" in the app When I press "Attempt quiz now" in the app @@ -156,12 +155,9 @@ Feature: Attempt a quiz in app And I press "Next" in the app And I press "True" in the app And I press "Next" in the app - And I press "Choose... , frog" in the app - And I press "amphibian" in the app - And I press "Choose... , newt" in the app - And I press "insect" in the app - And I press "Choose... , cat" in the app - And I press "mammal" in the app + And I set the field "frog" to "amphibian" in the app + And I set the field "newt" to "insect" in the app + And I set the field "cat" to "mammal" in the app And I press "Next" in the app Then I should find "Text of the eighth question" in the app diff --git a/src/addons/mod/survey/tests/behat/basic_usage.feature b/src/addons/mod/survey/tests/behat/basic_usage.feature index 1355b6f7a..f12395a58 100755 --- a/src/addons/mod/survey/tests/behat/basic_usage.feature +++ b/src/addons/mod/survey/tests/behat/basic_usage.feature @@ -20,7 +20,6 @@ Feature: Test basic usage of survey activity in app | activity | name | intro | course | idnumber | groupmode | | survey | Test survey name | Test survey | C1 | survey | 0 | - @ionic7_failure Scenario: Answer a survey & View results (ATTLS) Given I entered the survey activity "Test survey name" on course "Course 1" as "student1" in the app And I set the following fields to these values in the app: @@ -79,7 +78,6 @@ Feature: Test basic usage of survey activity in app And I should see "4th answer" And I should see "5th answer" - @ionic7_failure Scenario: Answer a survey & View results (Colles actual) Given the following "activities" exist: | activity | name | intro | template |course | idnumber | groupmode | @@ -122,7 +120,6 @@ Feature: Test basic usage of survey activity in app Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." And I should see "1 people have completed this survey so far" - @ionic7_failure Scenario: Answer a survey & View results (Colles preferred) Given the following "activities" exist: | activity | name | intro | template | course | idnumber | groupmode | @@ -165,7 +162,6 @@ Feature: Test basic usage of survey activity in app Then I should see "You've completed this survey. The graph below shows a summary of your results compared to the class averages." And I should see "1 people have completed this survey so far" - @ionic7_failure Scenario: Answer a survey & View results (Colles preferred and actual) Given the following "activities" exist: | activity | name | intro | template | course | idnumber | groupmode | diff --git a/src/addons/notifications/pages/list/list.html b/src/addons/notifications/pages/list/list.html index 16d7d3e00..3ae30321c 100644 --- a/src/addons/notifications/pages/list/list.html +++ b/src/addons/notifications/pages/list/list.html @@ -19,11 +19,8 @@ + [attr.aria-current]="notifications.getItemAriaCurrent(notification)" (click)="notifications.select(notification)" button + [detail]="false" lines="full"> -

+

diff --git a/src/addons/notifications/tests/behat/notifications.feature b/src/addons/notifications/tests/behat/notifications.feature index 6ad776d57..fb79dcc4a 100644 --- a/src/addons/notifications/tests/behat/notifications.feature +++ b/src/addons/notifications/tests/behat/notifications.feature @@ -78,7 +78,6 @@ Feature: Notifications Then I should find "Test 10 description" in the app But I should not find "Test 09 description" in the app - @ionic7_failure Scenario: Tablet navigation Given I entered the app as "student1" And I change viewport size to "1200x640" in the app diff --git a/src/addons/userprofilefield/datetime/component/addon-user-profile-field-datetime.html b/src/addons/userprofilefield/datetime/component/addon-user-profile-field-datetime.html index af214ff51..43341f2e6 100644 --- a/src/addons/userprofilefield/datetime/component/addon-user-profile-field-datetime.html +++ b/src/addons/userprofilefield/datetime/component/addon-user-profile-field-datetime.html @@ -22,7 +22,12 @@ - + + + + + diff --git a/src/core/components/combobox/core-combobox.html b/src/core/components/combobox/core-combobox.html index 1ffd3db43..8d0868bc5 100644 --- a/src/core/components/combobox/core-combobox.html +++ b/src/core/components/combobox/core-combobox.html @@ -5,7 +5,7 @@ + [interface]="interface" [attr.aria-label]="label" [disabled]="disabled" [hidden]="!!icon"> diff --git a/src/core/components/context-menu/core-context-menu-popover.html b/src/core/components/context-menu/core-context-menu-popover.html index 1e2accd45..9e844194a 100644 --- a/src/core/components/context-menu/core-context-menu-popover.html +++ b/src/core/components/context-menu/core-context-menu-popover.html @@ -7,17 +7,22 @@ [href]="item.href" (click)="itemClicked($event, item)" [attr.aria-label]="item.ariaAction" [hidden]="item.hidden" [detail]="!!(item.href && !item.iconAction)" role="menuitem" [button]="!!(item.href && !item.iconAction)" [showBrowserWarning]="item.showBrowserWarning"> - +

-
- -