Skip to content

Work on updating specs (and a few useful features) #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5576e4f
Modernize dependencies.
hmdne Sep 16, 2019
fe2f803
Fix spec paths.
hmdne Sep 16, 2019
6412645
Update specs so that they don't use an "async" syntax anymore.
hmdne Sep 16, 2019
26d865b
Try to restore IE11 compatibility.
hmdne Sep 16, 2019
3079544
Fix two spec failures regarding Document#[]. Fix the same bug in
hmdne Sep 16, 2019
e399b76
Attempt to modernize travis browsers.
hmdne Sep 16, 2019
99a1ae0
Make Event::Custom specs run correctly.
hmdne Sep 16, 2019
dd5b0cf
Make Document#ready? return true when either "complete" or "interactive"
hmdne Sep 16, 2019
99116a5
Fix another minor error or two on a test page.
hmdne Sep 16, 2019
50b8941
Try to make spec/runner.rb drop some debugging info
hmdne Sep 16, 2019
c6c6bce
Replace BrowserStackTunnel.jar with new codebase
hmdne Sep 16, 2019
4f6986f
Try replacing BrowserStackTunnel again
hmdne Sep 16, 2019
bb6371c
Try to get more debugging information from BrowserStackLocal
hmdne Sep 16, 2019
8dcc28f
Exit with error if reached "No retries left" with runner.rb
hmdne Sep 16, 2019
d601529
Fix another JS::Error assumption, this time in Element#search
hmdne Sep 18, 2019
1478db2
Implement Event::Target#one. It's like #on, but fires just once.
hmdne Sep 18, 2019
9f425a8
Implement jQuery-like animation methods, but using CSS transitions.
hmdne Sep 18, 2019
5d726e2
Update the files as per @elia's suggestions
hmdne Sep 20, 2019
eb71c0f
Fixup. Restore original behaviour
hmdne Sep 20, 2019
4f5d772
browser/effects: Move instance variables from container to DOM.
hmdne Sep 21, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 22 additions & 25 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: ruby
rvm: 2.0.0
rvm: 2.3.0
cache: bundler
sudo: false

Expand All @@ -14,49 +14,46 @@ env:
- secure: "T7RSwd/aIYwsbuoyLPLzB0ZwOATDAFrpi9GQSVIbV1rZV2oGq+yisjeARUPyRfKTI0Q08CNgarLWfL/kONR6AL19XUD3Rm1+hag8bNixRYot2c65We6d40BMtPfZyO13kSWlTtDnzotYavhXoXujJNLfSjbdLdTlmy2m9Q0UfQc="

matrix:
- SELENIUM_BROWSER=firefox SELENIUM_VERSION=25
- SELENIUM_BROWSER=firefox SELENIUM_VERSION=26
- SELENIUM_BROWSER=firefox SELENIUM_VERSION=68
- SELENIUM_BROWSER=firefox SELENIUM_VERSION=69

- SELENIUM_BROWSER=opera SELENIUM_VERSION=12.15
- SELENIUM_BROWSER=opera SELENIUM_VERSION=12.16

- SELENIUM_BROWSER=opera SELENIUM_VERSION=62
- SELENIUM_BROWSER=opera SELENIUM_VERSION=63

- SELENIUM_BROWSER=ie SELENIUM_VERSION=6
- SELENIUM_BROWSER=ie SELENIUM_VERSION=7
- SELENIUM_BROWSER=ie SELENIUM_VERSION=8
- SELENIUM_BROWSER=ie SELENIUM_VERSION=9
- SELENIUM_BROWSER=ie SELENIUM_VERSION=10
- SELENIUM_BROWSER=ie SELENIUM_VERSION=11

- SELENIUM_BROWSER=edge SELENIUM_VERSION=17
- SELENIUM_BROWSER=edge SELENIUM_VERSION=18

- SELENIUM_BROWSER=safari SELENIUM_VERSION=5.1
- SELENIUM_BROWSER=safari SELENIUM_VERSION=6.1
- SELENIUM_BROWSER=safari SELENIUM_VERSION=7.0
- SELENIUM_BROWSER=safari SELENIUM_VERSION=8.0
- SELENIUM_BROWSER=safari SELENIUM_VERSION=10.1
- SELENIUM_BROWSER=safari SELENIUM_VERSION=12.1

- SELENIUM_BROWSER=ipad SELENIUM_DEVICE="iPad 2 (5.0)"
- SELENIUM_BROWSER=iphone SELENIUM_DEVICE="iPhone 4S"
- SELENIUM_BROWSER=iphone SELENIUM_DEVICE="iPhone 5"
- SELENIUM_BROWSER=ipad SELENIUM_DEVICE="iPad 6th"
- SELENIUM_BROWSER=iphone SELENIUM_DEVICE="iPhone 5S"
- SELENIUM_BROWSER=iphone SELENIUM_DEVICE="iPhone 7"
- SELENIUM_BROWSER=iphone SELENIUM_DEVICE="iPhone 8"

