File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -237,13 +237,21 @@ public function i_load_more_items_in_the_app(bool $not = false) {
237237 /**
238238 * Trigger swipe gesture.
239239 *
240- * @When /^I swipe to the (left|right) in the app$/
240+ * @When /^I swipe to the (left|right) (in (".+") )? in the app$/
241241 * @param string $direction Swipe direction
242+ * @param bool $hasLocator Whether a reference locator is used.
243+ * @param string $locator Reference locator.
242244 */
243- public function i_swipe_in_the_app (string $ direction ) {
244- $ method = 'swipe ' . ucwords ($ direction );
245+ public function i_swipe_in_the_app (string $ direction , bool $ hasLocator = false , string $ locator = '' ) {
246+ if ($ hasLocator ) {
247+ $ locator = $ this ->parse_element_locator ($ locator );
248+ }
249+
250+ $ result = $ this ->zone_js ("swipe(' $ direction' " . ($ hasLocator ? ", $ locator " : '' ) . ') ' );
245251
246- $ this ->zone_js ("getAngularInstance('ion-content', 'CoreSwipeNavigationDirective'). $ method() " );
252+ if ($ result !== 'OK ' ) {
253+ throw new DriverException ('Error when swiping - ' . $ result );
254+ }
247255
248256 $ this ->wait_for_pending_js ();
249257
Original file line number Diff line number Diff line change 66
77defined ('MOODLE_INTERNAL ' ) || die;
88
9- $ plugin ->version = 2023012400 ;
9+ $ plugin ->version = 2023020800 ;
1010$ plugin ->requires = 2016052300 ;
1111$ plugin ->maturity = MATURITY_STABLE ;
1212$ plugin ->release = '4.1.0 ' ;
You can’t perform that action at this time.
0 commit comments