ruby_raider 0.8.3 → 0.8.5

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: ed1c1f61d9c3a4eaeb21508c43dc140afff1c17ac9314b8b1c7cea6632ea954d
4
- data.tar.gz: 4106d65568c8ed549f94cb08413aaf8c335942609ba0d7d1eaa876a56727f831
3
+ metadata.gz: 781def304ec2056ea9b417b071c9acf9fd8bda461cc80d5ffb98b16463feec44
4
+ data.tar.gz: d997baceec6e372557299bfbc07888d9c1a9821cbed8846025d4d22b105976dd
5
5
  SHA512:
6
- metadata.gz: d1813f00173a8daf5974fbb47fa41368f53f748aa328f97f5c01f08975b363ccf403a5bf7a99ac76a4bb3546bd45ed9342a275fb4b9eab43d66a17add8742f67
7
- data.tar.gz: f401808ed737b8150509af8347930d6d35013a0d29a3bb3c16e141d39ece0b0321f18025f3f31282001f76cd8dd5b611b21598f4adb9bc8025247aaa87b086f3
6
+ metadata.gz: 6413ebeadf5606fd74ea25e26ded0376da68bbfa242561ef0f32fb6a4e248d1bc50a7b4f2fea1db21a517cecb3f11c14fdf04ff96e15aaf67ce0cacfa527a426
7
+ data.tar.gz: 22ab647b145a58ec29cdd78e4bd65624af48585cf479a3647cb9eecb883fddd4d7c07eed68f2dff6833a1f4e13c7520ee25dd1ca406eaed5be8ab923226c1a25
data/README.md CHANGED
@@ -26,43 +26,30 @@
26
26
  <p align="center"> For more information and updates on releases, see <a href="https://ruby-raider.com">https://ruby-raider.com</a></p>
27
27
  </div>
28
28
 
29
- ## What is ruby raider?
29
+ ## What is Ruby Raider?
30
30
 
31
31
  Ruby Raider is a generator and scaffolding gem to make UI test automation easier
32
32
 
33
- ### At the moment Ruby raider supports
33
+ ### At the moment Ruby Raider supports generating the following frameworks:
34
+ | Web Testing Framework | Visual Testing Framework | Mobile Testing Framework |
35
+ |----------------------------|---------------------------------------------|-------------------------------------------|
36
+ | Cucumber and Selenium | Cucumber, Applitools and Selenium | Cucumber and Appium for IOS |
37
+ | Rspec and Selenium | Rspec, Applitools and Selenium | Rspec and Appium for IOS |
38
+ | Cucumber and Watir | | Cucumber and Appium for Android |
39
+ | Rspec and Watir | | Rspec and Appium for Android |
40
+ | | | Cucumber and Appium Cross-platform |
41
+ | | | Rspec and Appium Cross-platform |
42
+ | | | Cucumber and Sparkling Watir for IOS |
43
+ | | | Rspec and Sparkling Watir for IOS |
34
44
 
35
- * Generating a framework with Cucumber and Selenium
36
45
 
37
- * Generating a framework with Rspec and Selenium
38
-
39
- * Generating a framework with Cucumber and Watir
40
-
41
- * Generating a framework with Rspec and Watir
42
-
43
- * Generating a framework with Rspec and Appium for IOS
44
-
45
- * Generating a framework with Cucumber and Appium for IOS
46
-
47
- * Generating a framework with Rspec and Appium for Android
48
-
49
- * Generating a framework with Cucumber and Appium for Android
50
-
51
- * Generating a framework with Rspec and Appium cross platform
52
-
53
- * Generating a framework with Cucumber and Appium cross platform
54
-
55
- * Generating a visual testing framework with Rspec, Applitools and Selenium
56
-
57
- * Generating a visual testing framework with Cucumber, Applitools and Selenium
58
-
59
- * Generating a mobile testing framework with Rspec and Sparkling Watir for IOS
60
-
61
- * Generating a mobile testing framework with Cucumber and Sparkling Watir for IOS
62
46
 
63
47
  ***In order to run the Appium tests, download the example [app](https://github.com/saucelabs/my-demo-app-rn).***
64
- ***Remember to use the full path of the app that you download in the capabilities file***
65
-
48
+ ***Remember to use the full path of the app that you download in the capabilities file and start the server using one of the commands below:***
49
+ ```ruby
50
+ raider u start_appium
51
+ appium --base-path /wd/hub
52
+ ```
66
53
  ***In order to run the visual tests with applitools, you need to create an account and get your api key, you can read
67
54
  more [here](https://applitools.com/docs/topics/overview/obtain-api-key.html#:~:text=If%20you%20already%20have%20an,Your%20key%20will%20be%20displayed.)
68
55
  .***
@@ -98,13 +85,12 @@ Select the ones you will like to work with.
98
85
  ###### Anything between square brackets([...]) is where your imput goes
99
86
 
100
87
  ```ruby
101
- Commands :
88
+ Commands:
102
89
  raider generate # Provides access to all the generators commands
103
- raider help [COMMAND] # Describe available commands or one specific command
104
- raider new [PROJECT_NAME] # Creates a new framework based on settings picked
105
- raider open_ai # Provides access to all the open ai commands
106
- raider utility # Provides access to all the utility commands
107
- raider version # It shows the version of Ruby Raider you are currently using
90
+ raider help [COMMAND] # Describe available commands or one specific command
91
+ raider new [PROJECT_NAME] # Creates a new framework based on settings picked
92
+ raider open_ai # Provides access to all the open ai commands
93
+ raider utility # Provides access to all the utility commands raider version # It shows the version of Ruby Raider you are currently using
108
94
  ```
109
95
 
110
96
  All the basic commands have their corresponding shortcut:
@@ -134,6 +120,12 @@ raider u path [PATH_NAME] - -helper or -h
134
120
 
135
121
  If you don't specify an option, path will assume you want to change the default path for pages.
136
122
 
123
+ ### Appium Server Command
124
+ To initialise Appium server run this command:
125
+ ```ruby
126
+ raider u start_appium
127
+ ```
128
+
137
129
  ### Open AI Commands
138
130
 
139
131
  ```ruby
@@ -1,4 +1,5 @@
1
1
  require 'thor'
2
+ require 'faraday'
2
3
  require_relative '../open_ai/open_ai'
3
4
 
4
5
  class OpenAiCommands < Thor
@@ -58,4 +59,27 @@ class OpenAiCommands < Thor
58
59
  make(options[:open_ai], "#{path}/#{name}_steps.rb")
59
60
  end
60
61
  end
62
+
63
+ desc 'test', 'Uses open AI to create a file or generate output'
64
+ def test
65
+ conn = Faraday.new(url: 'https://api.openai.com') do |faraday|
66
+ faraday.headers['Content-Type'] = 'application/json'
67
+ faraday.headers['Authorization'] = "Bearer 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"
68
+ faraday.headers['OpenAI-Beta'] = 'assistants=v1'
69
+ end
70
+
71
+ # Data payload for the POST request
72
+ payload = {
73
+ instructions: "You are a personal math tutor. When asked a question, write and run Python code to answer the question.",
74
+ name: "Math Tutor",
75
+ tools: [{ type: "code_interpreter" }],
76
+ model: "gpt-4-1106-preview"
77
+ }
78
+
79
+ # Perform the POST request
80
+ response = conn.post('/v1/assistants', payload.to_json)
81
+
82
+ # Output the response body
83
+ puts response.body
84
+ end
61
85
  end
@@ -87,4 +87,9 @@ class UtilityCommands < Thor
87
87
  Utilities.download_android_build
88
88
  Utilities.download_ios_build
89
89
  end
90
+
91
+ desc 'start_appium', 'It starts the appium server'
92
+ def start_appium
93
+ system 'appium --base-path /wd/hub'
94
+ end
90
95
  end
@@ -19,8 +19,11 @@ end
19
19
  <%- else -%>
20
20
  # frozen_string_literal: true
21
21
 
22
- require_relative '../../page_objects/pages/home_page'
23
- require_relative '../../page_objects/pages/pdp_page'
22
+ <% if automation == 'cross_platform' -%>
23
+ require_relative '../../helpers/appium_helper'
24
+ <%- end -%>
25
+ require_relative '../../page_objects/pages/home'
26
+ require_relative '../../page_objects/pages/pdp'
24
27
 
25
28
  Given("I'm an anonymous user on the home page") do
26
29
  @home_page = Home.new(driver)
@@ -60,6 +60,9 @@ class PdpSpec
60
60
  end
61
61
  end
62
62
  <%- else -%>
63
+ <% if automation == 'cross_platform' -%>
64
+ require_relative '../helpers/appium_helper'
65
+ <%- end -%>
63
66
  require_relative '../helpers/spec_helper'
64
67
  require_relative '../page_objects/pages/home'
65
68
  require_relative '../page_objects/pages/pdp'
@@ -1,5 +1,9 @@
1
1
  # Ruby Raider
2
2
 
3
+ [![Gem Version](https://badge.fury.io/rb/ruby_raider.svg)](https://badge.fury.io/rb/ruby_raider)
4
+ [![Rubocop](https://github.com/RubyRaider/ruby_raider/actions/workflows/rspec.yml/badge.svg)](https://github.com/RubyRaider/ruby_raider/actions/workflows/rspec.yml)
5
+ [![Gitter](https://badges.gitter.im/RubyRaider/community.svg)](https://gitter.im/RubyRaider/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
6
+
3
7
  <!-- PROJECT LOGO -->
4
8
  <br />
5
9
  <div align="center">
@@ -22,39 +26,23 @@
22
26
  <p align="center"> For more information and updates on releases, see <a href="https://ruby-raider.com">https://ruby-raider.com</a></p>
23
27
  </div>
24
28
 
25
- ## What is ruby raider?
29
+ ## What is Ruby Raider?
26
30
 
27
31
  Ruby Raider is a generator and scaffolding gem to make UI test automation easier
28
32
 
29
- ### At the moment Ruby raider supports
30
-
31
- * Generating a framework with Cucumber and Selenium
32
-
33
- * Generating a framework with Rspec and Selenium
34
-
35
- * Generating a framework with Cucumber and Watir
36
-
37
- * Generating a framework with Rspec and Watir
38
-
39
- * Generating a framework with Rspec and Appium for IOS
40
-
41
- * Generating a framework with Cucumber and Appium for IOS
42
-
43
- * Generating a framework with Rspec and Appium for Android
44
-
45
- * Generating a framework with Cucumber and Appium for Android
46
-
47
- * Generating a framework with Rspec and Appium cross platform
48
-
49
- * Generating a framework with Cucumber and Appium cross platform
50
-
51
- * Generating a visual testing framework with Rspec, Applitools and Selenium
52
-
53
- * Generating a visual testing framework with Cucumber, Applitools and Selenium
33
+ ### At the moment Ruby Raider supports generating the following frameworks:
34
+ | Web Testing Framework | Visual Testing Framework | Mobile Testing Framework |
35
+ |----------------------------|---------------------------------------------|-------------------------------------------|
36
+ | Cucumber and Selenium | Cucumber, Applitools and Selenium | Cucumber and Appium for IOS |
37
+ | Rspec and Selenium | Rspec, Applitools and Selenium | Rspec and Appium for IOS |
38
+ | Cucumber and Watir | | Cucumber and Appium for Android |
39
+ | Rspec and Watir | | Rspec and Appium for Android |
40
+ | | | Cucumber and Appium Cross-platform |
41
+ | | | Rspec and Appium Cross-platform |
42
+ | | | Cucumber and Sparkling Watir for IOS |
43
+ | | | Rspec and Sparkling Watir for IOS |
54
44
 
55
- * Generating a mobile testing framework with Rspec and Sparkling Watir for IOS
56
45
 
57
- * Generating a mobile testing framework with Cucumber and Sparkling Watir for IOS
58
46
 
59
47
  ***In order to run the Appium tests, download the example [app](https://github.com/saucelabs/my-demo-app-rn).***
60
48
  ***Remember to use the full path of the app that you download in the capabilities file***
@@ -95,7 +83,7 @@ Select the ones you will like to work with.
95
83
 
96
84
  ```ruby
97
85
  Commands :
98
- raider generate # Provides access to all the generators commands
86
+ raider generate # Provides access to all the generators commands
99
87
  raider help [COMMAND] # Describe available commands or one specific command
100
88
  raider new [PROJECT_NAME] # Creates a new framework based on settings picked
101
89
  raider open_ai # Provides access to all the open ai commands
@@ -20,7 +20,7 @@ module SpecHelper
20
20
  config.after(:each) do |example|
21
21
  example_name = example.description
22
22
  Dir.mktmpdir do |temp_folder|
23
- app.screenshot.save("#{temp_folder}/#{example_name}.png")
23
+ screenshot = app.screenshot.save("#{temp_folder}/#{example_name}.png")
24
24
  AllureHelper.add_screenshot(example_name, screenshot)
25
25
  end
26
26
  app.close
@@ -14,12 +14,12 @@ module OpenAi
14
14
 
15
15
  def configure_client
16
16
  OpenAI.configure do |config|
17
- config.access_token = ENV.fetch('OPENAI_ACCESS_TOKEN')
17
+ config.access_token = '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'
18
18
  config.organization_id = ENV.fetch('OPENAI_ORGANIZATION_ID', nil)
19
19
  end
20
20
  end
21
21
 
22
- def input(request, model = 'gpt-3.5-turbo', temperature = 0.7)
22
+ def input(request, model = 'gpt-4', temperature = 0.7)
23
23
  client.chat(
24
24
  parameters: {
25
25
  model: model,
data/lib/ruby_raider.rb CHANGED
@@ -19,7 +19,7 @@ module RubyRaider
19
19
  desc 'version', 'It shows the version of Ruby Raider you are currently using'
20
20
 
21
21
  def version
22
- puts 'The Ruby Raider version is 0.8.3, Happy testing!'
22
+ puts "The version is #{parsed_version}, happy testing!"
23
23
  end
24
24
 
25
25
  map 'v' => 'version'
@@ -35,5 +35,10 @@ module RubyRaider
35
35
  desc 'utility', 'Provides access to all the utility commands'
36
36
  subcommand 'utility', UtilityCommands
37
37
  map 'u' => 'utility'
38
+
39
+ no_commands do
40
+ def gemspec = Gem::Specification.load('ruby_raider.gemspec')
41
+ def parsed_version = Gem::Version.new(gemspec.version)
42
+ end
38
43
  end
39
44
  end
data/ruby_raider.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ruby_raider'
5
- s.version = '0.8.3'
5
+ s.version = '0.8.5'
6
6
  s.summary = 'A gem to make setup and start of UI automation projects easier'
7
7
  s.description = 'This gem has everything you need to start working with test automation'
8
8
  s.authors = ['Agustin Pequeno']
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
21
21
  s.add_development_dependency 'rubocop-performance', '~> 1.15.0'
22
22
  s.add_development_dependency 'rubocop-rspec', '~> 2.9.0'
23
23
 
24
- s.add_runtime_dependency 'faraday', '~> 2.7', '>= 2.7.10'
24
+ s.add_runtime_dependency 'faraday', '~> 1.10.0'
25
25
  s.add_runtime_dependency 'ruby-openai', '~> 3.5'
26
26
  s.add_runtime_dependency 'thor', '~> 1.2.1'
27
27
  s.add_runtime_dependency 'tty-prompt', '~> 0.23.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_raider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pequeno
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2024-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dotenv
@@ -114,20 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '2.7'
118
- - - ">="
119
- - !ruby/object:Gem::Version
120
- version: 2.7.10
117
+ version: 1.10.0
121
118
  type: :runtime
122
119
  prerelease: false
123
120
  version_requirements: !ruby/object:Gem::Requirement
124
121
  requirements:
125
122
  - - "~>"
126
123
  - !ruby/object:Gem::Version
127
- version: '2.7'
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- version: 2.7.10
124
+ version: 1.10.0
131
125
  - !ruby/object:Gem::Dependency
132
126
  name: ruby-openai
133
127
  requirement: !ruby/object:Gem::Requirement