forked from EVOgeek/Vmeda.Online
		
	MOBILE-4069 scorm: Add appearance, attempts and grading behat tests
This commit is contained in:
		
							parent
							
								
									5e669f1689
								
							
						
					
					
						commit
						2db13af8dd
					
				
							
								
								
									
										170
									
								
								src/addons/mod/scorm/tests/behat/appearance_options.feature
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										170
									
								
								src/addons/mod/scorm/tests/behat/appearance_options.feature
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,170 @@ | ||||
| @mod @mod_scorm @app @javascript | ||||
| Feature: Test appearance options of SCORM activity in app | ||||
|   In order to play a SCORM while using the mobile app | ||||
|   As a student | ||||
|   I need appearance options to be applied properly | ||||
| 
 | ||||
|   Background: | ||||
|     Given the following "users" exist: | ||||
|       | username | firstname | lastname | email                | | ||||
|       | teacher1 | Teacher   | teacher  | teacher1@example.com | | ||||
|       | student1 | Student   | student  | student1@example.com | | ||||
|     And the following "courses" exist: | ||||
|       | fullname | shortname | category | | ||||
|       | Course 1 | C1        | 0        | | ||||
|     And the following "course enrolments" exist: | ||||
|       | user     | course | role           | | ||||
|       | teacher1 | C1     | editingteacher | | ||||
|       | student1 | C1     | student        | | ||||
| 
 | ||||
|   Scenario: Apply width and height when using New window mode | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name                  | course | idnumber | packagefilepath                                               | popup | width | height | | ||||
|       | scorm    | Current window SCORM  | C1     | scorm    | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 0     | 300   | 300    | | ||||
|       | scorm    | New window px SCORM   | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1     | 300   | 300    | | ||||
|       | scorm    | New window perc SCORM | C1     | scorm3   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1     | 50%   | 60%    | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     And I change viewport size to "1200x640" in the app | ||||
|     When I press "Current window SCORM" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     Then the UI should match the snapshot | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press the back button in the app | ||||
|     And I press "New window px SCORM" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     Then the UI should match the snapshot | ||||
| 
 | ||||
|     # SCORMs with percentage sizes are displayed with full size in the app. See MOBILE-3426 for details. | ||||
|     When I press the back button in the app | ||||
|     And I press the back button in the app | ||||
|     And I press "New window perc SCORM" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     Then the UI should match the snapshot | ||||
| 
 | ||||
|   Scenario: Skip SCORM entry page if needed | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name                    | course | idnumber | packagefilepath                                               | skipview | | ||||
|       | scorm    | No skip SCORM           | C1     | scorm    | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 0        | | ||||
|       | scorm    | Skip first access SCORM | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1        | | ||||
|       | scorm    | Always skip SCORM       | C1     | scorm3   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 2        | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "No skip SCORM" in the app | ||||
|     Then I should be able to press "Enter" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press "Skip first access SCORM" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     Then I should find "2 / 11" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press the back button in the app | ||||
|     And I press "Skip first access SCORM" in the app | ||||
|     Then I should be able to press "Enter" in the app | ||||
|     And I should not be able to press "Disable fullscreen" in the app | ||||
|     And I should not find "3 / 11" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press "Always skip SCORM" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     Then I should find "2 / 11" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press the back button in the app | ||||
|     And I press "Always skip SCORM" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     Then I should find "3 / 11" in the app | ||||
| 
 | ||||
|   Scenario: Disable preview mode | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name                  | course | idnumber | packagefilepath                                               | hidebrowse | | ||||
|       | scorm    | SCORM without preview | C1     | scorm    | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1          | | ||||
|       | scorm    | SCORM with preview    | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 0          | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "SCORM without preview" in the app | ||||
|     Then I should not be able to press "Preview" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press "SCORM with preview" in the app | ||||
|     Then I should be able to press "Preview" in the app | ||||
| 
 | ||||
|   Scenario: Display course structure on entry page | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name                    | course | idnumber | packagefilepath                                               | displaycoursestructure | | ||||
|       | scorm    | SCORM without structure | C1     | scorm    | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 0                      | | ||||
|       | scorm    | SCORM with structure    | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1                      | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "SCORM without structure" in the app | ||||
|     Then I should not find "Other Scoring Systems" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press "SCORM with structure" in the app | ||||
|     Then I should find "Other Scoring Systems" in the app | ||||
| 
 | ||||
