ruby_raider 0.5.9 → 0.6.0

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: 83b79117c41866ab0f60bbda1064874ecb16a49c387991cc489819a9c608f021
4
- data.tar.gz: 42769e59023b6d1f107d0feb5feabc00a9c8727ddbf3839e375004ae4b8b06e0
3
+ metadata.gz: 343290e25435b54bda41d2a43a13eb23713e4ac1b89d773e1a981e250dce0bda
4
+ data.tar.gz: 72610baae56c1f6b22364d1ad5717425f781c987972a59470e831a2c8c627a8c
5
5
  SHA512:
6
- metadata.gz: faacb6ed879972b1fb9dbdc12b2226fc9d8968c09682a733d48bcf5efe6b88eeea73cc4179c53727758abbea0e6bbc88f433db731e3c922d7a091877e49e6d2c
7
- data.tar.gz: 0a1f49b27b8ab2fd64ce4e5c6a567b2d5058b37bfe26ad35e7b529c5849cdcc5d4e9f5d5ef63bf157df9cc036059f8878ae7f0419ccb2e91a7718903383e1375
6
+ metadata.gz: 8d2bbcec5a84038878369fb76d31ae8965abcf9300b7aa02957ca0ff2c4244e74c8ecd195dbb7eb053218974bc286b99fac6074baafdb40af021a5e75b56ed3b
7
+ data.tar.gz: 987a2a4fe907958384ba1e1ccd110987bbff1cd497577f5f51621fd3ab4bdaffdceff43bbe829ec0c9847fe7fe5ad470047da5a1c9040af29172458248f9cbd4
data/Rakefile CHANGED
@@ -2,8 +2,6 @@
2
2
 
3
3
  require_relative 'lib/ruby_raider'
4
4
  require_relative 'lib/commands/scaffolding_commands'
5
- require_relative 'lib/desktop/installation_screen'
6
- require_relative 'lib/desktop/runner_screen'
7
5
 
8
6
  desc 'Creates a new test project'
9
7
  task :new, [:name] do |_t, args|
@@ -29,13 +27,3 @@ desc 'Download mobile builds'
29
27
  task :builds, [:type] do |_t, args|
30
28
  ScaffoldingCommands.new.invoke(:download_builds, nil, %W[#{args.type}])
31
29
  end
32
-
33
- desc 'Open the desktop app'
34
- task :open do
35
- InstallationScreen.new.launch
36
- end
37
-
38
- desc 'Open the run screen'
39
- task :runner do
40
- RunnerScreen.new.launch
41
- end
data/lib/ruby_raider.rb CHANGED
@@ -3,8 +3,6 @@
3
3
  require_relative '../lib/commands/open_ai_commands'
4
4
  require_relative '../lib/commands/scaffolding_commands'
5
5
  require_relative '../lib/commands/utility_commands'
6
- require_relative '../lib/desktop/installation_screen'
7
- require_relative '../lib/desktop/runner_screen'
8
6
 
9
7
  module RubyRaider
10
8
  class Raider < Thor
@@ -16,16 +14,8 @@ module RubyRaider
16
14
 
17
15
  map '-n' => 'new'
18
16
 
19
- desc 'open', 'It opens the Ruby Raider desktop app'
20
- def open
21
- if File.directory?('spec') || File.directory?('feature')
22
- RunnerScreen.new.launch
23
- else
24
- InstallationScreen.new.launch
25
- end
26
- end
27
-
28
17
  desc 'version', 'It shows the version of Ruby Raider you are currently using'
18
+
29
19
  def version
30
20
  spec = Gem::Specification.find_by_name('ruby_raider')
31
21
  version = spec.version
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.5.9'
5
+ s.version = '0.6.0'
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']
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_raider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.9
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Agustin Pequeno
@@ -204,9 +204,6 @@ files:
204
204
  - lib/commands/open_ai_commands.rb
205
205
  - lib/commands/scaffolding_commands.rb
206
206
  - lib/commands/utility_commands.rb
207
- - lib/desktop/base_screen.rb
208
- - lib/desktop/installation_screen.rb
209
- - lib/desktop/runner_screen.rb
210
207
  - lib/generators/automation/automation_examples_generator.rb
211
208
  - lib/generators/automation/automation_generator.rb
212
209
  - lib/generators/automation/templates/abstract_component.tt
@@ -1,5 +0,0 @@
1
- require 'glimmer-dsl-libui'
2
-
3
- class BaseScreen
4
- include Glimmer
5
- end
@@ -1,137 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'base_screen'
4
- require_relative '../generators/invoke_generators'
5
-
6
- class InstallationScreen < BaseScreen
7
- include InvokeGenerators
8
-
9
- attr_accessor :entry_text
10
-
11
- def launch
12
- window('Ruby Raider', 800, 600) do
13
- margined true
14
- tab do
15
- tab_item('Installer') do
16
- vertical_box do
17
- vertical_box do
18
- stretchy false
19
- label('Project Name') do
20
- stretchy false
21
- end
22
-
23
- entry do
24
- stretchy false # Smart default option for appending to horizontal_box
25
- text <=> [self, :entry_text, { after_write: lambda { |text|
26
- @project_name = text
27
- $stdout.flush
28
- } }] # bidirectional data-binding between text property and entry_text attribute, printing after write to model.
29
- end
30
- end
31
-
32
- vertical_box do
33
- stretchy false
34
-
35
- @radio = radio_buttons do
36
- stretchy false
37
-
38
- items 'Web', 'Mobile'
39
- selected_item 'Web'
40
- on_selected do |buttons|
41
- if buttons.selected_item == 'Web'
42
- @mobile_automation.hide
43
- @platforms.hide
44
- @web_automation.show
45
- else
46
- @web_automation.hide
47
- @mobile_automation.show
48
- @platforms.show
49
- end
50
- end
51
- end
52
-
53
- @mobile_automation = combobox do
54
- stretchy false
55
- visible false
56
- items 'Appium'
57
- selected_item 'Appium'
58
- end
59
-
60
- @web_automation = combobox do
61
- stretchy false
62
- visible true
63
- items 'Selenium', 'Watir'
64
- selected_item 'Selenium'
65
- end
66
-
67
- @platforms = combobox do
68
- stretchy false
69
- visible false
70
- items 'Android', 'iOS', 'Cross-Platform'
71
- selected_item 'iOS'
72
- end
73
-
74
- @framework = combobox do
75
- stretchy false
76
- visible true
77
- items 'Cucumber', 'Rspec'
78
- selected_item 'Cucumber'
79
-
80
- on_selected do |items|
81
- if items.selected_item == 'Rspec' && @radio.selected_item != 'Mobile'
82
- @visual_checkbox.show
83
- else
84
- @visual_checkbox.hide
85
- end
86
- end
87
- end
88
-
89
- @visual_checkbox = checkbox('Applitools integration') do
90
- stretchy false
91
- visible false
92
- end
93
-
94
- @example_checkbox = checkbox('Add example files') do
95
- stretchy false
96
- visible true
97
- end
98
-
99
- button('Create Project') do
100
- stretchy false
101
- on_clicked do
102
- automation = if @web_automation.visible?
103
- @web_automation.selected_item
104
- else
105
- @mobile_automation.selected_item
106
- end
107
- structure = {
108
- automation: automation,
109
- examples: @example_checkbox.checked,
110
- framework: @framework.selected_item,
111
- generators: %w[Automation Common Helpers],
112
- name: @project_name,
113
- visual: @visual_checkbox.checked
114
- }
115
- generate_framework(structure)
116
- @installation_box.text = if File.directory?(@project_name)
117
- "Your project has been created, close this window, go to the folder #{@project_name} and run 'raider open'"
118
- else
119
- 'There was a problem creating your project try again'
120
- end
121
- end
122
- end
123
- end
124
- vertical_box do
125
- stretchy false
126
- @installation_box = multiline_entry do
127
- stretchy false
128
- text 'Your installation result will appear here...'
129
- $stdout.flush
130
- end
131
- end
132
- end
133
- end
134
- end
135
- end.show
136
- end
137
- end
@@ -1,123 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'open3'
4
- require 'yaml'
5
- require_relative 'base_screen'
6
-
7
- class RunnerScreen < BaseScreen
8
- attr_accessor :contacts
9
-
10
- CONFIG_ITEM = Struct.new(:attribute, :value)
11
- CAP = Struct.new(:attribute, :value)
12
-
13
- if File.directory?('spec')
14
- @folder = 'spec'
15
- @framework = 'rspec'
16
- @extension = '*_spec.rb'
17
- else
18
- @folder = 'features'
19
- @framework = 'cucumber'
20
- @extension = '*.features'
21
- end
22
-
23
- window('Ruby Raider', 1200, 800) do
24
- margined true
25
- vertical_box do
26
- grid do
27
- stretchy false
28
-
29
- button('▶') do
30
- left 0
31
- on_clicked do
32
- output = Open3.popen3("#{@framework} #{@tests.selected_item}") do |_stdin, stdout, _stderr|
33
- stdout.read
34
- end
35
- system "rspec #{@tests.selected_item}"
36
- @results.text = output
37
- end
38
- end
39
- button('■') do
40
- left 1
41
- on_clicked do
42
- pp 'The stop feature will be implemented in a later release'
43
- end
44
- end
45
-
46
- @tests = combobox do
47
- left 2
48
- files = Dir.glob(File.join(@folder, @extension)) || ['No Files are created']
49
- items files
50
- selected_item files.first
51
- @file = File.open(files.first) unless files.first == 'No Files are created'
52
-
53
- on_selected do |items|
54
- @results.text = ''
55
- path = items.selected_item
56
- @file = File.open(path)
57
- @text_box.text = @file.read
58
- end
59
- end
60
-
61
- button('Open Dashboard') do
62
- left 3
63
- halign :end
64
- on_clicked do
65
- system 'allure serve allure-reports'
66
- end
67
- end
68
- end
69
-
70
- tab do
71
- stretchy true
72
-
73
- tab_item('Tests') do
74
- horizontal_box do
75
- @text_box = multiline_entry do
76
- text @file.read
77
-
78
- on_changed do |e|
79
- File.write(@tests.selected_item, e.text)
80
- $stdout.flush # for Windows
81
- end
82
- end
83
-
84
- @results = multiline_entry do
85
- text ''
86
- end
87
- end
88
- end
89
-
90
- tab_item('Configuration') do
91
- @config = YAML.load_file('config/config.yml')
92
- config_items = @config.map { |key, value| CONFIG_ITEM.new(key, value) }
93
- vertical_box do
94
- refined_table(
95
- model_array: config_items,
96
- table_columns: {
97
- 'Attribute' => :text,
98
- 'Value' => { text: { editable: true } }
99
- },
100
- table_editable: true,
101
- per_page: 20
102
- )
103
- end
104
- end
105
- tab_item('Capabilities') do
106
- caps = File.exist?('config/capabilities.yml') ? YAML.load_file('config/capabilities.yml') : []
107
- caps = caps.map { |key, value| CAP.new(key, value) }
108
- vertical_box do
109
- refined_table(
110
- model_array: caps,
111
- table_columns: {
112
- 'Attribute' => :text,
113
- 'Value' => { text: { editable: true } }
114
- },
115
- table_editable: true,
116
- per_page: 20
117
- )
118
- end
119
- end
120
- end
121
- end
122
- end.show
123
- end