ruby_raider 0.9.1 → 0.9.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: 858ef4fca3981fd08924d56c8fefdaba41c43d3264c87bc6e1a2b637e574ffe5
4
- data.tar.gz: 686d3364b2825d0c937678951f785169016d03d02252ba34e8c45c81120d092c
3
+ metadata.gz: 4a195c4ae16c35cc3fe907ad4d309449e4aa38753320ef06a882a4422fd54339
4
+ data.tar.gz: 48cd2a4c47981ed649f42baa34502741c3bfda8f6cea9f6e2f0b1789ed59341d
5
5
  SHA512:
6
- metadata.gz: c01b4d7cdaf1ea5353514e1dc0e6ca7473070ee895770880d59bc76604f92533bd47ac487288a98383ec26c8c2e0e8c1d8f294940efb5d2a562979a1e962bffc
7
- data.tar.gz: 785ca5f20feb705becba5c45de0d851cb0febf5dae8662fd55ad25acd29135ffb02c757d7551f92a666a256067d185305274be56cf3e500cec9a9be9631b05a7
6
+ metadata.gz: cbfcfdf432d0811a7609a951a289bbe29e107ecc9eeb21f6f8085f437452a42d8a7c9cdc4166c2de962c1fa23c50968f250176a4f5e49561b59d69e6bd037241
7
+ data.tar.gz: 497eed25469773c0cd5345a068428ddf0a1cb5cdd34c952e6ae41f789da41f86e74ec789c31d6d3eadddf574769a655e555efcaa6f7e0ddd771b71ba468525f7
@@ -1,4 +1,4 @@
1
- name: Rspec Selenium Test on Ubuntu
1
+ name: BrowserStack Test
2
2
  on: [ pull_request ]
3
3
 
4
4
  jobs:
@@ -1,4 +1,4 @@
1
- name: Rspec Watir Test on Ubuntu
1
+ name: BrowserStack Test
2
2
  on: [ pull_request ]
3
3
 
4
4
  jobs:
@@ -30,13 +30,15 @@ class Page
30
30
  self.class.to_s.sub('Page', ' Page')
31
31
  end
32
32
 
33
+ <%- if automation == 'selenium' -%>
33
34
  # Components
34
35
 
35
- <%- if automation == 'selenium' -%>
36
36
  def header
37
37
  Header.new(driver.find_element(id: 'customer_menu_top'))
38
38
  end
39
39
  <%- elsif automation == 'watir' -%>
40
+ # Components
41
+
40
42
  def header
41
43
  Header.new(browser.element(id: 'customer_menu_top'))
42
44
  end
@@ -4,4 +4,4 @@ appium:options:
4
4
  platformVersion: '12'
5
5
  automationName: UiAutomator2
6
6
  deviceName: Pixel 3 API 32
7
- app: "Android-MyDemoAppRN.1.3.0.build-244.apk"
7
+ app: Android-MyDemoAppRN.1.3.0.build-244.apk
@@ -4,12 +4,12 @@ android:
4
4
  platformVersion: '12'
5
5
  automationName: UiAutomator2
6
6
  deviceName: Pixel 3 API 32
7
- app: "Android-MyDemoAppRN.1.3.0.build-244.apk"
7
+ app: Android-MyDemoAppRN.1.3.0.build-244.apk
8
8
  ios:
9
9
  platformName: iOS
10
10
  appium:options:
11
- platformVersion: "14.0"
12
- deviceName: iPhone 11
11
+ platformVersion: '17.0'
12
+ deviceName: iPhone 15
13
13
  automationName: XCUITest
14
- app: "MyRNDemoApp.app"
14
+ app: MyRNDemoApp.app
15
15
  autoDismissAlerts: true
@@ -1,8 +1,8 @@
1
- <% if automation == 'ios' -%>
1
+ <%- if automation == 'ios' -%>
2
2
  driver.find_element(predicate: 'label == "Sauce Labs Backpack"')
3
- <% elsif automation == 'android' -%>
3
+ <%- elsif automation == 'android' -%>
4
4
  driver.find_element(xpath: '(//android.view.ViewGroup[@content-desc="store item"])[1]/android.view.ViewGroup[1]')
5
- <% else -%>
5
+ <%- else -%>
6
6
  element(ios: { predicate: 'label == "Sauce Labs Backpack"' },
7
7
  android: { xpath: '(//android.view.ViewGroup[@content-desc="store item"])[1]/android.view.ViewGroup[1]' })
8
- <% end -%>
8
+ <%- end -%>
@@ -1,8 +1,8 @@
1
1
  platformName: iOS
2
2
  appium:options:
3
3
  url: http://localhost:4723/wd/hub
4
- platformVersion: "14.0"
5
- deviceName: iPhone 11
4
+ platformVersion: '17.0'
5
+ deviceName: iPhone 15
6
6
  automationName: XCUITest
