mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
cleanup
This commit is contained in:
parent
78aae503fc
commit
a674e2123b
4 changed files with 12 additions and 42 deletions
17
.travis.yml
17
.travis.yml
|
@ -34,10 +34,12 @@ matrix:
|
|||
include:
|
||||
- gemfile: Gemfile
|
||||
rvm: 2.5.1
|
||||
env: CAPYBARA_CHROME_REMOTE=true
|
||||
env: CAPYBARA_REMOTE=true
|
||||
- gemfile: Gemfile
|
||||
rvm: 2.5.1
|
||||
env: CAPYBARA_FIREFOX_REMOTE=true
|
||||
env:
|
||||
- CAPYBARA_REMOTE=true
|
||||
- CAPYBARA_FF=true
|
||||
- gemfile: gemfiles/Gemfile.rspec-34
|
||||
rvm: 2.3.6
|
||||
env: CAPYBARA_FF=true
|
||||
|
@ -73,8 +75,6 @@ matrix:
|
|||
allow_failures:
|
||||
- gemfile: gemfiles/Gemfile.beta-versions
|
||||
- gemfile: gemfiles/Gemfile.edge-marionette
|
||||
- env: CAPYBARA_CHROME_REMOTE=true
|
||||
- env: CAPYBARA_FIREFOX_REMOTE=true
|
||||
before_install:
|
||||
- gem update --system
|
||||
- gem install bundler
|
||||
|
@ -86,7 +86,7 @@ before_install:
|
|||
bundle config local.selenium-webdriver ../selenium/build/rb;
|
||||
fi
|
||||
before_script:
|
||||
- if [[ -z $HEADLESS && -z $CAPYBARA_CHROME_REMOTE && -z $CAPYBARA_FIREFOX_REMOTE ]]; then
|
||||
- if [[ -z $HEADLESS && -z $CAPYBARA_REMOTE ]]; then
|
||||
export DISPLAY=:99.0;
|
||||
sh -e /etc/init.d/xvfb start;
|
||||
sleep 1;
|
||||
|
@ -94,8 +94,8 @@ before_script:
|
|||
echo "require('awful'); tags = {}; tags[1] = awful.tag({'name'})" > ~/.config/awesome/rc.lua;
|
||||
awesome &
|
||||
fi
|
||||
- if [[ $CAPYBARA_CHROME_REMOTE = true ]]; then
|
||||
docker-compose up -d selenium_chrome
|
||||
- if [[ $CAPYBARA_REMOTE = true ]]; then
|
||||
docker-compose up -d
|
||||
|
||||
TIMEOUT=10
|
||||
|
||||
|
@ -103,9 +103,6 @@ before_script:
|
|||
echo "Waiting for selenium server, $((TIMEOUT--)) remaining attempts...";
|
||||
sleep 1;
|
||||
done
|
||||
fi
|
||||
- if [[ $CAPYBARA_FIREFOX_REMOTE = true ]]; then
|
||||
docker-compose up -d selenium_firefox
|
||||
|
||||
TIMEOUT=10
|
||||
|
||||
|
|
8
Rakefile
8
Rakefile
|
@ -38,16 +38,16 @@ Cucumber::Rake::Task.new(:cucumber) do |task|
|
|||
end
|
||||
|
||||
task :travis do
|
||||
if ENV['CAPYBARA_FF']
|
||||
if ENV['CAPYBARA_REMOTE'] && ENV['CAPYBARA_FF']
|
||||
Rake::Task[:spec_firefox_remote].invoke
|
||||
elsif ENV['CAPYBARA_FF']
|
||||
Rake::Task[:spec_marionette].invoke
|
||||
elsif ENV['CAPYBARA_IE']
|
||||
Rake::Task[:spec_ie].invoke
|
||||
elsif ENV['CAPYBARA_EDGE']
|
||||
Rake::Task[:spec_edge].invoke
|
||||
elsif ENV['CAPYBARA_CHROME_REMOTE']
|
||||
elsif ENV['CAPYBARA_REMOTE']
|
||||
Rake::Task[:spec_chrome_remote].invoke
|
||||
elsif ENV['CAPYBARA_FIREFOX_REMOTE']
|
||||
Rake::Task[:spec_firefox_remote].invoke
|
||||
else
|
||||
Rake::Task[:spec_chrome].invoke
|
||||
end
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
version: "2.1"
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
selenium_chrome:
|
||||
|
@ -7,12 +7,10 @@ services:
|
|||
image: "selenium/${SELENIUM_IMAGE:-standalone-chrome-debug}"
|
||||
volumes:
|
||||
- "/dev/shm:/dev/shm"
|
||||
# - "${PWD}:${PWD}" # For making attach_file specs work
|
||||
selenium_firefox:
|
||||
network_mode: "host"
|
||||
image: "selenium/${SELENIUM_IMAGE:-standalone-firefox-debug}"
|
||||
volumes:
|
||||
- "/dev/shm:/dev/shm"
|
||||
# - "${PWD}:${PWD}" # For making attach_file specs work
|
||||
environment:
|
||||
- SE_OPTS=-port 4445
|
||||
|
|
|
@ -264,28 +264,6 @@ RSpec.shared_examples "Capybara::Session" do |session, mode|
|
|||
end
|
||||
end
|
||||
|
||||
# describe "#attach_file" do
|
||||
# before do
|
||||
# session.visit('/form')
|
||||
# end
|
||||
#
|
||||
# after do
|
||||
# session.driver.browser.file_detector = nil if session.driver.browser.respond_to?(:file_detector=)
|
||||
# end
|
||||
#
|
||||
# it "uploads the file when file_detector is used", :focus_ do
|
||||
# skip "Only test on remote drivers" unless session.driver.browser.respond_to?(:file_detector=)
|
||||
# session.driver.browser.file_detector = lambda do |args|
|
||||
# # args => ["/path/to/file"]
|
||||
# str = args.first.to_s
|
||||
# str if File.exist?(str)
|
||||
# end
|
||||
# session.attach_file "form_image", with_os_path_separators(__FILE__)
|
||||
# session.click_button('awesome')
|
||||
# expect(extract_results(session)['image']).to eq(File.basename(__FILE__))
|
||||
# end
|
||||
# end
|
||||
|
||||
context "Windows" do
|
||||
it "can't close the primary window" do
|
||||
expect do
|
||||
|
@ -322,7 +300,4 @@ RSpec.shared_examples "Capybara::Session" do |session, mode|
|
|||
!ENV['HEADLESS'].nil? || session.driver.options[:browser] == :remote
|
||||
end
|
||||
|
||||
def with_os_path_separators(path)
|
||||
Gem.win_platform? ? path.to_s.tr('/', '\\') : path.to_s
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue