forked from EVOgeek/Vmeda.Online
		
	Merge pull request #3345 from NoelDeMartin/MOBILE-4081
MOBILE-4081: Fix 3.9 tests
This commit is contained in:
		
						commit
						842faa30c6
					
				| @ -0,0 +1,93 @@ | ||||
| @block @block_timeline @app @javascript @lms_upto3.10 | ||||
| Feature: Timeline block. | ||||
| 
 | ||||
|   Background: | ||||
|     Given the following "users" exist: | ||||
|       | username | | ||||
|       | student1 | | ||||
|     And the following "courses" exist: | ||||
|       | fullname | shortname | | ||||
|       | Course 1 | C1        | | ||||
|       | Course 2 | C2        | | ||||
|       | Course 3 | C3        | | ||||
|       | Course 4 | C4        | | ||||
|     And the following "course enrolments" exist: | ||||
|       | user     | course | role    | | ||||
|       | student1 | C1     | student | | ||||
|       | student1 | C2     | student | | ||||
|       | student1 | C3     | student | | ||||
|       | student1 | Acceptance test site | student | | ||||
|     And the following "activities" exist: | ||||
|       | activity | course               | idnumber  | name          | duedate        | | ||||
|       | assign   | Acceptance test site | assign00  | Assignment 00 | ##tomorrow##   | | ||||
|       | assign   | C2                   | assign01  | Assignment 01 | ##yesterday##  | | ||||
|       | assign   | C1                   | assign02  | Assignment 02 | ##tomorrow##   | | ||||
|       | assign   | C1                   | assign03  | Assignment 03 | ##tomorrow##   | | ||||
|       | assign   | C2                   | assign04  | Assignment 04 | ##+2 days##    | | ||||
|       | assign   | C1                   | assign05  | Assignment 05 | ##+5 days##    | | ||||
|       | assign   | C2                   | assign06  | Assignment 06 | ##+1 month##   | | ||||
|       | assign   | C2                   | assign07  | Assignment 07 | ##+1 month##   | | ||||
|       | assign   | C3                   | assign08  | Assignment 08 | ##+1 month##   | | ||||
|       | assign   | C2                   | assign09  | Assignment 09 | ##+1 month##   | | ||||
|       | assign   | C1                   | assign10  | Assignment 10 | ##+1 month##   | | ||||
|       | assign   | C1                   | assign11  | Assignment 11 | ##+6 months##  | | ||||
|       | assign   | C1                   | assign12  | Assignment 12 | ##+6 months##  | | ||||
|       | assign   | C1                   | assign13  | Assignment 13 | ##+6 months##  | | ||||
|       | assign   | C2                   | assign14  | Assignment 14 | ##+6 months##  | | ||||
|       | assign   | C2                   | assign15  | Assignment 15 | ##+6 months##  | | ||||
|       | assign   | C2                   | assign16  | Assignment 16 | ##+6 months##  | | ||||
|       | assign   | C3                   | assign17  | Assignment 17 | ##+6 months##  | | ||||
|       | assign   | C3                   | assign18  | Assignment 18 | ##+6 months##  | | ||||
|       | assign   | C3                   | assign19  | Assignment 19 | ##+6 months##  | | ||||
|       | assign   | C1                   | assign20  | Assignment 20 | ##+1 year##    | | ||||
|       | assign   | C1                   | assign21  | Assignment 21 | ##+1 year##    | | ||||
|       | assign   | C2                   | assign22  | Assignment 22 | ##+1 year##    | | ||||
|       | assign   | C2                   | assign23  | Assignment 23 | ##+1 year##    | | ||||
|       | assign   | C3                   | assign24  | Assignment 24 | ##+1 year##    | | ||||
|       | assign   | C3                   | assign25  | Assignment 25 | ##+1 year##    | | ||||
| 
 | ||||
|   Scenario: See courses inside block | ||||
|     Given I entered the app as "student1" | ||||
|     And I press "Open block drawer" in the app | ||||
|     Then I should find "Assignment 00" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Assignment 02" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Assignment 05" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Course 1" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Course 2" within "Timeline" "ion-card" in the app | ||||
|     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 | ||||
|     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 | ||||
|     But I should not find "Assignment 00" within "Timeline" "ion-card" in the app | ||||
|     And I should not find "Assignment 02" within "Timeline" "ion-card" in the app | ||||
|     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 | ||||
|     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 | ||||
|     But I should not find "Assignment 20" within "Timeline" "ion-card" in the app | ||||
| 
 | ||||
|     When I press "Load more" in the app | ||||
|     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 | ||||
|     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 | ||||
|     Then I should find "Course 1" "h3" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Course 2" "h3" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Assignment 02" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Assignment 04" within "Timeline" "ion-card" in the app | ||||
|     But I should not find "Course 3" within "Timeline" "ion-card" in the app | ||||
| 
 | ||||
