appium_capybara 1.8.0 → 1.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d93a4df9821c40f409585aeb01a90db2055930dc90955d6b74400d2a48340e4
4
- data.tar.gz: 0b3195d112180448d2b4faf9410e977a2787ae219da060b51e56165a8f276a8d
3
+ metadata.gz: 838caf9468d6e6513df67cc554df7109b7efeb4154960f0355af05613cf6cd25
4
+ data.tar.gz: 800173f5e38349d0264a2fd978f9bfb201d3af333c495f816fd165c5af371358
5
5
  SHA512:
6
- metadata.gz: c0e12784521e3946b77d5571721afe2a9f9ee60006dae699189adb4742670ecb89842e6c8e5414ddc3148e7608bf03dc487245df0f4819aee1ccbcbd96d17899
7
- data.tar.gz: 9b2422091de5acb1f726b5fcbb4bf24477bb61d8eaf0b0bfe32c6e2bc39bdf5aa4aa7317e16d234c153216dfa13c912b14516bd00fb5c1b9d31062aed51b59fa
6
+ metadata.gz: 5617b2c7eb1b8745aae6ee8bc0752952c3609a7d8fca3c6469bc395f1779ecf16ef8cc2039ecb9c5bba63ca7393b1e4cbaf85f15e8686ac1fe073e8ade342c1c
7
+ data.tar.gz: a9df43925ed328b4a8a1fc1d123c177dedacb1ecbf331627e8bdbc96c0fcc0e14cb18ce1684b8469baf1d010b70d96d04daf00fab09ef9ee3c38743c776fc41f
@@ -2,5 +2,5 @@ source 'https://rubygems.org'
2
2
 
3
3
  gem 'appium_capybara', path: '..'
4
4
  gem 'rspec', '~> 3.0.0'
5
- gem 'site_prism', '~> 2.6'
5
+ gem 'site_prism', '~> 3.0'
6
6
  gem 'pry'
@@ -1,6 +1,6 @@
1
1
  [caps]
2
2
  platformName = "ios"
3
- platformVersion = "10.3"
3
+ platformVersion = "12.2"
4
4
  deviceName ="iPhone Simulator"
5
5
  automationName = 'XCUITest'
6
6
  app = "./UICatalog.app.zip"
@@ -6,10 +6,10 @@ require 'site_prism'
6
6
 
7
7
  caps = Appium.load_appium_txt file: File.expand_path('./', 'appium.txt'), verbose: true
8
8
 
9
- url = "http://localhost:4723/wd/hub"
9
+ url = 'http://localhost:4723/wd/hub'.freeze
10
10
 
11
11
  Capybara.register_driver(:appium) do |app|
12
- all_options = caps.merge({appium_lib: {server_url: url}, global_driver: false})
12
+ all_options = caps.merge(appium_lib: { server_url: url }, global_driver: false)
13
13
  puts all_options.inspect
14
14
 
15
15
  Appium::Capybara::Driver.new app, all_options
@@ -1,5 +1,5 @@
1
1
  module Pages
2
- class Home < SitePrism::Page
2
+ class Home < ::SitePrism::Page
3
3
  # UIANavigationBar
4
4
  # name: UICatalog
5
5
  elements :navigation_bar, :accessibility_id, 'UICatalog'
@@ -4,11 +4,9 @@ require_relative 'capybara_init'
4
4
  require_relative 'home_page'
5
5
 
6
6
  RSpec.configure do |config|
7
- config.after(:each) do |result|
8
- Capybara.current_session.driver.quit
9
- end
7
+ config.after(:each) { Capybara.current_session.driver.quit }
10
8
 
11
9
  config.after do |result|
12
10
  Capybara.current_session.driver.save_screenshot 'error.png' if result.exception
13
11
  end
14
- end
12
+ end
@@ -1,5 +1,5 @@
1
- require "appium_lib"
2
- require "capybara"
1
+ require 'appium_lib'
2
+ require 'capybara'
3
3
  require_relative 'appium_capybara/driver/appium/driver'
4
4
  require_relative 'appium_capybara/driver/appium/node'
5
5
 
@@ -8,7 +8,7 @@ module Appium::Capybara
8
8
  # starts new driver
9
9
  def appium_driver
10
10
  # must use self to reference the 'browser' method
11
- self.browser unless @appium_driver
11
+ browser unless @appium_driver
12
12
 
13
13
  @appium_driver
14
14
  end
@@ -18,18 +18,18 @@ module Appium::Capybara
18
18
  # Creates and starts a new appium driver.
19
19
  # To access the browser without creating one use @browser
20
20
  def browser
