Skip to content

Instantly share code, notes, and snippets.

@kallepersson
Created January 9, 2013 19:36
Show Gist options
  • Save kallepersson/4496119 to your computer and use it in GitHub Desktop.
Save kallepersson/4496119 to your computer and use it in GitHub Desktop.
<?php
Yii::import( 'ext.webdriver-bindings.CWebDriverTestCase' );
class ExampleTest extends CWebDriverTestCase {
public function testGoogle() {
$this->get( 'http://www.google.com/' );
$qElem = $this->findElementBy( LocatorStrategy::name, 'q' );
$this->assertNotNull( $qElem, 'There is no "query" element!' );
$qElem->sendKeys( array( 'yii framework' ) );
$qElem->submit();
sleep( 1 );
$elem = $this->findElementBy( LocatorStrategy::className, 'vsc' );
$this->assertNotNull( $elem, 'Results not found!' );
$this->assertTrue( $this->isTextPresent( 'Yii Framework' ), 'The is no "Yii Framework" text on result page!' );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment