boostrap-select +硒+ phpunit

时间:2018-10-25 15:33:04

标签: php selenium phpunit

我正在尝试使用插件bootstrap-select(此处为https://developer.snapappointments.com/bootstrap-select/)测试选择。

这里的事情是,如果我禁用该插件,则一切正常。当我启用它失败。

有没有测试引导选择的教程或方法?

<?php
class BookingControllerTest extends PHPUnit_Extensions_Selenium2TestCase
{
    protected $baseUrl = 'http://localhost/bookingmytour';

protected function setUp()
{
    $this->setBrowser('chrome');
    $this->setBrowserUrl($this->baseUrl);
}


public function testBookingShow()
{
    $this->url('/');
    $this->byId('login_username')->value(ENV_NAME);
    $this->byId('login_password')->value(ENV_PASS);
    $this->byId('autenticate-button')->click();
    $this->waitUntil(function () {
        if ($this->byCssSelector('h1')) {
            return true;
        }
        return null;
    }, 10000);

    $this->byId('book')->click();

    $this->waitUntil(function () {
        if ($this->byCssSelector('h2')) {
            return true;
        }
        return null;
    }, 10000);

    $this->assertEquals($this->byCssSelector('h2')->text(),"Datos de la excursión");

    $ProductSelect = $this->byId('booking_type_excursion_id');
    $this->select($ProductSelect)->selectOptionByValue("68");
    $this->assertEquals($this->select($ProductSelect)->selectedValue(),68);

    $LanguageSelect = $this->byId('booking_spoken_language');
    $this->select($LanguageSelect)->selectOptionByValue("EN");
    $this->assertEquals($this->select($LanguageSelect)->selectedValue(),"EN");
}

protected function tearDown()
{

}
}
?>

0 个答案:

没有答案