|     When the following "activities" exist: | ||||
|       | activity | course | idnumber  | name           | duedate      | | ||||
|       | assign   | C1     | newassign | New Assignment | ##tomorrow## | | ||||
|     And I pull to refresh in the app | ||||
|     Then I should find "New Assignment" in the app | ||||
| @ -1,4 +1,4 @@ | ||||
| @app @javascript | ||||
| @block @block_timeline @app @javascript | ||||
| Feature: Timeline block. | ||||
| 
 | ||||
|   Background: | ||||
| @ -46,8 +46,10 @@ Feature: Timeline block. | ||||
|       | assign   | C3                   | assign24  | Assignment 24 | ##+1 year##    | | ||||
|       | assign   | C3                   | assign25  | Assignment 25 | ##+1 year##    | | ||||
| 
 | ||||
|   @lms_from3.11 | ||||
|   Scenario: See courses inside block | ||||
|     Given I entered the app as "student1" | ||||
|     And I press "Open block drawer" in the app | ||||
|     Then I should find "Assignment 00" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Assignment 02" within "Timeline" "ion-card" in the app | ||||
|     And I should find "Assignment 05" within "Timeline" "ion-card" in the app | ||||
|  | ||||
| @ -1,9 +1,6 @@ | ||||
| <img *ngIf="completion && completion.tracking !== 1" [src]="completionImage" [alt]="completionDescription"> | ||||
| <img *ngIf="completion && completion.tracking !== 1" [src]="completionImage" [alt]="completionDescription$ | async"> | ||||
| 
 | ||||
| <ion-button | ||||
|     fill="clear" | ||||
|     *ngIf="completion && completion.tracking === 1" | ||||
|     (click)="completionClicked($event)" | ||||
|     [title]="completionDescription"> | ||||
| <ion-button fill="clear" *ngIf="completion && completion.tracking === 1" (click)="completionClicked($event)" | ||||
|     [title]="completionDescription$ | async"> | ||||
|     <img [src]="completionImage" role="presentation" alt=""> | ||||
| </ion-button> | ||||
|  | ||||
| @ -24,6 +24,7 @@ import { Translate } from '@singletons'; | ||||
| import { CoreCourseModuleCompletionBaseComponent } from '@features/course/classes/module-completion'; | ||||
| import { CoreCourseHelper } from '@features/course/services/course-helper'; | ||||
| import { CoreEventObserver, CoreEvents } from '@singletons/events'; | ||||
| import { BehaviorSubject } from 'rxjs'; | ||||
| 
 | ||||
