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
require 'capybara' | |
require 'benchmark' | |
html = DATA.read | |
$app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
def benchmark_average | |
sum = 0 | |
session = Capybara::Session.new(:selenium, $app) |
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
require 'capybara' | |
require 'benchmark' | |
[ | |
'http://www.stackoverflow.com', | |
'http://www.google.com', | |
'http://www.facebook.com', | |
'http://www.github.com', | |
].each do |url| | |
sess = Capybara::Session.new(:selenium) |
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
require 'capybara' | |
require 'benchmark' | |
html = DATA.read | |
$app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
session = Capybara::Session.new(:selenium, $app) | |
session.visit("/") | |
puts "Capybara text: #{session.all('div').map { |el| el.text.codepoints }}" # => [[97, 32, 98], [97, 32, 98], [97, 32, 98]] |
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
require 'capybara' | |
require 'benchmark' | |
html = DATA.read | |
$app = proc { |env| [200, { "Content-Type" => "text/xml" }, [html] ] } | |
session = Capybara::Session.new(:selenium, $app) | |
session.visit("/") | |
puts "Capybara text: #{session.all('div').map { |el| el.text.codepoints }}" # => [[97, 32, 98], [97, 32, 98], [97, 32, 98]] |
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: Autoreply to mail | |
In order to say that I'm not able to respond to emails | |
I want to be able to setup autoreply | |
Background: | |
Given I am logged in | |
And another user exists | |
Scenario: System sends autoreply when autoreply is enabled | |
Given I have autoreply enabled |
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
class User | |
attr_accessor :name, :password | |
def initialize new = {} | |
hash = {:name => "name", :password => "password"} | |
hash.merge! new | |
hash.each {|name, value| instance_variable_set("@#{name}", value)} | |
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
class Email | |
attr_accessor :recipients, :subject, :body | |
def initialize(options = {}) | |
hash = {recipients: %w(localpart@site.com), subject: 'Subject', body: 'Body'} | |
hash.merge!(options) | |
hash.each {|name, value| instance_variable_set("@#{name}", value)} | |
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
require 'capybara/cucumber' | |
require 'rspec' | |
require_relative 'user' | |
scheme = 'https' | |
$domain_name = 'testwww.confidesk.com' | |
$user = User.new(username: 'user31', password: 'user31') | |
$user2 = User.new(username: 'user41', password: 'user41') |
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
[:!, :!=, :!~, :<, :<=, :<=>, :==, :===, :=~, :>, :>=, :__id__, :__send__, :acts_like?, :add_selector, | |
:alias_attribute, :alias_method_chain, :all, :ancestors, :anonymous?, :app, :app=, :app_host, :app_host=, :as_json, :asset_root, :asset_root=, :attac | |
h_file, :autoload, :autoload?, :automatic_reload, :automatic_reload=, :blank?, :body, :capture, :check, :choose, :class, :class_eval, :class_exec, :cl | |
ass_variable_defined?, :class_variable_get, :class_variable_set, :class_variables, :click_button, :click_link, :click_link_or_button, :click_on, :clon | |
e, :configure, :const_defined?, :const_get, :const_missing, :const_set, :constants, :cucumber_instance_exec, :current_driver, :current_driver=, :curre | |
nt_host, :current_path, :current_session, :current_url, :default_driver, :default_driver=, :default_host, :default_host=, :default_selector, :default_ | |
selector=, :default_wait_time, :default_wait_time=, :define_singleton_method, :delegate, :deprecate, :display, :drivers, :dup, :duplicable?, :enable_w | |
arnings, :enum_ |
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
There are a lot of posts at SO that have link http://particletree.com/features/rediscovering-the-button-element/. (https://www.google.com/search?q=site%3Astackoverflow.com%2Fquestions+http%3A%2F%2Fparticletree.com%2Ffeatures%2Frediscovering-the-button-element%2F). | |
Link is obsolete so it should be fixed to http://web.archive.org/web/20110721191046/http://particletree.com/features/rediscovering-the-button-element/ | |
But number of such posts is quite large so I think fixing all of them myself can be considered unfair. I think all those links should be edited automatically NOT by the user of site, e.g. by Community user. |
OlderNewer