Пример #1
0
 public function testAmOnPage()
 {
     $this->module->amOnPage('/');
     $this->module->see('Welcome to test app!');
     $this->module->_cleanup();
     $this->module->amOnPage('/info');
     $this->module->see('Information');
 }
Пример #2
0
 protected function setUp()
 {
     $this->module = new \Codeception\Module\PhpBrowser();
     $url = 'http://localhost:8000';
     $this->module->_setConfig(array('url' => $url));
     $this->module->_initialize();
     $this->module->_cleanup();
     $this->module->_before($this->makeTest());
     $this->history = new \GuzzleHttp\Subscriber\History();
     $this->module->guzzle->getEmitter()->attach($this->history);
 }
Пример #3
0
    protected function setUp() {
        $this->noPhpWebserver();
        $this->module = new \Codeception\Module\PhpBrowser();
        $url = '';
        if (version_compare(PHP_VERSION, '5.4', '>=')) $url = 'http://localhost:8000';
        // my local config.
        if ($this->is_local) $url = 'http://testapp.com';

        $this->module->_setConfig(array('url' => $url));
        $this->module->_initialize();
        $this->module->_cleanup();
        $this->module->_before($this->makeTest());
    }
Пример #4
0
 protected function setUp()
 {
     $this->module = new \Codeception\Module\PhpBrowser(make_container());
     $url = 'http://localhost:8000';
     $this->module->_setConfig(array('url' => $url));
     $this->module->_initialize();
     $this->module->_cleanup();
     $this->module->_before($this->makeTest());
     if (class_exists('GuzzleHttp\\Url')) {
         $this->history = new \GuzzleHttp\Subscriber\History();
         $this->module->guzzle->getEmitter()->attach($this->history);
     } else {
         $this->module->guzzle->getConfig('handler')->push(\GuzzleHttp\Middleware::history($this->history));
     }
 }
Пример #5
0
 public function testLoginToFacebook()
 {
     $this->markTestSkipped();
     // preconditions: #1 php web server being run
     $browserModule = new PhpBrowser();
     $browserModule->_setConfig(array('url' => 'http://localhost:8000'));
     $browserModule->_initialize();
     $browserModule->_cleanup();
     $browserModule->_before($this->makeTest());
     SuiteManager::$modules['PhpBrowser'] = $browserModule;
     // preconditions: #2 facebook test user was created
     $this->module->haveFacebookTestUserAccount();
     $testUserFirstName = $this->module->grabFacebookTestUserFirstName();
     // preconditions: #3 test user logged in on facebook
     $this->module->haveTestUserLoggedInOnFacebook();
     // go to our page with facebook login button
     $browserModule->amOnPage('/facebook');
     // check that yet we are not logged in with facebook
     $browserModule->see('You are not Connected.');
     // click on "Login with Facebook" button to start login with facebook
     $browserModule->click('Login with Facebook');
     // check that we are logged in with facebook
     $browserModule->see('Your User Object (/me)');
     $browserModule->see($testUserFirstName);
     // cleanup
     unset(SuiteManager::$modules['PhpBrowser']);
     $browserModule->_after($this->makeTest());
     data::clean();
 }
Пример #6
0
 public function setUp()
 {
     $this->noPhpWebserver();
     $this->module = new \Codeception\Module\PhpBrowser();
     $url = '';
     if (strpos(PHP_VERSION, '5.4') === 0) {
         $url = 'http://localhost:8000';
     }
     // my local config.
     if ($this->is_local) {
         $url = 'http://testapp.com';
     }
     $this->module->_setConfig(array('url' => $url));
     $this->module->_initialize();
     $this->module->_cleanup();
     $this->module->_before($this->makeTest());
 }
Пример #7
0
 private function initModule(PhpBrowser $browserModule, array $params)
 {
     $browserModule->_setConfig($params);
     $browserModule->_initialize();
     $browserModule->_cleanup();
     $browserModule->_before($this->makeTest());
 }