| /** | ||||
|  * Component to handle activity completion in sites previous to 3.11. | ||||
| @ -43,7 +44,7 @@ export class CoreCourseModuleCompletionLegacyComponent extends CoreCourseModuleC | ||||
|     implements OnInit, OnDestroy { | ||||
| 
 | ||||
|     completionImage?: string; | ||||
|     completionDescription?: string; | ||||
|     completionDescription$ = new BehaviorSubject(''); | ||||
| 
 | ||||
|     protected completionObserver?: CoreEventObserver; | ||||
| 
 | ||||
| @ -133,7 +134,7 @@ export class CoreCourseModuleCompletionLegacyComponent extends CoreCourseModuleC | ||||
|             }; | ||||
|         } | ||||
| 
 | ||||
|         this.completionDescription = Translate.instant(langKey, translateParams); | ||||
|         this.completionDescription$.next(Translate.instant(langKey, translateParams)); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
							
								
								
									
										44
									
								
								src/tests/behat/open_files-39.feature
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								src/tests/behat/open_files-39.feature
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,44 @@ | ||||
| @app @javascript @lms_upto3.9 | ||||
| Feature: It opens files properly. | ||||
| 
 | ||||
|   Background: | ||||
|     Given the following "users" exist: | ||||
|       | username | | ||||
|       | student1 | | ||||
|     And the following "courses" exist: | ||||
|       | fullname | shortname | | ||||
|       | Course 1 | C1        | | ||||
|     And the following "course enrolments" exist: | ||||
|       | user     | course | role    | | ||||
|       | student1 | C1     | student | | ||||
|     And the following "activities" exist: | ||||
|       | activity | name     | intro                | display | course | defaultfilename | | ||||
|       | resource | Test TXT | Test TXT description | 5       | C1     | A txt.txt       | | ||||
|       | resource | Test RTF | Test RTF description | 5       | C1     | A rtf.rtf       | | ||||
|       | resource | Test DOC | Test DOC description | 5       | C1     | A doc.doc       | | ||||
| 
 | ||||
|   Scenario: Open a file | ||||
|     Given I entered the resource activity "Test TXT" on course "Course 1" as "student1" in the app | ||||
|     When I press "Open" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:" | ||||
| 
 | ||||
|     When I switch to the browser tab opened by the app | ||||
|     Then I should see "Test resource A txt.txt file" | ||||
| 
 | ||||
|     When I close the browser tab opened by the app | ||||
|     And I press the back button in the app | ||||
|     And I press "Test RTF" in the app | ||||
|     And I press "Open" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:" | ||||
| 
 | ||||
|     When I switch to the browser tab opened by the app | ||||
|     Then I should see "Test resource A rtf.rtf file" | ||||
| 
 | ||||
|     When I close the browser tab opened by the app | ||||
|     And I press the back button in the app | ||||
|     And I press "Test DOC" in the app | ||||
|     And I press "Open" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:" | ||||
| 
 | ||||
|     When I switch to the browser tab opened by the app | ||||
|     Then I should see "Test resource A doc.doc file" | ||||
| @ -19,10 +19,11 @@ Feature: It opens files properly. | ||||
|     And the following config values are set as admin: | ||||
|       | filetypeexclusionlist | rtf,doc | tool_mobile | | ||||
| 
 | ||||
|   @lms_from3.10 | ||||
|   Scenario: Open a file | ||||
|     Given I entered the resource activity "Test TXT" on course "Course 1" as "student1" in the app | ||||
|     When I press "Open" near "Last modified" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:(first)?" | ||||
|     When I press "Open" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:" | ||||
| 
 | ||||
|     When I switch to the browser tab opened by the app | ||||
|     Then I should see "Test resource A txt.txt file" | ||||
| @ -30,26 +31,26 @@ Feature: It opens files properly. | ||||
|     When I close the browser tab opened by the app | ||||
|     And I press the back button in the app | ||||
|     And I press "Test RTF" in the app | ||||
|     And I press "Open" near "Last modified" in the app | ||||
|     And I press "Open" in the app | ||||
|     Then I should find "This file may not work as expected on this device" in the app | ||||
| 
 | ||||
|     When I press "Open file" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:(second)?" | ||||
|     Then the app should have opened a browser tab with url "^blob:" | ||||
| 
 | ||||
|     When I switch to the browser tab opened by the app | ||||
|     Then I should see "Test resource A rtf.rtf file" | ||||
| 
 | ||||
|     When I close the browser tab opened by the app | ||||
|     And I press "Open" near "Last modified" in the app | ||||
|     And I press "Open" in the app | ||||
|     Then I should find "This file may not work as expected on this device" in the app | ||||
| 
 | ||||
|     When I select "Don't show again." in the app | ||||
|     And I press "Open file" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:(third)?" | ||||
|     Then the app should have opened a browser tab with url "^blob:" | ||||
| 
 | ||||
|     When I close the browser tab opened by the app | ||||
|     And I press "Open" near "Last modified" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:(fourth)?" | ||||
|     And I press "Open" in the app | ||||
|     Then the app should have opened a browser tab with url "^blob:" | ||||
| 
 | ||||
|     When I close the browser tab opened by the app | ||||
|     And I press the back button in the app | ||||
|  | ||||
| @ -8,8 +8,9 @@ Feature: It has a Behat runtime with testing helpers. | ||||
| 
 | ||||
|   Scenario: Finds and presses elements | ||||
|     Given I entered the app as "student1" | ||||
|     And I press "Search courses" in the app | ||||
|     When I set the following fields to these values in the app: | ||||
|       | Search by activity type or name | Foo bar | | ||||
|       | Search | Foo bar | | ||||
|     Then I should find "Search" "button" in the app | ||||
|     And I should find "Clear search" in the app | ||||
|     And I should be able to press "Search" "button" in the app | ||||
|  | ||||
							
								
								
									
										4
									
								
								src/types/config.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								src/types/config.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -14,7 +14,7 @@ | ||||
| 
 | ||||
| import { CoreColorScheme, CoreZoomLevel } from '@features/settings/services/settings-helper'; | ||||
| import { CoreMainMenuLocalizedCustomItem } from '@features/mainmenu/services/mainmenu'; | ||||
| import { CoreSitesDemoSiteData } from '@services/sites'; | ||||
| import { CoreLoginSiteInfo, CoreSitesDemoSiteData } from '@services/sites'; | ||||
| import { OpenFileAction } from '@services/utils/utils'; | ||||
| import { CoreLoginSiteSelectorListMethod } from '@features/login/services/login-helper'; | ||||
| import { CoreDatabaseConfiguration } from '@classes/database/database-table'; | ||||
| @ -42,7 +42,7 @@ export interface EnvironmentConfig { | ||||
|     zoomlevels: Record<CoreZoomLevel, number>; | ||||
|     defaultZoomLevel?: CoreZoomLevel; // Set the default zoom level of the app.
 | ||||
|     customurlscheme: string; | ||||
|     siteurl: string; | ||||
|     siteurl: string | CoreLoginSiteInfo[]; | ||||
|     sitename: string; | ||||
|     multisitesdisplay: CoreLoginSiteSelectorListMethod; | ||||
|     sitefindersettings: Record<string, unknown>; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user