承接 cargomedia/webnavigator 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cargomedia/webnavigator

最新稳定版本:0.1.2

Composer 安装命令:

composer require cargomedia/webnavigator

包简介

README 文档

README

This project is not maintained anymore. If you want to take over contact us at tech@cargomedia.ch.

webnavigator Build Status

Wrapper for facebook/php-webdriver for simple automated acceptance tests.

PhantomJS

WebNavigator can connect to the WebDriver server of PhantomJS. Start PhantomJS in a console like this:

phantomjs --webdriver=4444 --ssl-protocol=tlsv1 --ignore-ssl-errors=true

Example

Setting up a WebNavigator instance in a PHPUnit test case and doing some basic tests:

class MyTest extends \PHPUnit_Framework_TestCase {

    /** @var \WebNavigator\Navigator */
    private $_navigator;

    protected function setUp() {
        $capabilities = new \DesiredCapabilities([\WebDriverCapabilityType::BROWSER_NAME => 'phantomjs']);
        $driver = \RemoteWebDriver::create('http://localhost:4444/wd/hub', $capabilities);
        $this->_navigator = new \WebNavigator\Navigator($driver, 'https://www.denkmal.org');
    }

    protected function tearDown() {
        $this->_navigator->quit();
    }

    public function testAddPage() {
        $this->_navigator->get('/events');

        $this->_navigator->click('.addButton a');
        $this->_navigator->waitForElement('.Denkmal_Page_Add');
        $this->assertContains('Event hinzufügen', $this->_navigator->getText('h1'));
        $this->assertContains('/add', $this->_navigator->getUrl());

        $this->_navigator->takeScreenshot('screenshot.png');
    }
}

Development

Install dependencies:

composer install

Before running tests make sure you have phantomjs and a web server running:

phantomjs --webdriver=4444 &
php -S localhost:1234 -t tests/data/ &

Then run the tests:

php vendor/bin/phpunit

统计信息

  • 总下载量: 37
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 6
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-03