PHP 클래스 VersionPress\Tests\Selenium\SeleniumTestCase

상속: extends PHPUnit_Extensions_Selenium2TestCas\PHPUnit_Extensions_Selenium2TestCase
파일 보기 프로젝트 열기: versionpress/versionpress 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$autologin boolean If true, {@link loginIfNecessary} is called on {@link setUpSite}.
$gitRepository VersionPress\Git\GitRepository
$testConfig VersionPress\Tests\Utils\TestConfig
$wpAdminPath string
$wpAutomation VersionPress\Tests\Automation\WpAutomation

공개 메소드들

메소드 설명
__construct ( $name = null, array $data = [], $dataName = '' )
setUpBeforeClass ( )
setUpPage ( )
setUpSite ( boolean $force ) Check if site is set up and VersionPress fully activated, and if not, do so. The $force parametr may force this.

보호된 메소드들

메소드 설명
assertElementExists ( string $cssSelector ) Asserts that element exists.
elementExists ( $cssSelector )
executeScript ( string $code ) : string Small wrapper aroung built-in execute() method
jsClick ( string $cssSelector ) Selenium cannot click on hidden things, JavaScript can. Use this method instead of `$this->byCssSelector('.
jsClickAndWait ( string $cssSelector ) Uses {@link jsClick} and waits for AJAX request.
logOut ( )
loginIfNecessary ( )
setTinyMCEContent ( string $text ) Types text into TinyMCE. Can be plain text or contain HTML tags.
setValue ( $cssSelector, $value ) The built-in $element->value('xyz') method only appends to an existing value, this method overwrites the whole field.
waitAfterRedirect ( integer $timeout = 5000 ) If there is a redirect after POST (Post/Redirect/Get pattern) you have wait for the shutdown function that creates a commit - the commit may take longer time then rendering new page.
waitForAjax ( ) Wait for all AJAX requests caused by jQuery are done.
waitForElement ( string $cssSelector, integer $timeout = 3000 ) Explicitly wait for the element identified by $cssSelector to appear on the screen (throws assertion error if this element doesn't appear). Note that default Selenium methods have this behavior built-in so you typically only need to call this method at the end of the test method, before the assertions are run (it prevents them from running too soon).
waitUntilTrue ( $callback, $timeout = null ) Selenium API improvement. Wait until callback is true or timeout occurs.

비공개 메소드들

메소드 설명
staticInitialization ( ) Makes sure some static properties are initialized. Called from constructor and from static methods that might run before it.

메소드 상세

__construct() 공개 메소드

public __construct ( $name = null, array $data = [], $dataName = '' )
$data array

assertElementExists() 보호된 메소드

Asserts that element exists.
protected assertElementExists ( string $cssSelector )
$cssSelector string

elementExists() 보호된 메소드

protected elementExists ( $cssSelector )

executeScript() 보호된 메소드

Small wrapper aroung built-in execute() method
protected executeScript ( string $code ) : string
$code string JavaScript code
리턴 string JS result, if any

jsClick() 보호된 메소드

..')->click()` if you need to.
protected jsClick ( string $cssSelector )
$cssSelector string

jsClickAndWait() 보호된 메소드

Uses {@link jsClick} and waits for AJAX request.
protected jsClickAndWait ( string $cssSelector )
$cssSelector string

logOut() 보호된 메소드

protected logOut ( )

loginIfNecessary() 보호된 메소드

protected loginIfNecessary ( )

setTinyMCEContent() 보호된 메소드

Types text into TinyMCE. Can be plain text or contain HTML tags.
protected setTinyMCEContent ( string $text )
$text string

setUpBeforeClass() 공개 정적인 메소드

public static setUpBeforeClass ( )

setUpPage() 공개 메소드

public setUpPage ( )

setUpSite() 공개 정적인 메소드

Check if site is set up and VersionPress fully activated, and if not, do so. The $force parametr may force this.
public static setUpSite ( boolean $force )
$force boolean Force all the automation actions to be taken regardless of the site state

setValue() 보호된 메소드

The built-in $element->value('xyz') method only appends to an existing value, this method overwrites the whole field.
protected setValue ( $cssSelector, $value )
$cssSelector
$value

waitAfterRedirect() 보호된 메소드

If there is a redirect after POST (Post/Redirect/Get pattern) you have wait for the shutdown function that creates a commit - the commit may take longer time then rendering new page.
protected waitAfterRedirect ( integer $timeout = 5000 )
$timeout integer Milliseconds

waitForAjax() 보호된 메소드

Wait for all AJAX requests caused by jQuery are done.
protected waitForAjax ( )

waitForElement() 보호된 메소드

(This is just a friendly name / facade to the built-in waiting mechanism. Doing something like $el = $this->byCssSelector(..) has the same effect but would look a bit odd.)
protected waitForElement ( string $cssSelector, integer $timeout = 3000 )
$cssSelector string
$timeout integer Timeout in milliseconds. Default: 3 seconds.

waitUntilTrue() 보호된 메소드

Selenium API improvement. Wait until callback is true or timeout occurs.
protected waitUntilTrue ( $callback, $timeout = null )
$callback
$timeout

프로퍼티 상세

$autologin 보호되어 있는 정적으로 프로퍼티

If true, {@link loginIfNecessary} is called on {@link setUpSite}.
protected static bool $autologin
리턴 boolean

$gitRepository 보호되어 있는 프로퍼티

protected GitRepository,VersionPress\Git $gitRepository
리턴 VersionPress\Git\GitRepository

$testConfig 보호되어 있는 정적으로 프로퍼티

protected static TestConfig,VersionPress\Tests\Utils $testConfig
리턴 VersionPress\Tests\Utils\TestConfig

$wpAdminPath 보호되어 있는 정적으로 프로퍼티

protected static string $wpAdminPath
리턴 string

$wpAutomation 보호되어 있는 정적으로 프로퍼티

protected static WpAutomation,VersionPress\Tests\Automation $wpAutomation
리턴 VersionPress\Tests\Automation\WpAutomation