This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Capybara Webkit focus test | |
In order to show that Capybara Webkit does not allow an element to maintain focus | |
I created this feature | |
Which anyone can try | |
@javascript | |
Scenario: Run demo page | |
When I am on the capybara demo page | |
Then I should see a successful result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def screen_shot_and_save_page | |
require 'capybara/util/save_and_open_page' | |
path = "/#{Time.now.strftime('%Y-%m-%d-%H-%M-%S')}" | |
Capybara.save_page body, "#{path}.html" | |
page.driver.render Rails.root.join "#{Capybara.save_and_open_page_path}" "#{path}.png" | |
end | |
begin | |
After do |scenario| | |
screen_shot_and_save_page if scenario.failed? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Capybara Webkit and Selenium :focus test | |
In order to show that Capybara Webkit and Selenium do not allow an element to maintain focus | |
I created this feature | |
Which anyone can try | |
@selenium | |
Scenario: Run demo page with Selenium | |
When I am on the capybara demo page | |
And I fill in "inpt" with "Test snapshot" | |
Then I should see a successful result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* JQuery tries to use native CSS selectors instead of the Sizzle selector | |
* engine for performance reasons. | |
* | |
* This causes problems when trying to test intefaces using the | |
* :focus pseudo selector as unless the web page and browser window | |
* has the focus, all elements are considered to be without focus. | |
* Checking for :focus in Selenium or Capybara tests therefore fail if | |
* using JQuery or Sizzle. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* testAsyncStepsWithPause | |
* Executes any number of async Qunit tests with a pause between each step | |
* | |
* Author: Matthew O'Riordan, http://mattheworiordan.com | |
* | |
* Params: | |
* @timeToWait: milliseconds between running method and running tests | |
* @methods: 1+ function arguments passed in the format: | |
* function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# normal Gem dependancy declarations | |
# ... | |
group :test, :cucumber do | |
gem 'pdf-reader' | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p> | |
An alert box with Hello should have displayed | |
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
## | |
# Compile script for Rails assets that puts the assets into their [environment] branch | |
# thus not polluting the master branch with the files in public/assets that only | |
# apply to that environment. See https://github.com/rails/sass-rails/issues/93#issuecomment-3982582 | |
# | |
# Usage: ./compile [environment] | |
# supported environments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> | |
# | |
# This file is part of paramiko. | |
# | |
# Paramiko is free software; you can redistribute it and/or modify it under the | |
# terms of the GNU Lesser General Public License as published by the Free | |
# Software Foundation; either version 2.1 of the License, or (at your option) | |
# any later version. | |
# | |
# Paramiko is distrubuted in the hope that it will be useful, but WITHOUT ANY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var page = require('webpage').create(), | |
system = require('system'), | |
t, address; | |
if (system.args.length === 1) { | |
console.log('Usage: loadspeed.js <some URL>'); | |
phantom.exit(); | |
} | |
t = Date.now(); |