Skip to content

Instantly share code, notes, and snippets.

@generalredneck
generalredneck / selenium.txt
Created July 17, 2012 15:52
Selenium Meetup Description sampl
Selenium: What is it good for? Absolutely Something!
Common symptoms of the need for automated testing are:
* Missed Deadlines
* Grumpy and overworked QA
* Large support Queues
Automated testing with Selenium is the first step to start relieving those symptoms and is relatively easy to get going with the most basic tests requiring just a quick run through the websites most used features with Selenium IDE.
Allan Chappell, Web Developer and Selenium Expert from AllPlayers.com will present an overview of several solutions using combinations of Selenium, PHPunit, and continuous integration software such as Hudson, to show that automated Selenium Testing can be achieved by any team, no matter how big or small.
@generalredneck
generalredneck / headless-selenium-debug
Created July 20, 2012 15:30
headless-selenium-debug
notice: /Stage[main]/Java::Package_debian/Package[java]/ensure: created
debug: /Stage[main]/Java::Package_debian/Package[java]: The container Class[Java::Package_debian] will propagate my refresh event
debug: Class[Java::Package_debian]: The container Stage[main] will propagate my refresh event
debug: Exec[10gen-apt-key](provider=posix): Executing check 'apt-key list | grep 10gen'
debug: Executing 'apt-key list | grep 10gen'
debug: Exec[mongodb_initiate_replicaset](provider=posix): Executing check 'mongo --eval 'printjson(rs.conf());' | grep 'a.achappell.allplayers.com''
debug: Executing 'mongo --eval 'printjson(rs.conf());' | grep 'a.achappell.allplayers.com''
debug: Service[mongodb](provider=debian): Executing 'sh -c LANG=C invoke-rc.d mongodb status | grep -q '^mongodb.*running''
debug: Service[headless-selenium](provider=debian): Executing '/etc/init.d/headless-selenium status'
debug: Service[headless-selenium](provider=debian): Executing '/etc/init.d/headless-selenium start'
@generalredneck
generalredneck / test.php
Created August 2, 2012 15:33
isElementPresentInIframe
public function isElementPresentInIframe($element_locator, $iframe_locator, $timeout = null) {
$this->selectFrame($iframe_locator);
if (empty($timeout) {
$this->waitForFrameToLoad();
}
else {
$this->waitForFrameToLoad($timeout);
}
return $this->isElementPresent($element_locator);
}
function waitForMail($subject) {
$lastExceptionMessage = '';
for ($second = 0; ; $second+=2) {
if ($second > 45) {
$this->fail(
"WaitFor timeout. \n"
. "Last exception message: \n" . $lastExceptionMessage
);
}
$this->clickAndWait('link=Search');
@generalredneck
generalredneck / composure.json
Created August 20, 2012 21:41
composure.json
{
"require": {
"behat/behat": "2.4@stable",
"behat/mink-extension":"*",
"behat/mink-goutte-driver":"*", "behat/mink-selenium2-driver":"*",
"pear-phpunit/PHPUnit":"3.6.11", "pear-phpunit/PHPUnit_Selenium":"1.2.7"
}, "repositories":[
{ "type":"vcs", "url":"git@github.com:AllPlayers/AllPlayers-PHP.git"
}, { "type":"pear",
"url":"pear.php.net" }, {
[17:07:46]achappell@a:~/main (behat)
$ bin/behat --tags @javascript
Feature: Register an user from the home page.
As an Anonymous user,
I need to be able to register myself as a user of AllPlayers.com
so that I can use it's functionality.
@javascript
Scenario: Successfully register a user without verification # features/user/register.feature:7
Feature: google
I want to search something on google
Scenario: Search something on google
Given I am on "/"
And I fill in "q" with "selenium"
When I press "Google Search"
And I click the first link
Then I should see "selenium"
@generalredneck
generalredneck / keepsgoing.log
Created September 11, 2012 14:59
Selenium log snipped
07:03:45.493 INFO - Command request: waitForPageToLoad[90000, ] on session be710e83a2684c4a934f8663dbe376a9
07:03:45.525 INFO - Got result: OK on session be710e83a2684c4a934f8663dbe376a9
07:03:45.529 INFO - Command request: getExpression[(typeof selenium.browserbot.getCurrentWindow().jQuery == 'undefined' || !selenium.browserbot.getCurrentWindow().jQuery.active), ] on session be710e83a2684c4a934f8663dbe376a9
07:03:45.543 INFO - Got result: OK,(typeof selenium.browserbot.getCurrentWindow().jQuery == 'undefined' || !selenium.browserbot.getCurrentWindow().jQuery.active) on session be710e83a2684c4a934f8663dbe376a9
07:03:45.546 INFO - Command request: waitForCondition[(typeof selenium.browserbot.getCurrentWindow().jQuery == 'undefined' || !selenium.browserbot.getCurrentWindow().jQuery.active), 90000] on session be710e83a2684c4a934f8663dbe376a9
07:03:45.572 INFO - Got result: OK on session be710e83a2684c4a934f8663dbe376a9
07:03:45.576 INFO - Command request: getExpression[xpath=//label[contains(text(), 'Enable regi
@generalredneck
generalredneck / products.html
Created September 18, 2012 18:39
simple test
<html>
<head>
<style>
div.product {
height:100px;
width:100px;
border: 1px solid black;
background-color:yellow;
float:left;
}
drush sql-sync --no-ordered-dump -y @demo2store @seleniumstore
You will destroy data from seleniumstore and replace with data from store.
You might want to make a backup first, using the sql-dump command.
Do you really want to continue? (y/n): y
drush @seleniumstore upwd `drush @selenium vget apci_store_user | grep -P -o "(?<=\").*(?=\")"` --password=`drush @selenium vget apci_store_pass | grep -P -o "(?<=\").*(?=\")"`
require_once(/mnt/apci/selenium-store/www/profiles/apci_store/modules/contrib/memcache/memcache.inc): failed to open stream: No such file or directory [warning]
bootstrap.inc:2297