File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,6 @@ class behat_app extends behat_app_helper {
4545 ];
4646
4747 protected $ featurepath = '' ;
48- protected $ windowsize = '360x720 ' ;
4948
5049 /**
5150 * @BeforeScenario
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ protected function prepare_browser(array $options = []) {
201201 $ restart = true ;
202202
203203 // Reset its size.
204- $ this ->resize_window ( $ this -> windowsize , true );
204+ $ this ->resize_app_window ( );
205205
206206 // Visit the Ionic URL.
207207 $ this ->getSession ()->visit ($ this ->get_app_url ());
@@ -596,4 +596,18 @@ protected function get_first_restricted_version_tag(): ?string {
596596
597597 return null ;
598598 }
599+
600+ /**
601+ * Resize window to have app dimensions.
602+ */
603+ protected function resize_app_window () {
604+ $ width = 500 ;
605+ $ height = 720 ;
606+ $ offset = $ this ->evaluate_script ("{
607+ x: window.outerWidth - document.body.offsetWidth,
608+ y: window.outerHeight - window.innerHeight,
609+ } " );
610+
611+ $ this ->getSession ()->getDriver ()->resizeWindow ($ width + $ offset ['x ' ], $ height + $ offset ['y ' ]);
612+ }
599613}
Original file line number Diff line number Diff line change 66
77defined ('MOODLE_INTERNAL ' ) || die;
88
9- $ plugin ->version = 2023041900 ;
9+ $ plugin ->version = 2023051100 ;
1010$ plugin ->requires = 2016052300 ;
1111$ plugin ->maturity = MATURITY_STABLE ;
1212$ plugin ->release = '4.2.0 ' ;
You can’t perform that action at this time.
0 commit comments