7
- app: "MyRNDemoApp.app"
7
+ app: MyRNDemoApp.app
8
8
  autoDismissAlerts: true
@@ -1,8 +1,8 @@
1
- <% if automation == 'ios' -%>
1
+ <%- if automation == 'ios' -%>
2
2
  driver.find_element(accessibility_id: 'Add To Cart button')
3
- <% elsif automation == 'android' -%>
3
+ <%- elsif automation == 'android' -%>
4
4
  driver.find_element(xpath: '//android.view.ViewGroup[@content-desc="Add To Cart button"]/android.widget.TextView')
5
- <% else -%>
5
+ <%- else -%>
6
6
  element(ios: { accessibility_id: 'Add To Cart button' },
7
7
  android: { xpath: '//android.view.ViewGroup[@content-desc="Add To Cart button"]/android.widget.TextView' })
8
- <% end -%>
8
+ <%- end -%>
@@ -42,20 +42,13 @@ module DriverHelper
42
42
  @driver ||= create_driver(browser, js_path, skip_iframes)
43
43
  end
44
44
  <% else -%>
45
- def driver
46
- @driver ||= create_driver
45
+ def driver
46
+ @driver ||= create_driver
47
47
  end
48
48
  <%- end -%>
49
49
 
50
50
  private
51
51
 
52
52
  <%= ERB.new(File.read(File.expand_path('./partials/driver_and_options.tt', __dir__)), trim_mode: '-').result(binding).strip! %>
53
-
54
- <%- if automation != 'selenium' -%>
55
- # :reek:UtilityFunction
56
- def caps
57
- YAML.load_file('config/capabilities.yml')
58
- end
59
- <%- end -%>
60
53
  end
61
54
  <%- end -%>
@@ -31,15 +31,39 @@
31
31
  end
32
32
  <% elsif automation == 'cross_platform' -%>
33
33
  def create_driver
34
- platform = config['platform'].to_s
35
- @driver = Appium::Driver.new({ caps: caps[platform] })
34
+ @driver = Appium::Driver.new({ caps: parsed_caps })
36
35
  end
37
36
 
38
- def config
39
- YAML.load_file('config/config.yml')
37
+ def platform
38
+ @platform ||= YAML.load_file('config/config.yml')['platform'].to_s
39
+ end
40
+
41
+ def platform_caps
42
+ @platform_caps ||= YAML.load_file('config/capabilities.yml')[platform]
43
+ end
44
+
45
+ # :reek:UtilityFunction
46
+ def parsed_caps
47
+ platform_caps['appium:options']['app'] = parse_app_path(platform_caps['appium:options']['app'])
48
+ platform_caps
49
+ end
50
+
51
+ def parse_app_path(path)
52
+ File.expand_path(path, Dir.pwd)
40
53
  end
41
54
  <% else -%>
42
55
  def create_driver
43
- @driver = Appium::Driver.new({ caps: caps })
56
+ @driver = Appium::Driver.new({ caps: parsed_caps })
57
+ end
58
+
59
+ # :reek:UtilityFunction
60
+ def parsed_caps
61
+ caps = YAML.load_file('config/capabilities.yml')
62
+ caps['appium:options']['app'] = app_path(caps['appium:options']['app'])
63
+ caps
64
+ end
65
+
66
+ def app_path(path)
67
+ File.expand_path(path, Dir.pwd)
44
68
  end
45
69
  <% end -%>
data/lib/version CHANGED
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.9.2
data/ruby_raider.gemspec CHANGED
@@ -13,7 +13,6 @@ Gem::Specification.new do |s|
13
13
  s.files = `git ls-files -z`.split("\x0")
14
14
  s.bindir = 'bin'
15
15
  s.executables << 'raider'
16
- s.add_development_dependency 'dotenv', '~> 2.8'
17
16
  s.add_development_dependency 'rake', '~> 13.0.6'
18
17
  s.add_development_dependency 'reek', '~> 6.1.0'
19
18
  s.add_development_dependency 'rspec', '~> 3.11.0'
@@ -1,4 +1,3 @@
1
- require 'dotenv'
2
1
  require 'pathname'
3
2
  require 'yaml'
4
3
  require_relative '../../../lib/generators/common_generator'
@@ -1,4 +1,3 @@
1
- require 'dotenv'
2
1
  require 'fileutils'
3
2
  require 'pathname'
4
3
  require 'yaml'
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_raider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pequeno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-06-30 00:00:00.000000000 Z
11
+ date: 2024-07-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: dotenv
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '2.8'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - "~>"
25
- - !ruby/object:Gem::Version
26
- version: '2.8'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -276,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
276
262
  - !ruby/object:Gem::Version
277
263
  version: '0'
278
264
  requirements: []
279
- rubygems_version: 3.5.0.dev
265
+ rubygems_version: 3.5.15
280
266
  signing_key:
281
267
  specification_version: 4
282
268
  summary: A gem to make setup and start of UI automation projects easier