定制 xi/test-selenium 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

xi/test-selenium

Composer 安装命令:

composer require xi/test-selenium

包简介

Selenium 2 bindings

README 文档

README

This is a PHP 5.3 wrapper around Selenium 2 WebDriver Server via the wire protocol.

It is useful, reasonably well-tested, cleanly built and extensible. Although it does not wrap everything yet, it can be used right now and trivially subclassed to meet any additional requirements (although a fork and a pull request would also be appreciated).

The library is quite easy to use with any test framework, but there is an inherit-and-go base class for PHPUnit.

Mini-Tutorial

Download the latest selenium-server-standalone jar and leave it running with java -jar path/to/the.jar.

Usage:

<?php
use \Xi\Test\Selenium\SeleniumServer,
    \Xi\Test\Selenium\WebDriver;

// An autoloader with the proper search paths is assumed

$server = new SeleniumServer('http://localhost:4444/wd/hub');
$browser = new WebDriver($server);
$browser->visit('/index');
$browser->findByLabel('Username')->fillIn('john');
$browser->findByLabel('Password')->fillIn('shepard');
$browser->find('form#login button[type=submit]')->click();
$browser->waitForText('Welcome john');
$browser->screenshot('after-login.png');

API documentation is available.

With PHPUnit, just extend \Xi\Test\Selenium\PHPUnit\WebDriverTestCase and use $this->browser.

These scripts may be useful:

Competitors

The following libraries aim to do what we do.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2013-04-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固