Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Helper.php « selenium « test - github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 81a6f11d14fb30db3007f4cefb93e81f0682fa0e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Selenium Helper Class
 *
 * @package    PhpMyAdmin-test
 * @subpackage Selenium
 */
require_once 'TestConfig.php';

class Helper
{
    public static $selenium;
    public static $config;

    function __construct()
    {
        self::$config = new TestConfig();
    }

    public static function isLoggedIn($selenium)
    {
        return $selenium->isElementPresent('//*[@id="serverinfo"]/a[1]');
    }

    public static function logOutIfLoggedIn($selenium)
    {
        if (self::isLoggedIn($selenium)) {
            $selenium->selectFrame("frame_navigation");
            $selenium->clickAndWait("css=img.icon.ic_b_home");
        }
    }

    public static function getBrowserString() {
        $browserString = self::$config->getCurrentBrowser();
        return $browserString;
    }
}
?>