taf 0.3.2 → 0.3.3

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: 81b715c5e4868e003e279e905010ea081b019ccd1ee2b3edfd5621d0e221e41c
4
- data.tar.gz: 6ee344aeeac5fbc0b63fd17cccbc19a3bcd756e847f066875f48fa8452b455bf
3
+ metadata.gz: 58fdfb7b11f94ebd4ecd06d200a119f8241250bcc2f488b3bb94ae5f251546cf
4
+ data.tar.gz: ff1c43e96ee2c1616c0ed15a3524bd37045000121da45be3eedb64d8ec479eb1
5
5
  SHA512:
6
- metadata.gz: 5cfbc2cfb744685d699cf1dc47e8b6fba4d01640529f701244460157f761ae99f9091a2387356beae3ce682a6e04417be0dcd0fc98187f0234149589bc93aace
7
- data.tar.gz: 1b469c6ce6cf12b778474f4c6c70f109eb1d2c9d827c6d90642a2ecde304363bddee2b1d717b4e0194d73a99984968a72b15cc9312be2d7f9749d5767ed1e0d8
6
+ metadata.gz: 86db648a0fbf86aa9d05f1ee3470133aca0ff0fdc24399c406fd001376a0277345474203bb191a6606dc3836d44f84f33d257ddf81bbed3424a3baa5115a5233
7
+ data.tar.gz: 3b9b9ada89869672854e9b1558238c0ccbb4a64ff077bfdef858fc9bda8dd7fc7a4d1b342733e894735427eaa2b4e21378d52b6580115cccef659384d4fd6e3f
@@ -1,8 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ # Base Hanfer file to contain all shared login functions
3
4
  module TestSteps
4
5
  require_relative '../../taf_config.rb'
5
6
  module Handlers
7
+ # All Login functions function.
6
8
  class Base
7
9
  def self.register(name)
8
10
  TestSteps.handlers[name.to_s] = self
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Browser Back function.
7
8
  class BrowserBack < Base
8
9
  register :browser_back
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Browser Forward function.
7
8
  class BrowserForward < Base
8
9
  register :browser_forward
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Browser Quit function.
7
8
  class BrowserQuit < Base
8
9
  register :browser_quit
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Browser Refresh function.
7
8
  class BrowserRefresh < Base
8
9
  register :browser_refresh
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Capture Alert function.
7
8
  class CaptureAlert < Base
8
9
  register :capture_alert
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Check Box function.
7
8
  class CheckBox < Base
8
9
  register :check_box
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Check Box Data function.
7
8
  class CheckBoxdata < Base
8
9
  register :check_box_data
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Check Browser Title function.
7
8
  class CheckTitle < Base
8
9
  register :check_browser_title
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Check a log file function.
7
8
  class CheckLogs < Base
8
9
  register :check_log_file
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Check Screendata text function.
7
8
  class CheckScreendata < Base
8
9
  register :check_screen_data
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Check URL function.
7
8
  class CheckUrl < Base
8
9
  register :check_url
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Click Button function.
7
8
  class ClickButton < Base
8
9
  register :click_button
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Execute System Command function.
7
8
  class ExecuteSystemCommand < Base
8
9
  register :execute_system_command
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Handle Browser Window function.
7
8
  class HandleBrowserWindow < Base
8
9
  register :handle_browser_window
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Pause the test function.
7
8
  class Ipause < Base
8
9
  register :ipause
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # List all Dropdown Values function.
7
8
  class ListAllDropdownValues < Base
8
9
  register :list_all_dropdown_values
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Logins function.
7
8
  class Login < Base
8
9
  register :login
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Open URL function.
7
8
  class OpenUrl < Base
8
9
  register :open_url
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Png Test function.
7
8
  class PingTest < Base
8
9
  register :ping_test
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Radio Button function.
7
8
  class RadioButton < Base
8
9
  register :radio_button
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Select Dropdown function.
7
8
  class SelectDropdown < Base
8
9
  register :select_dropdown
9
10
 
@@ -14,7 +15,8 @@ module TestSteps
14
15
  locate2 = step_attributes[:locate2]
15
16
 
16
17
  Browser.b.select_list("#{locate}": dropdown).wait_until(&:exists?)
17
- Browser.b.select_list("#{locate}": dropdown).option("#{locate2}": value2.to_s).select
18
+ Browser.b.select_list("#{locate}": dropdown).option("#{locate2}":
19
+ value2.to_s).select
18
20
  MyLog.log.info("Dropdown item: #{value2} has been selected")
19
21
  true
20
22
  rescue StandardError
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Send a Special Key function.
7
8
  class SendSpecialKeys < Base
8
9
  register :send_special_keys
9
10
 
@@ -4,6 +4,7 @@ require_relative 'base_handler'
4
4
 
5
5
  module TestSteps
6
6
  module Handlers
7
+ # Write box data function.
7
8
  class WriteBoxdata < Base
8
9
  register :write_box_data
9
10
 
@@ -12,11 +13,11 @@ module TestSteps
12
13
  value = step_attributes[:testvalue2]
13
14
  locate = step_attributes[:locate]
14
15
 
15
- text = ENV[value.to_s] || step_attributes[:testvalue2]
16
- WriteBoxdata.input_value(box, text, locate)
16
+ txt = ENV[value.to_s] || step_attributes[:testvalue2]
17
+ WriteBoxdata.input_value(box, txt, locate)
17
18
  end
18
19
 
19
- def self.input_value(box, text, locate)
20
+ def self.input_value(box, txt, locate)
20
21
  found_box = [
21
22
  Browser.b.textarea("#{locate}": box).exist?,
22
23
  Browser.b.text_field("#{locate}": box).exist?,
@@ -29,18 +30,18 @@ module TestSteps
29
30
  return unless index
30
31
 
31
32
  if index.zero?
32
- Browser.b.textarea("#{locate}": box).wait_until(&:exists?).set text
33
- (Browser.b.textarea("#{locate}": box).text == text)
33
+ Browser.b.textarea("#{locate}": box).wait_until(&:exists?).set txt
34
+ (Browser.b.textarea("#{locate}": box).text == txt)
34
35
  elsif index == 1
35
- Browser.b.text_field("#{locate}": box).wait_until(&:exists?).set text
36
- (Browser.b.text_field("#{locate}": box).text == text)
36
+ Browser.b.text_field("#{locate}": box).wait_until(&:exists?).set txt
37
+ (Browser.b.text_field("#{locate}": box).text == txt)
37
38
  elsif index == 2
38
- Browser.b.iframe("#{locate}": box).wait_until(&:exists?).send_keys text
39
+ Browser.b.iframe("#{locate}": box).wait_until(&:exists?).send_keys txt
39
40
  end
40
- MyLog.log.info("Textbox: #{box} has correct value: #{text}")
41
+ MyLog.log.info("Textbox: #{box} has correct value: #{txt}")
41
42
  true
42
43
  rescue StandardError
43
- MyLog.log.warn("Textbox: #{box} has the incorrect value: #{text}")
44
+ MyLog.log.warn("Textbox: #{box} has the incorrect value: #{txt}")
44
45
  false
45
46
  rescue StandardError
46
47
  MyLog.log.warn("Textbox: #{box} does not exist")
@@ -11,7 +11,7 @@ module Main
11
11
  require_relative './taf_config.rb'
12
12
 
13
13
  begin
14
- # variables to manage the failure reporting
14
+ # variables to manage the failure reporting
15
15
  $testStepPasses = 0
16
16
  $testStepFailures = 0
17
17
  $testStepNotrun = 0
@@ -22,7 +22,8 @@ module Report
22
22
 
23
23
  step = {
24
24
  'id' => test_step_idx,
25
- 'classname' => "SuiteID: #{$testId} Test Step: #{test_step_idx} #{test_desc}",
25
+ 'classname' => "SuiteID: #{$testId} Test Step: #{test_step_idx} "\
26
+ "#{test_desc}",
26
27
  'name' => test_desc,
27
28
  'file' => test_file_name
28
29
  }
@@ -49,7 +50,8 @@ module Report
49
50
  $testStepFailures += 1
50
51
  MyLog.log.info "Test #{test_step_idx} has FAILED ".red
51
52
  failstep = {
52
- 'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} Test has FAILED - Check logs",
53
+ 'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} Test has"\
54
+ ' FAILED - Check logs',
53
55
  'type' => 'FAILURE',
54
56
  'file' => test_file_name
55
57
  }
@@ -66,7 +68,8 @@ module Report
66
68
  $testStepNotrun += 1
67
69
  MyLog.log.info "Test #{test_step_idx} no checks performed ".blue
68
70
  skipstep = {
69
- 'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} No checks performed - Check logs",
71
+ 'message' => "SuiteID: #{$testId} Test Step: #{test_step_idx} No"\
72
+ ' checks performed - Check logs',
70
73
  'type' => 'SKIPPED',
71
74
  'file' => test_file_name
72
75
  }
@@ -7,7 +7,7 @@
7
7
  # 1.0 - Baseline
8
8
  #
9
9
  # logger.rb - logger file
10
-
10
+ # Logger function.
11
11
  module MyLog
12
12
  require_relative '../taf_config.rb'
13
13
  def self.log
@@ -3,7 +3,7 @@
3
3
  module Taf
4
4
  # This module holds the TAF version information.
5
5
  module Version
6
- STRING = '0.3.2'
6
+ STRING = '0.3.3'
7
7
 
8
8
  MSG = '%<version>s (using Parser %<parser_version>s, running on ' \
9
9
  '%<ruby_engine>s %<ruby_version>s %<ruby_platform>s)'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: taf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Perrett
@@ -164,7 +164,7 @@ dependencies:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
166
  version: '6.16'
167
- description: Test Automation Framework (TAF) to allow simple test web automation -
167
+ description: Test Automation Framework (TAF) to allow simple testweb automation -
168
168
  external use
169
169
  email:
170
170
  executables: