ruby_raider 0.9.0 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec_watir.yml +42 -0
- 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/utilities/utilities.rb +2 -1
- 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 +4 -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
|
@@ -0,0 +1,42 @@
|
|
1
|
+
name: BrowserStack Test
|
2
|
+
on: [ pull_request ]
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
ubuntu-job:
|
6
|
+
name: BrowserStack Test on Ubuntu
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- name: BrowserStack Env Setup
|
10
|
+
uses: browserstack/github-actions/setup-env@master
|
11
|
+
with:
|
12
|
+
username: ${{ secrets.BROWSERSTACK_USERNAME }}
|
13
|
+
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
|
14
|
+
build-name: BUILD_INFO
|
15
|
+
project-name: REPO_NAME
|
16
|
+
- name: BrowserStackLocal Setup
|
17
|
+
uses: browserstack/github-actions/setup-local@master
|
18
|
+
with:
|
19
|
+
local-testing: start
|
20
|
+
|
21
|
+
|
22
|
+
- name: Checkout the repository
|
23
|
+
uses: actions/checkout@v2
|
24
|
+
|
25
|
+
- name: Set up Ruby
|
26
|
+
uses: ruby/setup-ruby@f20f1eae726df008313d2e0d78c5e602562a1bcf
|
27
|
+
with:
|
28
|
+
ruby-version: head
|
29
|
+
|
30
|
+
- name: Install gems
|
31
|
+
run: bundle install
|
32
|
+
|
33
|
+
- name: Create Raider framework
|
34
|
+
run: bin/raider new rspec_watir -p framework:rspec automation:watir visual:false axe:true
|
35
|
+
|
36
|
+
- name: Run Raider tests
|
37
|
+
run: cd rspec_selenium && bundle install && raider utility browser_options chrome headless && rspec spec/
|
38
|
+
|
39
|
+
- name: BrowserStackLocal Stop
|
40
|
+
uses: browserstack/github-actions/setup-local@master
|
41
|
+
with:
|
42
|
+
local-testing: stop
|
@@ -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/utilities/utilities.rb
CHANGED
@@ -44,7 +44,8 @@ module Utilities
|
|
44
44
|
def browser_options=(*opts)
|
45
45
|
args = opts.flatten
|
46
46
|
browser_args = config['browser_arguments']
|
47
|
-
|
47
|
+
browser = args.first&.to_sym
|
48
|
+
browser_args[browser] = browser_args[browser] + args[1..]
|
48
49
|
overwrite_yaml
|
49
50
|
end
|
50
51
|
|
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
|
@@ -151,6 +137,7 @@ files:
|
|
151
137
|
- ".github/workflows/push_gem.yml"
|
152
138
|
- ".github/workflows/reek.yml"
|
153
139
|
- ".github/workflows/rspec_selenium.yml"
|
140
|
+
- ".github/workflows/rspec_watir.yml"
|
154
141
|
- ".github/workflows/rubocop.yml"
|
155
142
|
- ".gitignore"
|
156
143
|
- ".reek.yml"
|
@@ -275,7 +262,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
262
|
- !ruby/object:Gem::Version
|
276
263
|
version: '0'
|
277
264
|
requirements: []
|
278
|
-
rubygems_version: 3.5.
|
265
|
+
rubygems_version: 3.5.15
|
279
266
|
signing_key:
|
280
267
|
specification_version: 4
|
281
268
|
summary: A gem to make setup and start of UI automation projects easier
|