|   Scenario: Display course structure in player | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name              | course | idnumber | packagefilepath                                               | hidetoc | | ||||
|       | scorm    | SCORM To the side | C1     | scorm    | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 0       | | ||||
|       | scorm    | SCORM Hidden      | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1       | | ||||
|       | scorm    | SCORM Drop Down   | C1     | scorm3   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 2       | | ||||
|       | scorm    | SCORM Disabled    | C1     | scorm4   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 3       | | ||||
|     # In the app, the TOC is always displayed the same unless it's disabled. | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "SCORM To the side" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     And I press "TOC" in the app | ||||
|     Then I should find "Other Scoring Systems" in the app | ||||
| 
 | ||||
|     When I press "Close" in the app | ||||
|     And I press the back button in the app | ||||
|     And I press the back button in the app | ||||
|     And I press "SCORM Hidden" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     And I press "TOC" in the app | ||||
|     Then I should find "Other Scoring Systems" in the app | ||||
| 
 | ||||
|     When I press "Close" in the app | ||||
|     And I press the back button in the app | ||||
|     And I press the back button in the app | ||||
|     And I press "SCORM Drop Down" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     And I press "TOC" in the app | ||||
|     Then I should find "Other Scoring Systems" in the app | ||||
| 
 | ||||
|     When I press "Close" in the app | ||||
|     And I press the back button in the app | ||||
|     And I press the back button in the app | ||||
|     And I press "SCORM Disabled" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     And I should not be able to press "TOC" in the app | ||||
| 
 | ||||
|   Scenario: Display attempt status | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name                    | course | idnumber | packagefilepath                                               | displayattemptstatus | | ||||
|       | scorm    | SCORM no attempt status | C1     | scorm    | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 0                    | | ||||
|       | scorm    | SCORM both att status   | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 1                    | | ||||
|       | scorm    | SCORM dashb att status  | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 2                    | | ||||
|       | scorm    | SCORM entry att status  | C1     | scorm2   | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | 3                    | | ||||
|     # In the app, the attempt status is always displayed the same unless it's disabled. | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "SCORM no attempt status" in the app | ||||
|     Then I should not find "Number of attempts allowed" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press "SCORM both att status" in the app | ||||
|     Then I should find "Number of attempts allowed" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press "SCORM dashb att status" in the app | ||||
|     Then I should find "Number of attempts allowed" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I press "SCORM entry att status" in the app | ||||
|     Then I should find "Number of attempts allowed" in the app | ||||
							
								
								
									
										1020
									
								
								src/addons/mod/scorm/tests/behat/attempts_and_grading.feature
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										1020
									
								
								src/addons/mod/scorm/tests/behat/attempts_and_grading.feature
									
									
									
									
									
										Executable file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -38,7 +38,6 @@ Feature: Test basic usage of SCORM activity in app | ||||
| 
 | ||||
|     When I switch to the main frame | ||||
|     And I press the back button in the app | ||||
|     And I wait loading to finish in the app | ||||
|     Then I should find "1" within "Number of attempts you have made" "ion-item" in the app | ||||
|     And I should find "3" within "Grade reported" "ion-item" in the app | ||||
| 
 | ||||
| @ -102,7 +101,6 @@ Feature: Test basic usage of SCORM activity in app | ||||
| 
 | ||||
|     When I press "Close" in the app | ||||
|     And I press the back button in the app | ||||
|     And I wait loading to finish in the app | ||||
|     Then I should find "Completed" within "How to Play" "ion-item" in the app | ||||
|     And I should find "Completed" within "Par?" "ion-item" in the app | ||||
|     And I should find "Not attempted" within "Keeping Score" "ion-item" in the app | ||||
| @ -143,7 +141,6 @@ Feature: Test basic usage of SCORM activity in app | ||||
|     Then I should find "11 / 11" in the app | ||||
| 
 | ||||
|     When I press the back button in the app | ||||
|     And I wait loading to finish in the app | ||||
|     Then I should find "1" within "Number of attempts you have made" "ion-item" in the app | ||||
|     And I should find "9" within "Grade reported" "ion-item" in the app | ||||
| 
 | ||||
| @ -157,13 +154,94 @@ Feature: Test basic usage of SCORM activity in app | ||||
| 
 | ||||
|     When I press "Close" in the app | ||||
|     And I press the back button in the app | ||||
|     And I wait loading to finish in the app | ||||
|     Then I should find "1" within "Number of attempts you have made" "ion-item" in the app | ||||
| 
 | ||||
|   Scenario: Unsupported SCORM | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name      | course | idnumber | packagefilepath                                                    | | ||||
|       | scorm    | SCORM 1.2 | C1     | scorm2   | mod/scorm/tests/packages/RuntimeBasicCalls_SCORM20043rdEdition.zip | | ||||
|       | scorm    | SCORM 1.2 | C1     | scorm    | mod/scorm/tests/packages/RuntimeBasicCalls_SCORM20043rdEdition.zip | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "SCORM 1.2" in the app | ||||
|     Then I should find "Sorry, the application only supports SCORM 1.2." in the app | ||||
| 
 | ||||