21
- unless @browser
22
- @appium_driver = Appium::Driver.new @options, false
23
- # browser is the standard selenium driver without any appium methods
24
- @browser = @appium_driver.start_driver
25
-
26
- main = Process.pid
27
- at_exit do
28
- # Store the exit status of the test run since it goes away after calling the at_exit proc...
29
- @exit_status = $!.status if $!.is_a?(SystemExit)
30
- quit if Process.pid == main
31
- exit @exit_status if @exit_status # Force exit with stored status
32
- end
21
+ return @browser if @browser
22
+
23
+ @appium_driver = Appium::Driver.new @options, false
24
+ # browser is the standard selenium driver without any appium methods
25
+ @browser = @appium_driver.start_driver
26
+
27
+ main = Process.pid
28
+ at_exit do
29
+ # Store the exit status of the test run since it goes away after calling the at_exit proc...
30
+ @exit_status = $ERROR_INFO.status if $ERROR_INFO.is_a?(SystemExit)
31
+ quit if Process.pid == main
32
+ exit @exit_status if @exit_status # Force exit with stored status
33
33
  end
34
34
  @browser
35
35
  end
@@ -53,29 +53,29 @@ module Appium::Capybara
53
53
 
54
54
  # @deprecated This method is being removed
55
55
  def browser_initialized?
56
- !! @browser
56
+ !!@browser
57
57
  end
58
58
 
59
59
  # override
60
60
  # type and options are passed but can be ignored.
61
- def dismiss_modal(type, options={}, &blk)
61
+ def dismiss_modal(type, options = {}, &blk)
62
62
  appium_driver.alert_dismiss
63
63
  end
64
64
 
65
65
  # override
66
66
  # type and options are passed but can be ignored.
67
- def accept_modal(type, options={}, &blk)
67
+ def accept_modal(type, options = {}, &blk)
68
68
  appium_driver.alert_accept
69
69
  end
70
70
 
71
71
  # new
72
72
  def scroll_up
73
- browser.execute_script("mobile: scroll", direction: "up")
73
+ browser.execute_script('mobile: scroll', direction: 'up')
74
74
  end
75
75
 
76
76
  # new
77
77
  def scroll_down
78
- browser.execute_script("mobile: scroll", direction: "down")
78
+ browser.execute_script('mobile: scroll', direction: 'down')
79
79
  end
80
80
 
81
81
  # new
@@ -2,4 +2,4 @@ class Capybara::Node::Base
2
2
  def find_custom(finder, locator)
3
3
  base.find_custom(finder, locator)
4
4
  end
5
- end
5
+ end
@@ -1,10 +1,8 @@
1
1
  module Capybara
2
2
  class Selector::Definition
3
-
4
3
  def custom(f, &block)
5
- @format, @expression = f, block if block
4
+ @expressions[f] = block if block
6
5
  end
7
-
8
6
  end
9
7
  end
10
8
 
@@ -4,20 +4,19 @@ class Capybara::Queries::SelectorQuery < Capybara::Queries::BaseQuery
4
4
  def resolve_for(node, exact = nil)
5
5
  node.synchronize do
6
6
  children = if selector.format == :css
7
- node.find_css(css)
8
- elsif selector.format == :xpath
9
- node.find_xpath(xpath(exact))
10
- else
11
- node.find_custom(selector.format, @expression)
12
- end.map do |child|
13
- if node.is_a?(Capybara::Node::Base)
14
- Capybara::Node::Element.new(node.session, child, node, self)
15
- else
16
- Capybara::Node::Simple.new(child)
17
- end
18
- end
7
+ node.find_css(css)
8
+ elsif selector.format == :xpath
9
+ node.find_xpath(xpath(exact))
10
+ else
11
+ node.find_custom(selector.format, @expression)
12
+ end.map do |child|
13
+ if node.is_a?(Capybara::Node::Base)
14
+ Capybara::Node::Element.new(node.session, child, node, self)
15
+ else
16
+ Capybara::Node::Simple.new(child)
17
+ end
18
+ end
19
19
  Capybara::Result.new(children, self)
20
20
  end
21
21
  end
22
-
23
22
  end
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Capybara
3
- VERSION = '1.8.0' unless defined? ::Appium::Capybara::VERSION
4
- DATE = '2019-05-18' unless defined? ::Appium::Capybara::DATE
3
+ VERSION = '1.8.1'.freeze unless defined? ::Appium::Capybara::VERSION
4
+ DATE = '2019-06-23'.freeze unless defined? ::Appium::Capybara::DATE
5
5
  end
6
- end
6
+ end
@@ -1,3 +1,10 @@
1
+ #### v1.8.1 2019-06-23
2
+
3
+ - [805b248](https://github.com/appium/appium_capybara/commit/805b24839f414c936e408739a871be9df3620fbf) Release 1.8.1
4
+ - [d684bc1](https://github.com/appium/appium_capybara/commit/d684bc1ffe5849d31c4895ba5a47be9d4ca50f08) tweak syntax (#49)
5
+ - [3b10096](https://github.com/appium/appium_capybara/commit/3b100967193128fa04a4ef5cab0e49c38d44f8e8) fix custom format definition (#48)
6
+
7
+
1
8
  #### v1.8.0 2019-05-18
2
9
 
3
10
  - [3d83516](https://github.com/appium/appium_capybara/commit/3d835164e59b03469a6250a7688c48d290dccfd2) Release 1.8.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appium_capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - scott.bonebrake@gmail.com
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2019-05-18 00:00:00.000000000 Z
13
+ date: 2019-06-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: appium_lib