appium_capybara 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c01c74dae5c0bee9ff0affce27ffb6d71229271a597468ae02cb2a2977925d7
4
- data.tar.gz: 9d30bfd646196682b2b4f4fe153ee2b1f58de02ede7f052615d3b63d3f2bdd97
3
+ metadata.gz: 61255547032b2929a417bce0dd2cd32d1b1f14cac5e1f541ff3f2e4af4936bd0
4
+ data.tar.gz: 4c9bbbb7797a46b2f2beee958eeb2eeb092f2ada2b83b6fd3a77218f02aa816b
5
5
  SHA512:
6
- metadata.gz: 7d320348656da67f051a6237c56383ec65d16a78e89b099177cfd6e66063ad92118d433abcca42fe97705536730d8691780f509665fb75248b13b2ce394381f6
7
- data.tar.gz: 982ff5267fd0c1def16dd311d11c89407bfe65f97d13ac5734324349c5fb13c6e65957547120e01123f08bfe0622acfb1410778409d9ec61870b0a55fc85e343
6
+ metadata.gz: df111f9390b02d9a8b0f73b03c5c08ea8b06faa5fa7a4b28b51422f2bdb1f0f420a46e964fe680ca83d10a7b4d46116615c27c4cbced1fbb72620425ea75b47a
7
+ data.tar.gz: 268d230df4a4fa564a10b0171810563d2dd091f7cbe810d234f99f548a18e18a07f1d872570c46a8a1992f20302e62122b23a98ca4fd5dd3811d34bb1e9cf782
@@ -0,0 +1,53 @@
1
+ name: Run example
2
+
3
+ on:
4
+ push:
5
+ branches: [ "master" ]
6
+ pull_request:
7
+ branches: [ "master" ]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ test:
14
+
15
+ runs-on: macos-11
16
+ env:
17
+ PLATFORM_VERSION: '15.2'
18
+ XCODE_VERSION: '13.2'
19
+
20
+ steps:
21
+ - uses: actions/checkout@v3
22
+ - uses: maxim-lobanov/setup-xcode@v1
23
+ with:
24
+ xcode-version: ${{ env.XCODE_VERSION }}
25
+ - run: xcrun simctl list
26
+ - name: Set up Appium env
27
+ uses: actions/setup-node@v3
28
+ with:
29
+ node-version: 16
30
+ check-latest: true
31
+ - name: Install Appium XCUITest
32
+ run: |
33
+ npm install -g appium@next
34
+ appium driver install xcuitest
35
+ - name: run Appium background
36
+ run: |
37
+ nohup appium --base-path=/wd/hub --log-timestamp --log-no-colors > appium.out 2>&1 &
38
+ - name: Set up Ruby
39
+ uses: ruby/setup-ruby@0a29871fe2b0200a17a4497bae54fe5df0d973aa # v1.115.3
40
+ with:
41
+ ruby-version: 3.1
42
+ bundler-cache: true
43
+ - name: Run example
44
+ run: |
45
+ cd example
46
+ bundle install
47
+ bundle exec rspec spec/ios_example_spec.rb
48
+ - name: Upload appium.out
49
+ uses: actions/upload-artifact@v3.1.1
50
+ if: failure()
51
+ with:
52
+ path: appium.out
53
+
data/example/readme.md CHANGED
@@ -6,16 +6,30 @@ bundle update
6
6
  bundle exec rspec spec/ios_example_spec.rb
7
7
  ```
8
8
 
9
- # Use with pry
9
+ # Use `irb` or `pry`
10
+
11
+ You may need to add `pry` in Gemfile to use `pry` under `bundle`, otherwise you can insert `binding.irb` or `binding.pry` in the example code if needed.
12
+
13
+ ```bash
14
+ $ bndle exec irb
15
+ ```
10
16
 
11
17
  ```ruby
12
- # start a Pry session and paste the following code
18
+ # start an irb or pry session and paste the following code
13
19
  # run from the example folder
14
20
  require 'appium_capybara'
15
21
 
16
22
  Capybara.register_driver(:appium) do |app|
17
- opts = Appium.load_appium_txt file: File.join(Dir.pwd, 'appium.txt')
18
- Appium::Capybara::Driver.new app, opts
23
+ Appium::Capybara::Driver.new app, capabilities: {
24
+ 'platformName' => 'ios',
25
+ 'platformVersion' => ENV['PLATFORM_VERSION'] || '16.0',
26
+ 'appium:deviceName' => 'iPhone 12',
27
+ 'appium:automationName' => 'xcuitest',
28
+ 'appium:app' => File.expand_path('UICatalog.app.zip'),
29
+ 'appium:wdaLaunchTimeout' => 600000,
30
+ },
31
+ appium_lib: { server_url: 'http://localhost:4723/wd/hub' },
32
+ global_driver: false
19
33
  end
20
34
 
21
35
  Capybara.default_driver = :appium
@@ -26,4 +40,4 @@ capy_driver.browser
26
40
  # now driver commands can be invoked
