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
from xdist.scheduler import LoadScopeScheduling | |
def pytest_xdist_make_scheduler(config, log): | |
return LoadScopeScheduling(config, log) |
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
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' | |
[ | |
'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] ] } | |
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 'selenium-webdriver' | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
Capybara.register_driver :chrome do |app| | |
caps = Selenium::WebDriver::Remote::Capabilities.chrome("chromeOptions" => {"args" => [ "start-maximized" ]}) | |
Capybara::Selenium::Driver.new(app, {:browser => :chrome, :desired_capabilities => caps}) | |
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" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
sleep 1 # Just to verify that file isn't chosen | |
sess.attach_file('file_upload', '/tmp/temp.txt') | |
sleep 1 # Just to verify that file is chosen |
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' | |
class Capybara::Selenium::Driver | |
def browser | |
unless @browser | |
@browser = Selenium::WebDriver.for(options[:browser], options.reject { |key,val| SPECIAL_OPTIONS.include?(key) }) | |
end | |
@browser | |
end | |
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" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
class Capybara::Selenium::Driver | |
def browser | |
unless @browser | |
@browser = Selenium::WebDriver.for(options[:browser], options.reject { |key,val| SPECIAL_OPTIONS.include?(key) }) | |
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" | |
html = DATA.read | |
app = proc { |env| [200, { "Content-Type" => "text/html" }, [html] ] } | |
sess = Capybara::Session.new(:selenium, app) | |
sess.visit("/") | |
sess.find(:xpath,"//a[contains(text(),'Foo')]").click # Element looks like clicked after that | |
sleep 3 |
NewerOlder