Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 27... Línea 27...
27
 
27
 
Línea 28... Línea 28...
28
require_once(__DIR__ . '/../../../../lib/tests/behat/behat_navigation.php');
28
require_once(__DIR__ . '/../../../../lib/tests/behat/behat_navigation.php');
29
 
29
 
-
 
30
use Behat\Mink\Exception\ExpectationException as ExpectationException;
Línea 30... Línea 31...
30
use Behat\Mink\Exception\ExpectationException as ExpectationException;
31
use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
31
use Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException;
32
use Behat\Mink\Exception\DriverException as DriverException;
32
 
33
 
33
/**
34
/**
Línea 286... Línea 287...
286
     * @param array $nodelist
287
     * @param array $nodelist
287
     */
288
     */
288
    protected function select_on_administration_page($nodelist) {
289
    protected function select_on_administration_page($nodelist) {
289
        $parentnodes = $nodelist;
290
        $parentnodes = $nodelist;
290
        $lastnode = array_pop($parentnodes);
291
        $lastnode = array_pop($parentnodes);
291
        $xpath = '//section[@id=\'region-main\']';
292
        $xpath = '//div[@id=\'region-main\']';
Línea 292... Línea 293...
292
 
293
 
293
        // Check if there is a separate tab for this submenu of the page. If found go to it.
294
        // Check if there is a separate tab for this submenu of the page. If found go to it.
294
        if ($parentnodes) {
295
        if ($parentnodes) {
295
            $tabname = behat_context_helper::escape($parentnodes[0]);
296
            $tabname = behat_context_helper::escape($parentnodes[0]);
Línea 373... Línea 374...
373
    protected function toggle_page_administration_menu($menuxpath = null) {
374
    protected function toggle_page_administration_menu($menuxpath = null) {
374
        if (!$menuxpath) {
375
        if (!$menuxpath) {
375
            $menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu();
376
            $menuxpath = $this->find_header_administration_menu() ?: $this->find_page_administration_menu();
376
        }
377
        }
377
        if ($menuxpath && $this->running_javascript()) {
378
        if ($menuxpath && $this->running_javascript()) {
378
            $node = $this->find('xpath', $menuxpath . '//a[@data-toggle=\'dropdown\']');
379
            $node = $this->find('xpath', $menuxpath . '//a[@data-bs-toggle=\'dropdown\']');
379
            $this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
380
            $this->execute('behat_general::i_click_on', [$node, 'NodeElement']);
380
        }
381
        }
381
    }
382
    }
Línea 382... Línea 383...
382
 
383
 
Línea 426... Línea 427...
426
        }
427
        }
Línea 427... Línea 428...
427
 
428
 
428
        throw new ElementNotFoundException($this->getSession(),
429
        throw new ElementNotFoundException($this->getSession(),
429
            'Link "' . join(' > ', $nodelist) . '" in the current page edit menu"');
430
            'Link "' . join(' > ', $nodelist) . '" in the current page edit menu"');
-
 
431
    }
-
 
432
 
-
 
433
    #[\Override]
-
 
434
    public function menu_item_should_be_active(string $navigationmenuitem): void {
-
 
435
        throw new DriverException(
-
 
436
            'The Classic theme does not implement navigation in a way that allows this step to be used.',
-
 
437
        );
-
 
438
    }
-
 
439
 
-
 
440
    #[\Override]
-
 
441
    public function menu_item_should_not_be_active(string $navigationmenuitem): void {
-
 
442
        throw new DriverException(
-
 
443
            'The Classic theme does not implement the navigation in a way that allows this step to be used.',
-
 
444
        );
430
    }
445
    }