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 +4 -4
- data/.github/workflows/rspec_selenium.yml +1 -1
- data/.github/workflows/rspec_watir.yml +1 -1
- data/lib/generators/automation/templates/page.tt +3 -1
- data/lib/generators/automation/templates/partials/android_caps.tt +1 -1
- data/lib/generators/automation/templates/partials/cross_platform_caps.tt +4 -4
- data/lib/generators/automation/templates/partials/home_page_selector.tt +4 -4
- data/lib/generators/automation/templates/partials/ios_caps.tt +3 -3
- data/lib/generators/automation/templates/partials/pdp_page_selector.tt +4 -4
- data/lib/generators/templates/helpers/driver_helper.tt +2 -9
- data/lib/generators/templates/helpers/partials/driver_and_options.tt +29 -5
- data/lib/version +1 -1
- data/ruby_raider.gemspec +0 -1
- data/spec/integration/commands/scaffolding_commands_spec.rb +0 -1
- data/spec/integration/commands/utility_commands_spec.rb +0 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4a195c4ae16c35cc3fe907ad4d309449e4aa38753320ef06a882a4422fd54339
|
4
|
+
data.tar.gz: 48cd2a4c47981ed649f42baa34502741c3bfda8f6cea9f6e2f0b1789ed59341d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbfcfdf432d0811a7609a951a289bbe29e107ecc9eeb21f6f8085f437452a42d8a7c9cdc4166c2de962c1fa23c50968f250176a4f5e49561b59d69e6bd037241
|
7
|
+
data.tar.gz: 497eed25469773c0cd5345a068428ddf0a1cb5cdd34c952e6ae41f789da41f86e74ec789c31d6d3eadddf574769a655e555efcaa6f7e0ddd771b71ba468525f7
|
@@ -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,12 +4,12 @@ android:
|
|
4
4
|
platformVersion: '12'
|
5
5
|
automationName: UiAutomator2
|
6
6
|
deviceName: Pixel 3 API 32
|
7
|
-
app:
|
7
|
+
app: Android-MyDemoAppRN.1.3.0.build-244.apk
|
8
8
|
ios:
|
9
9
|
platformName: iOS
|
10
10
|
appium:options:
|
11
|
-
platformVersion:
|
12
|
-
deviceName: iPhone
|
11
|
+
platformVersion: '17.0'
|
12
|
+
deviceName: iPhone 15
|
13
13
|
automationName: XCUITest
|
14
|
-
app:
|
14
|
+
app: MyRNDemoApp.app
|
15
15
|
autoDismissAlerts: true
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
<%- if automation == 'ios' -%>
|
2
2
|
driver.find_element(predicate: 'label == "Sauce Labs Backpack"')
|
3
|
-
|
3
|
+
<%- elsif automation == 'android' -%>
|
4
4
|
driver.find_element(xpath: '(//android.view.ViewGroup[@content-desc="store item"])[1]/android.view.ViewGroup[1]')
|
5
|
-
|
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
|
-
|
8
|
+
<%- end -%>
|
@@ -1,8 +1,8 @@
|
|
1
1
|
platformName: iOS
|
2
2
|
appium:options:
|
3
3
|
url: http://localhost:4723/wd/hub
|
4
|
-
platformVersion:
|
5
|
-
deviceName: iPhone
|
4
|
+
platformVersion: '17.0'
|
5
|
+
deviceName: iPhone 15
|
6
6
|
automationName: XCUITest
|
7
|
-
app:
|
7
|
+
app: MyRNDemoApp.app
|
8
8
|
autoDismissAlerts: true
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
1
|
+
<%- if automation == 'ios' -%>
|
2
2
|
driver.find_element(accessibility_id: 'Add To Cart button')
|
3
|
-
|
3
|
+
<%- elsif automation == 'android' -%>
|
4
4
|
driver.find_element(xpath: '//android.view.ViewGroup[@content-desc="Add To Cart button"]/android.widget.TextView')
|
5
|
-
|
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
|
-
|
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
|
-
|
46
|
-
|
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
|
-
|
35
|
-
@driver = Appium::Driver.new({ caps: caps[platform] })
|
34
|
+
@driver = Appium::Driver.new({ caps: parsed_caps })
|
36
35
|
end
|
37
36
|
|
38
|
-
def
|
39
|
-
|
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:
|
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
|
+
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'
|
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.
|
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-
|
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.
|
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
|