SaudeiD 0.2.5 → 0.2.6

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -12
  3. data/.rspec +3 -3
  4. data/CODE_OF_CONDUCT.md +84 -84
  5. data/Gemfile +10 -10
  6. data/LICENSE.txt +21 -21
  7. data/README.md +37 -37
  8. data/Rakefile +8 -8
  9. data/SaudeiD.gemspec +30 -30
  10. data/azure-pipelines.yaml +35 -33
  11. data/bin/SaudeiD +146 -146
  12. data/bin/console +15 -15
  13. data/bin/setup +8 -8
  14. data/credentials +2 -2
  15. data/lib/SaudeiD/SaudeiD_helper.rb +41 -41
  16. data/lib/SaudeiD/version.rb +5 -5
  17. data/lib/SaudeiD.rb +7 -7
  18. data/lib/SkeletonApi/.gitignore +1 -1
  19. data/lib/SkeletonApi/.rubocop.yml +62 -62
  20. data/lib/SkeletonApi/.solargraph.yml +16 -16
  21. data/lib/SkeletonApi/Gemfile +18 -18
  22. data/lib/SkeletonApi/README.md +36 -36
  23. data/lib/SkeletonApi/cucumber.yml +11 -11
  24. data/lib/SkeletonApi/features/specs/.gitkeep +0 -0
  25. data/lib/SkeletonApi/features/steps_definitions/.gitkeep +0 -0
  26. data/lib/SkeletonApi/features/support/config/environments/dev.yml +5 -5
  27. data/lib/SkeletonApi/features/support/config/environments/qa.yml +5 -5
  28. data/lib/SkeletonApi/features/support/data/factories/.gitkeep +0 -0
  29. data/lib/SkeletonApi/features/support/data/models/.gitkeep +0 -0
  30. data/lib/SkeletonApi/features/support/data/schemas/.gitkeep +0 -0
  31. data/lib/SkeletonApi/features/support/env.rb +28 -28
  32. data/lib/SkeletonApi/features/support/helper.rb +6 -6
  33. data/lib/SkeletonApi/features/support/hooks.rb +53 -53
  34. data/lib/SkeletonApi/features/support/services/.gitkeep +0 -0
  35. data/lib/SkeletonApi/report/.gitkeep +0 -0
  36. data/lib/SkeletonApi/report/junit/.gitkeep +0 -0
  37. data/lib/SkeletonWeb/.gitignore +7 -7
  38. data/lib/SkeletonWeb/.rubocop.yml +52 -52
  39. data/lib/SkeletonWeb/.solargraph.yml +16 -16
  40. data/lib/SkeletonWeb/Gemfile +13 -13
  41. data/lib/SkeletonWeb/README.md +49 -49
  42. data/lib/SkeletonWeb/cucumber.yml +16 -16
  43. data/lib/SkeletonWeb/features/specs/.gitkeep +0 -0
  44. data/lib/SkeletonWeb/features/steps_definitions/.gitkeep +0 -0
  45. data/lib/SkeletonWeb/features/support/config/elements.yml +2 -2
  46. data/lib/SkeletonWeb/features/support/config/environments/dev.yml +0 -0
  47. data/lib/SkeletonWeb/features/support/config/environments/qa.yml +0 -0
  48. data/lib/SkeletonWeb/features/support/env.rb +49 -49
  49. data/lib/SkeletonWeb/features/support/helper.rb +37 -37
  50. data/lib/SkeletonWeb/features/support/hooks.rb +56 -56
  51. data/lib/SkeletonWeb/features/support/pages/base_page.rb +3 -3
  52. data/lib/SkeletonWeb/report/.gitkeep +0 -0
  53. data/lib/SkeletonWeb/report/junit/.gitkeep +0 -0
  54. data/lib/SkeletonWeb/report/screenshots/test_failed/.gitkeep +0 -0
  55. data/lib/SkeletonWeb/report/screenshots/test_passed/.gitkeep +0 -0
  56. data/lib/locales/en.yml +16 -16
  57. data/lib/locales/pt.yml +15 -15
  58. data/lib/templates/feature.tt +8 -8
  59. data/lib/templates/page.tt +8 -8
  60. data/lib/templates/services.tt +10 -10
  61. data/lib/templates/steps.tt +5 -5
  62. data/sig/SaudeiD.rbs +4 -4
  63. metadata +2 -2
@@ -1,49 +1,49 @@
1
- require 'awesome_print'
2
- require 'capybara'
3
- require 'capybara/cucumber'
4
- require 'capybara/rspec'
5
- require 'date'
6
- require 'dotenv/load'
7
- require 'pry'
8
- require 'report_builder'
9
- require 'rspec'
10
- require 'rspec/expectations'
11
- require 'selenium-webdriver'
12
- require 'touch_action'
13
-
14
- require_relative 'helper'
15
-
16
- include Helper
17
-
18
- CONFIG = YAML.load_file(File.join(Dir.pwd, "features/support/config/environments/#{ENV['ENV_TYPE']}.yml"))
19
- EL = YAML.load_file('features/support/config/elements.yml')
20
-
21
- @browser = ENV['BROWSER']
22
-
23
- case @browser
24
- when 'firefox'
25
- @driver = :selenium
26
- when 'firefox_headless'
27
- @driver = :selenium_headless
28
- when 'chrome'
29
- @driver = :selenium_chrome
30
- when 'chrome_headless'
31
- Capybara.register_driver :selenium_chrome_headless do |app|
32
- chrome_options = Selenium::WebDriver::Chrome::Options.new.tap do |options|
33
- options.add_argument '--headless'
34
- options.add_argument '--disable-gpu'
35
- options.add_argument '--no-sandbox'
36
- options.add_argument '--disable-site-isolation-trials'
37
- end
38
- Capybara::Selenium::Driver.new(app, browser: :chrome, options: chrome_options)
39
- end
40
- @driver = :selenium_chrome_headless
41
- else
42
- p 'Invalid browser'
43
- end
44
-
45
- Capybara.configure do |config|
46
- config.default_driver = @driver
47
- config.app_host = CONFIG['URL_BASE']
48
- config.default_max_wait_time = 15
49
- end
1
+ require 'awesome_print'
2
+ require 'capybara'
3
+ require 'capybara/cucumber'
4
+ require 'capybara/rspec'
5
+ require 'date'
6
+ require 'dotenv/load'
7
+ require 'pry'
8
+ require 'report_builder'
9
+ require 'rspec'
10
+ require 'rspec/expectations'
11
+ require 'selenium-webdriver'
12
+ require 'touch_action'
13
+
14
+ require_relative 'helper'
15
+
16
+ include Helper
17
+
18
+ CONFIG = YAML.load_file(File.join(Dir.pwd, "features/support/config/environments/#{ENV['ENV_TYPE']}.yml"))
19
+ EL = YAML.load_file('features/support/config/elements.yml')
20
+
21
+ @browser = ENV['BROWSER']
22
+
23
+ case @browser
24
+ when 'firefox'
25
+ @driver = :selenium
26
+ when 'firefox_headless'
27
+ @driver = :selenium_headless
28
+ when 'chrome'
29
+ @driver = :selenium_chrome
30
+ when 'chrome_headless'
31
+ Capybara.register_driver :selenium_chrome_headless do |app|
32
+ chrome_options = Selenium::WebDriver::Chrome::Options.new.tap do |options|
33
+ options.add_argument '--headless'
34
+ options.add_argument '--disable-gpu'
35
+ options.add_argument '--no-sandbox'
36
+ options.add_argument '--disable-site-isolation-trials'
37
+ end
38
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: chrome_options)
39
+ end
40
+ @driver = :selenium_chrome_headless
41
+ else
42
+ p 'Invalid browser'
43
+ end
44
+
45
+ Capybara.configure do |config|
46
+ config.default_driver = @driver
47
+ config.app_host = CONFIG['URL_BASE']
48
+ config.default_max_wait_time = 15
49
+ end
@@ -1,37 +1,37 @@
1
- # encoding: utf-8
2
- # !/usr/bin/env ruby
3
- require 'fileutils'
4
-
5
- module Helper
6
- include Capybara::DSL
7
-
8
- def take_screenshot(scenario)
9
- scn_name = scenario.name.gsub(%r{([_@#!%()\-=;><,{}\~\[\]\.\/\?\"\*\^\$\+\-]+)}, '_')
10
- screenshot = scenario.failed? ? "#{Dir.pwd}/report/screenshots/test_failed/#{scn_name}.png" : "#{Dir.pwd}/report/screenshots/test_passed/#{scn_name}.png"
11
- screenshot = screenshot.tr!(' ', '_') if screenshot.include?(' ')
12
- page.save_screenshot(screenshot)
13
- attach(screenshot, 'image/png')
14
- end
15
-
16
- def wait_until_text_exist(element, text)
17
- 300.times do
18
- find(element).assert_text(text) == true
19
- break
20
- rescue StandardError
21
- sleep 0.1
22
- end
23
- end
24
-
25
- def wait_until_element_exist(element)
26
- 300.times do
27
- find(element, wait: 0.5)
28
- break
29
- rescue StandardError
30
- sleep 0.1
31
- end
32
- end
33
-
34
- def element_wait(time)
35
- sleep(time)
36
- end
37
- end
1
+ # encoding: utf-8
2
+ # !/usr/bin/env ruby
3
+ require 'fileutils'
4
+
5
+ module Helper
6
+ include Capybara::DSL
7
+
8
+ def take_screenshot(scenario)
9
+ scn_name = scenario.name.gsub(%r{([_@#!%()\-=;><,{}\~\[\]\.\/\?\"\*\^\$\+\-]+)}, '_')
10
+ screenshot = scenario.failed? ? "#{Dir.pwd}/report/screenshots/test_failed/#{scn_name}.png" : "#{Dir.pwd}/report/screenshots/test_passed/#{scn_name}.png"
11
+ screenshot = screenshot.tr!(' ', '_') if screenshot.include?(' ')
12
+ page.save_screenshot(screenshot)
13
+ attach(screenshot, 'image/png')
14
+ end
15
+
16
+ def wait_until_text_exist(element, text)
17
+ 300.times do
18
+ find(element).assert_text(text) == true
19
+ break
20
+ rescue StandardError
21
+ sleep 0.1
22
+ end
23
+ end
24
+
25
+ def wait_until_element_exist(element)
26
+ 300.times do
27
+ find(element, wait: 0.5)
28
+ break
29
+ rescue StandardError
30
+ sleep 0.1
31
+ end
32
+ end
33
+
34
+ def element_wait(time)
35
+ sleep(time)
36
+ end
37
+ end
@@ -1,56 +1,56 @@
1
- Before do
2
- window = Capybara.current_session.current_window
3
- window.resize_to(1366, 768)
4
- window.maximize
5
-
6
- @page = ->(klass) { klass.new }
7
- end
8
-
9
- After do |scenario|
10
- take_screenshot(scenario)
11
-
12
- exception_message(scenario)
13
- end
14
-
15
- def exception_message(scenario)
16
- scene = scenario.failed?
17
- return unless scene == true
18
-
19
- print_reason(scenario)
20
- end
21
-
22
- def print_reason(scenario)
23
- log("\n-------------")
24
- log("\nINCONSISTENCY")
25
- log("\n-------------")
26
- log("\n🔥🔥🔥 #{scenario.exception.message.split('(')[0]}")
27
- end
28
-
29
- AfterConfiguration do |config|
30
- config.on_event(:test_case_finished) do |event|
31
- puts "\n--------------------------------------------------------------------------------------------------"
32
- puts 'Results:'
33
- puts " - Scenario: #{event.test_case.name}"
34
- puts " - Result..: [ #{event.result.passed? ? '✅ ]' : '❌ ]'}"
35
- puts "--------------------------------------------------------------------------------------------------\n"
36
- end
37
- end
38
-
39
- at_exit do
40
- @infos = {
41
- 'Browser' => Capybara.default_driver.to_s.capitalize,
42
- 'Environment' => ENV['ENV_TYPE'],
43
- 'Data do Teste' => Time.now.strftime('%d/%B/%Y'),
44
- 'Hora do Teste' => Time.now.strftime('%H:%M:%S')
45
- }
46
-
47
- ReportBuilder.configure do |config|
48
- config.input_path = 'report/report.json'
49
- config.report_path = 'report/report'
50
- config.report_types = [:html]
51
- config.report_title = '[SaudeId] - My Title'
52
- config.additional_info = @infos
53
- config.color = 'indigo'
54
- end
55
- ReportBuilder.build_report
56
- end
1
+ Before do
2
+ window = Capybara.current_session.current_window
3
+ window.resize_to(1366, 768)
4
+ window.maximize
5
+
6
+ @page = ->(klass) { klass.new }
7
+ end
8
+
9
+ After do |scenario|
10
+ take_screenshot(scenario)
11
+
12
+ exception_message(scenario)
13
+ end
14
+
15
+ def exception_message(scenario)
16
+ scene = scenario.failed?
17
+ return unless scene == true
18
+
19
+ print_reason(scenario)
20
+ end
21
+
22
+ def print_reason(scenario)
23
+ log("\n-------------")
24
+ log("\nINCONSISTENCY")
25
+ log("\n-------------")
26
+ log("\n🔥🔥🔥 #{scenario.exception.message.split('(')[0]}")
27
+ end
28
+
29
+ AfterConfiguration do |config|
30
+ config.on_event(:test_case_finished) do |event|
31
+ puts "\n--------------------------------------------------------------------------------------------------"
32
+ puts 'Results:'
33
+ puts " - Scenario: #{event.test_case.name}"
34
+ puts " - Result..: [ #{event.result.passed? ? '✅ ]' : '❌ ]'}"
35
+ puts "--------------------------------------------------------------------------------------------------\n"
36
+ end
37
+ end
38
+
39
+ at_exit do
40
+ @infos = {
41
+ 'Browser' => Capybara.default_driver.to_s.capitalize,
42
+ 'Environment' => ENV['ENV_TYPE'],
43
+ 'Data do Teste' => Time.now.strftime('%d/%B/%Y'),
44
+ 'Hora do Teste' => Time.now.strftime('%H:%M:%S')
45
+ }
46
+
47
+ ReportBuilder.configure do |config|
48
+ config.input_path = 'report/report.json'
49
+ config.report_path = 'report/report'
50
+ config.report_types = [:html]
51
+ config.report_title = '[SaudeId] - My Title'
52
+ config.additional_info = @infos
53
+ config.color = 'indigo'
54
+ end
55
+ ReportBuilder.build_report
56
+ end
@@ -1,3 +1,3 @@
1
- class BasePage
2
- include Capybara::DSL
3
- end
1
+ class BasePage
2
+ include Capybara::DSL
3
+ end
File without changes
File without changes
data/lib/locales/en.yml CHANGED
@@ -1,17 +1,17 @@
1
- en:
2
- first_scenario: "First Scenario"
3
- background: "Background"
4
- feature: "Feature"
5
- scenario: "Scenario"
6
- given: "Given"
7
- when: "When"
8
- then: "Then"
9
- describe: description
10
- context: description
11
- it: does something
12
- comments:
13
- insert_steps: "Insert steps"
14
- elements: "Declare all the elements of this page"
15
- actions: "Declare all actions of this page"
16
- services: "Where is the configuration of a particular request"
1
+ en:
2
+ first_scenario: "First Scenario"
3
+ background: "Background"
4
+ feature: "Feature"
5
+ scenario: "Scenario"
6
+ given: "Given"
7
+ when: "When"
8
+ then: "Then"
9
+ describe: description
10
+ context: description
11
+ it: does something
12
+ comments:
13
+ insert_steps: "Insert steps"
14
+ elements: "Declare all the elements of this page"
15
+ actions: "Declare all actions of this page"
16
+ services: "Where is the configuration of a particular request"
17
17
 
data/lib/locales/pt.yml CHANGED
@@ -1,16 +1,16 @@
1
- pt:
2
- first_scenario: "Primeiro Cenário"
3
- background: "Contexto"
4
- feature: "Funcionalidade"
5
- scenario: "Cenário"
6
- given: "Dado"
7
- when: "Quando"
8
- then: "Entao"
9
- describe: descrição
10
- context: descrição
11
- it: faz alguma coisa
12
- comments:
13
- insert_steps: "Insira os passos"
14
- elements: "Declare todos os elementos da página"
15
- actions: "Declare todas as ações da página"
1
+ pt:
2
+ first_scenario: "Primeiro Cenário"
3
+ background: "Contexto"
4
+ feature: "Funcionalidade"
5
+ scenario: "Cenário"
6
+ given: "Dado"
7
+ when: "Quando"
8
+ then: "Entao"
9
+ describe: descrição
10
+ context: descrição
11
+ it: faz alguma coisa
12
+ comments:
13
+ insert_steps: "Insira os passos"
14
+ elements: "Declare todos os elementos da página"
15
+ actions: "Declare todas as ações da página"
16
16
  services: "Onde fica as configuraçōes de uma determinada requisição"
@@ -1,8 +1,8 @@
1
- <%= "#language: #{options[:lang]}" %>
2
- <%= I18n.translate( :feature ) %>: <%= config[:name] %>
3
-
4
- <%= I18n.translate( :background ) %>:
5
- # <%= I18n.translate( "comments.insert_steps" ) %>
6
-
7
- <%= I18n.translate( :scenario ) %>: <%= I18n.translate( :first_scenario ) %>
8
- # <%= I18n.translate( "comments.insert_steps" ) %>
1
+ <%= "#language: #{options[:lang]}" %>
2
+ <%= I18n.translate( :feature ) %>: <%= config[:name] %>
3
+
4
+ <%= I18n.translate( :background ) %>:
5
+ # <%= I18n.translate( "comments.insert_steps" ) %>
6
+
7
+ <%= I18n.translate( :scenario ) %>: <%= I18n.translate( :first_scenario ) %>
8
+ # <%= I18n.translate( "comments.insert_steps" ) %>
@@ -1,8 +1,8 @@
1
- class <%= config[:name] %>Page < BasePage
2
- # attr_reader :element
3
-
4
- def initialize
5
- # @element = EL['element']
6
- end
7
-
8
- end
1
+ class <%= config[:name] %>Page < BasePage
2
+ # attr_reader :element
3
+
4
+ def initialize
5
+ # @element = EL['element']
6
+ end
7
+
8
+ end
@@ -1,10 +1,10 @@
1
- class <%= config[:name] %>Service
2
- include HTTParty
3
-
4
- base_uri CONFIG['BASE_URI']
5
- headers CONFIG['API_HEADERS']
6
- default_timeout 120
7
-
8
- def initialize() end
9
-
10
- end
1
+ class <%= config[:name] %>Service
2
+ include HTTParty
3
+
4
+ base_uri CONFIG['BASE_URI']
5
+ headers CONFIG['API_HEADERS']
6
+ default_timeout 120
7
+
8
+ def initialize() end
9
+
10
+ end
@@ -1,5 +1,5 @@
1
- ######### <%= I18n.translate( :given ).upcase %> #########
2
-
3
- ######### <%= I18n.translate( :when ).upcase %> #########
4
-
5
- ######### <%= I18n.translate( :then ).upcase %> #########
1
+ ######### <%= I18n.translate( :given ).upcase %> #########
2
+
3
+ ######### <%= I18n.translate( :when ).upcase %> #########
4
+
5
+ ######### <%= I18n.translate( :then ).upcase %> #########
data/sig/SaudeiD.rbs CHANGED
@@ -1,4 +1,4 @@
1
- module SaudeiD
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
- end
1
+ module SaudeiD
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: SaudeiD
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Raphael Castro
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
184
  - !ruby/object:Gem::Version
185
185
  version: '0'
186
186
  requirements: []
187
- rubygems_version: 3.2.3
187
+ rubygems_version: 3.3.7
188
188
  signing_key:
189
189
  specification_version: 4
190
190
  summary: Generates an Web, Api Test Automation project with Cucumber, Rspec, Capybara,