- SELENIUM_BROWSER=android SELENIUM_DEVICE="Samsung Galaxy Nexus"
- SELENIUM_BROWSER=android SELENIUM_DEVICE="Motorola Razr Maxx HD"
- SELENIUM_BROWSER=android SELENIUM_DEVICE="LG Nexus 4"

- SELENIUM_BROWSER=chrome SELENIUM_VERSION=30
- SELENIUM_BROWSER=chrome SELENIUM_VERSION=31

matrix:
allow_failures:
# ChromeDriver be broken
- env: SELENIUM_BROWSER=chrome SELENIUM_VERSION=31
- env: SELENIUM_BROWSER=chrome SELENIUM_VERSION=30
- SELENIUM_BROWSER=android SELENIUM_DEVICE="Samsung Galaxy S10e"
- SELENIUM_BROWSER=android SELENIUM_DEVICE="OnePlus 6T"
- SELENIUM_BROWSER=android SELENIUM_DEVICE="Samsung Galaxy Tab S4"

# Something's fishy
- env: SELENIUM_BROWSER=ipad SELENIUM_DEVICE="iPad 2 (5.0)"
- env: SELENIUM_BROWSER=iphone SELENIUM_DEVICE="iPhone 5"
- SELENIUM_BROWSER=chrome SELENIUM_VERSION=75
- SELENIUM_BROWSER=chrome SELENIUM_VERSION=76

# Android's driver be broken
- env: SELENIUM_BROWSER=android SELENIUM_DEVICE="Samsung Galaxy Nexus"
- env: SELENIUM_BROWSER=android SELENIUM_DEVICE="Motorola Razr Maxx HD"
- env: SELENIUM_BROWSER=android SELENIUM_DEVICE="LG Nexus 4"
#matrix:
# allow_failures:

before_install:
- gem update bundler
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ gem 'rake'
gem 'rack'
gem 'sinatra'
gem 'sinatra-websocket'
gem 'opal-rspec', '~> 0.4.3'
gem 'opal-rspec', '>= 0.8.0.alpha1'
gem 'opal-sprockets'

# runner
gem 'selenium-webdriver', require: false
gem 'rest-client', require: false

# browser
gem 'opal', '~> 0.8.0'
gem 'opal', ['>= 1.0', '< 2.0']
gem 'paggio', github: 'meh/paggio'
5 changes: 4 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@ require 'bundler'
Bundler.require

require 'opal/rspec/rake_task'
Opal::RSpec::RakeTask.new(:default)
Opal::RSpec::RakeTask.new(:default) do |_, task|
task.default_path = 'spec'
task.pattern = 'spec/**/*_spec.{rb,opal}'
end
10 changes: 8 additions & 2 deletions config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ require 'bundler'
Bundler.require

apps = []
apps << Opal::Server.new { |s|
s.append_path 'spec'

sprockets_env = Opal::RSpec::SprocketsEnvironment.new(spec_pattern = 'spec/**/*_spec.{rb,opal}',
spec_exclude_pattern = nil,
spec_files = nil,
default_path = 'spec')

apps << Opal::Sprockets::Server.new(sprockets: sprockets_env) { |s|
s.main = 'opal/rspec/sprockets_runner'
s.append_path 'spec'
s.index_path = 'index.html.erb'
s.debug = false
}
Expand Down
2 changes: 1 addition & 1 deletion opal-browser.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ Gem::Specification.new {|s|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.require_paths = ['lib']

s.add_dependency 'opal'
s.add_dependency 'opal', ['>= 1.0', '< 2.0']
s.add_dependency 'paggio'
}
2 changes: 1 addition & 1 deletion opal/browser/dom/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def ready(&block)

# Check if the document is ready.
def ready?
`#@native.readyState === "complete"`
`#@native.readyState === "complete" || #@native.readyState === "interactive"`
end

# @!attribute root
Expand Down
14 changes: 9 additions & 5 deletions opal/browser/dom/element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ def self.new(node)
include Event::Target

target {|value|
DOM(value) rescue nil
begin
DOM(value)
rescue StandardError, JS::Error
nil
end
}

if Browser.supports? 'Element.matches'
Expand Down Expand Up @@ -125,7 +129,7 @@ def add_class(*names)
#
# @return [Node?]
def at(path_or_selector)
xpath(path_or_selector).first || css(path_or_selector).first
xpath(path_or_selector).first || css(path_or_selector).first
end

# Get the first node matching the given CSS selectors.
Expand Down Expand Up @@ -191,13 +195,13 @@ def class_names
if Browser.supports? 'Query.css'
def css(path)
NodeSet[Native::Array.new(`#@native.querySelectorAll(path)`)]
rescue
rescue StandardError, JS::Error
NodeSet[]
end
elsif Browser.loaded? 'Sizzle'
def css(path)
NodeSet[`Sizzle(path, #@native)`]
rescue
rescue StandardError, JS::Error
NodeSet[]
end
else
Expand Down Expand Up @@ -457,7 +461,7 @@ def xpath(path)
#@native, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null)`,
get: :snapshotItem,
length: :snapshotLength)]
rescue
rescue StandardError, JS::Error
NodeSet[]
end
else
Expand Down
Loading