|   Scenario: Hidden SCOs not displayed in TOC | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name          | course | idnumber | packagefilepath                           | displaycoursestructure | hidetoc | | ||||
|       | scorm    | Complex SCORM | C1     | scorm    | mod/scorm/tests/packages/complexscorm.zip | 1                      | 0       | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "Complex SCORM" in the app | ||||
|     Then I should find "The first content (one SCO)" in the app | ||||
|     But I should not find "SCO not visible" in the app | ||||
| 
 | ||||
|     When I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     And I press "TOC" in the app | ||||
|     Then I should find "The first content (one SCO)" in the app | ||||
|     But I should not find "SCO not visible" in the app | ||||
| 
 | ||||
|   Scenario: SCOs with prerequisites cannot be opened until prerequisites have been fulfilled | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name          | course | idnumber | packagefilepath                           | displaycoursestructure | hidetoc | | ||||
|       | scorm    | Complex SCORM | C1     | scorm    | mod/scorm/tests/packages/complexscorm.zip | 1                      | 0       | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "Complex SCORM" in the app | ||||
|     Then I should find "SCO with prerequisite (first and secon SCO)" in the app | ||||
| 
 | ||||
|     When I press "SCO with prerequisite (first and secon SCO)" in the app | ||||
|     Then I should be able to press "Enter" in the app | ||||
|     And I should not be able to press "Disable fullscreen" in the app | ||||
| 
 | ||||
|     When I press "The first content (one SCO)" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     And I switch to "scorm_object" iframe | ||||
|     And I click on "Common operations" "link" | ||||
|     And I click on "#set-lesson-status-button" "css_element" | ||||
|     And I click on "#ui-id-12" "css_element" | ||||
|     And I click on "#set-score-button" "css_element" | ||||
|     And I click on "#ui-id-26" "css_element" | ||||
|     And I press "Commit changes" | ||||
|     And I switch to the main frame | ||||
|     And I press "TOC" in the app | ||||
|     Then I should find "Passed" within "The first content (one SCO)" "ion-item" in the app | ||||
|     And I should not be able to press "SCO with prerequisite (first and secon SCO)" in the app | ||||
| 
 | ||||
|     When I press "The second content (one SCO too)" in the app | ||||
|     And I switch to "scorm_object" iframe | ||||
|     And I click on "Common operations" "link" | ||||
|     And I click on "#set-lesson-status-button" "css_element" | ||||
|     And I click on "#ui-id-13" "css_element" | ||||
|     And I click on "#set-score-button" "css_element" | ||||
|     And I click on "#ui-id-28" "css_element" | ||||
|     And I press "Commit changes" | ||||
|     And I switch to the main frame | ||||
|     And I press "TOC" in the app | ||||
|     Then I should find "Completed" within "The second content (one SCO too)" "ion-item" in the app | ||||
|     And I should be able to press "SCO with prerequisite (first and secon SCO)" in the app | ||||
| 
 | ||||
|   Scenario: View events are stored in the log | ||||
|     Given the following "activities" exist: | ||||
|       | activity | name        | course | idnumber | packagefilepath                                               | | ||||
|       | scorm    | Basic SCORM | C1     | scorm    | mod/scorm/tests/packages/RuntimeMinimumCalls_SCORM12-mini.zip | | ||||
|     And I entered the course "Course 1" as "student1" in the app | ||||
|     When I press "Basic SCORM" in the app | ||||
|     And I press "Enter" in the app | ||||
|     And I press "Disable fullscreen" in the app | ||||
|     Then I should find "2 / 11" in the app | ||||
| 
 | ||||
|     When I open a browser tab with url "$WWWROOT" | ||||
|     And I log in as "admin" | ||||
|     And I am on the "System logs report" page | ||||
|     And I set the field "id" to "Course 1" | ||||
|     And I set the field "user" to "Student student" | ||||
|     And I press "Get these logs" | ||||
|     Then I should see "SCORM package: Basic SCORM" in the "Course module viewed" "table_row" | ||||
|     And I should see "SCORM package: Basic SCORM" in the "Sco launched" "table_row" | ||||
|     And I should see "1" occurrences of "Sco launched" in the "reportlog" "table" | ||||
| 
 | ||||
|     When I switch back to the app | ||||
|     And I press "Next" in the app | ||||
|     Then I should find "3 / 11" in the app | ||||
| 
 | ||||
|     When I switch to the browser tab opened by the app | ||||
|     And I press "Get these logs" | ||||
|     Then I should see "2" occurrences of "Sco launched" in the "reportlog" "table" | ||||
|  | ||||
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 210 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 95 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 210 KiB | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user