Changeset 41a81c6 in iPeer


Ignore:
Timestamp:
2014-03-02T01:03:01-08:00 (3 years ago)
Author:
Compass <pan.luo@…>
Branches:
dev
Children:
ce79679
Parents:
9de9a8a
git-author:
Compass <pan.luo@…> (03/02/2014 01:02:26 AM)
git-committer:
Compass <pan.luo@…> (03/02/2014 01:03:01 AM)
Message:

Add sausage submodule and additional info for tests

Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • .gitmodules

    r9de9a8a r41a81c6  
    4141        path = vendors/webdriver
    4242        url = https://github.com/Element-34/php-webdriver.git
     43[submodule "vendors/sausage"]
     44        path = vendors/sausage
     45        url = https://github.com/jlipps/sausage.git
  • app/tests/cases/system/SystemWebDriver.php

    r9de9a8a r41a81c6  
    55/**
    66 * SystemWebDriver This class is a duplication of WebDriver class in order to return a custom session object, which extends a few methods based on WebDriverSession class
     7 * This class also stores session id in SystemWebDriverSession
    78 *
    89 * @uses PHPWebDriver_WebDriver
     
    4041                $curl_opts);
    4142
    42         return new SystemWebDriverSession($results['info']['url'].$results['sessionId']);
     43        $session = new SystemWebDriverSession($results['info']['url'].$results['sessionId']);
     44        $session->id = $results['sessionId'];
     45
     46        return $session;
    4347    }
    4448}
  • app/tests/cases/system/SystemWebDriverSession.php

    r9de9a8a r41a81c6  
    55
    66class SystemWebDriverSession extends PHPWebDriver_WebDriverSession {
     7    protected $id;
     8
    79    public function elementWithWait($using, $value) {
    810        $selector = array('selector' => $using, 'value' => $value);
  • app/tests/cases/system/add_course.test.php

    r9de9a8a r41a81c6  
    1111        $login = PageFactory::initElements($this->session, 'Login');
    1212        $home = $login->login('root', 'ipeeripeer');
    13     }
    14 
    15     public function endCase()
    16     {
    17         $this->getSession()->deleteAllCookies();
    18         $this->getSession()->close();
    1913    }
    2014
  • app/tests/cases/system/system_base.php

    r9de9a8a r41a81c6  
    77require_once(VENDORS.'webdriver/PHPWebDriver/WebDriverKeys.php');
    88require_once(VENDORS.'webdriver/PHPWebDriver/WebDriverSession.php');
     9require_once(VENDORS.'sausage/src/Sauce/Sausage/SauceConfig.php');
     10require_once(VENDORS.'sausage/src/Sauce/Sausage/SauceAPI.php');
     11require_once(VENDORS.'sausage/src/Sauce/Sausage/SauceMethods.php');
     12require_once(VENDORS.'sausage/src/Sauce/Sausage/SauceTestCommon.php');
    913require_once('PageFactory.php');
    1014
     
    2731        $this->browser = getenv('SELENIUM_BROWSER') ? getenv('SELENIUM_BROWSER') : 'firefox';
    2832        $this->capabilities['name'] = get_class($this);
     33        $this->capabilities['build'] = getenv('BUILD_NUMBER');
    2934        $this->capabilities['platform'] = getenv('SELENIUM_PLATFORM') ? getenv('SELENIUM_PLATFORM') : 'ANY';
    3035        $this->capabilities['version'] = getenv('SELENIUM_VERSION') ? getenv('SELENIUM_VERSION') : '';
     36
     37        // get the repo info
     38        $release = `git describe --tags`;
     39        if (!$release) {
     40            $release = "Unknown";
     41        }
     42        $branch = `git rev-parse --abbrev-ref HEAD`;
     43        if (!$branch) {
     44            $branch = "Unknown";
     45        }
     46        $commit = `git describe --tags --always`;
     47        if (!$commit) {
     48            $commit = "Unknown";
     49        }
     50        $this->capabilities['custom-data'] = array('release' => $release, 'commit' => $commit, 'branch' => $branch);
     51
    3152        $host = getenv('SELENIUM_HOST') ? getenv('SELENIUM_HOST') : 'localhost';
    3253        $port = getenv('SELENIUM_PORT') ? getenv('SELENIUM_PORT') : '4444';
     
    98119        echo 'Ending method ' . $method . "\n";
    99120    }
     121
     122    public function endCase()
     123    {
     124        SauceTestCommon::ReportStatus($this->getSession()->id, $reporter->getStatus());
     125        $this->getSession()->deleteAllCookies();
     126        $this->getSession()->close();
     127    }
    100128}
Note: See TracChangeset for help on using the changeset viewer.