27
41
  > capy_driver.go_back
28
42
  post /back
29
- ```
43
+ ```
@@ -4,15 +4,17 @@ require 'capybara/rspec'
4
4
  require 'appium_capybara'
5
5
  require 'site_prism'
6
6
 
7
- caps = Appium.load_appium_txt file: File.expand_path('./', 'appium.txt'), verbose: true
8
-
9
- url = 'http://localhost:4723/wd/hub'.freeze
10
-
11
7
  Capybara.register_driver(:appium) do |app|
12
- all_options = caps.merge(appium_lib: { server_url: url }, global_driver: false)
13
- puts all_options.inspect
14
-
15
- Appium::Capybara::Driver.new app, **all_options
8
+ Appium::Capybara::Driver.new app, capabilities: {
9
+ 'platformName' => 'ios',
10
+ 'platformVersion' => ENV['PLATFORM_VERSION'] || '16.0',
11
+ 'appium:deviceName' => 'iPhone 12',
12
+ 'appium:automationName' => 'xcuitest',
13
+ 'appium:app' => File.expand_path('UICatalog.app.zip'),
14
+ 'appium:wdaLaunchTimeout' => 600000,
15
+ },
16
+ appium_lib: { server_url: 'http://localhost:4723/wd/hub' },
17
+ global_driver: false
16
18
  end
17
19
 
18
20
  Capybara.default_driver = :appium
@@ -1,10 +1,6 @@
1
1
  class Capybara::Node::Element
2
2
  # Override
3
3
  def inspect
4
- %(#<#{self.class} tag="#{tag_name}" path="#{path}">)
5
- rescue ::Capybara::NotSupportedByDriverError, ::Selenium::WebDriver::Error::WebDriverError
6
- # Native context does not have the 'path' strategy, so it could raise an exception.
7
- # Then, the method can call tag_name instead.
8
- %(#<#{self.class} tag="#{tag_name}">)
4
+ %(#<Capybara::Node::Element name=#{@base.name}>)
9
5
  end
10
6
  end
@@ -1,6 +1,6 @@
1
1
  module Appium
2
2
  module Capybara
3
- VERSION = '2.0.1'.freeze unless defined? ::Appium::Capybara::VERSION
4
- DATE = '2022-11-12'.freeze unless defined? ::Appium::Capybara::DATE
3
+ VERSION = '2.0.2'.freeze unless defined? ::Appium::Capybara::VERSION
4
+ DATE = '2022-11-13'.freeze unless defined? ::Appium::Capybara::DATE
5
5
  end
6
6
  end
data/release_notes.md CHANGED
@@ -1,3 +1,12 @@
1
+ #### v2.0.2 2022-11-13
2
+
3
+ - [1145db9](https://github.com/appium/appium_capybara/commit/1145db93010c2cfbcf3a14faeb3dfac03a058e4a) Release 2.0.2
4
+ - [0058aa4](https://github.com/appium/appium_capybara/commit/0058aa4d4efec6e60d45d32e2963b0a7f6fdeccd) chore: remove appium.txt (#70)
5
+ - [07b9ef1](https://github.com/appium/appium_capybara/commit/07b9ef109728efb5d173e3d6b47353eba53306e6) Revert "fix: add webdrivererror handler instead of calling just name (#66)" (#69)
6
+ - [df9fef9](https://github.com/appium/appium_capybara/commit/df9fef9cb2bf081f789945120c81f9c554d3dbd5) ci: fix bundle command (#67)
7
+ - [47e5734](https://github.com/appium/appium_capybara/commit/47e5734815a8aa9ff715cd60c2fa2d5f61357426) ci: run example scenario as a quick test
8
+
9
+
1
10
  #### v2.0.1 2022-11-12
2
11
 
3
12
  - [5704c96](https://github.com/appium/appium_capybara/commit/5704c968c4f205898020d4496f65e971ac808c11) Release 2.0.1
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: 2.0.1
4
+ version: 2.0.2
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: 2022-11-12 00:00:00.000000000 Z
13
+ date: 2022-11-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: appium_lib
@@ -63,6 +63,7 @@ executables: []
63
63
  extensions: []
64
64
  extra_rdoc_files: []
65
65
  files:
66
+ - ".github/workflows/run_example.yml"
66
67
  - ".gitignore"
67
68
  - Gemfile
68
69
  - LICENSE-2.0.txt
@@ -71,7 +72,6 @@ files:
71
72
  - appium_capybara.gemspec
72
73
  - contributing.md
73
74
  - example/Gemfile
74
- - example/appium.txt
75
75
  - example/readme.md
76
76
  - example/spec/capybara_init.rb
77
77
  - example/spec/home_page.rb
data/example/appium.txt DELETED
@@ -1,6 +0,0 @@
1
- [caps]
2
- platformName = "ios"
3
- platformVersion = "15.0"
4
- deviceName ="iPhone Simulator"
5
- automationName = 'XCUITest'
6
- app = "./UICatalog.app.zip"