Ifd_Automation 1.0 → 1.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cf8197d6e8c9e6d71497dfa40f7c68356c6d7014
4
- data.tar.gz: ea18647e8f0acb25f8ab447e7553bd56060e3d13
3
+ metadata.gz: 55806978fd18343ef117c9d5289318596aa815d6
4
+ data.tar.gz: 5b1ffad2419aaa188816241c79533c30a2d1290a
5
5
  SHA512:
6
- metadata.gz: 40a0325fde1a9639cb46d61ac440df82eeb0ea732118d0a7cea5039903d9f416fa7369f72be817cbc84f7596a26502b07381e74163b64fa6067c4752664f63b5
7
- data.tar.gz: 028f7bff9378b7a7cef466bd583548a8380c5f0ed19d18839948b9392d9887dd234680cf1474009d0b7c0f2e59d5083706a387160944932d01173ff54395371d
6
+ metadata.gz: 06075b99a853adc480dcea447e58f82f109f27a9cd649dadfcf52a9d38cd8c6d5febfe357359aab8f869561b620e18fba38adcfb5816d6a9b90f0744076cf222
7
+ data.tar.gz: 79b33f74f0debf6d0bd8c144c3ee40c3abc4254546d77678f05d8fff83ed6a78e828a188ce157ec55f04ae593d581401ba5318c6a26983b7164543443bce4d11
@@ -13,7 +13,8 @@ And /^I run sql script "([^\"]*)" on "([^\"]*)" schema$/ do |script, schema|
13
13
  end
14
14
  # Step used to execute SQL script from SQL file on specific schema
15
15
  Given /^I run sql script from file "([^\"]*)" on "([^\"]*)" schema$/ do |sql_script, schema|
16
- if sql_script != nil and sql_script != ""
16
+ expected_data = ($sql_dir + sql_script)
17
+ if File.exist?(expected_data)
17
18
  begin
18
19
  File.readlines($sql_dir + sql_script).each do |line|
19
20
  if line.nil? || line =~ /^\s*\n*--/
@@ -26,8 +27,12 @@ Given /^I run sql script from file "([^\"]*)" on "([^\"]*)" schema$/ do |sql_scr
26
27
  DatabaseMethods.execute_select(schema, line)
27
28
  sleep(1);
28
29
  end
30
+ puts "*** INFORMATION: #{sql_script} is executed successfully."
29
31
  DatabaseMethods.close_connection(schema)
32
+ ensure
30
33
  end
34
+ else
35
+ puts "*** WARNING: #{sql_script} does not exist."
31
36
  end
32
37
  end
33
38
  #====================================
@@ -13,6 +13,7 @@ end
13
13
 
14
14
  # Find object by Xpath
15
15
  def find_object string_object
16
+ object = YAML.load_file("#{File.expand_path(File.dirname(__FILE__) + '/..')}/step_definitions/repositories/project_object.yml")
16
17
  startTime = Time.new.to_i
17
18
  string_object = string_object.gsub(/"/, "'")
18
19
  # puts "String_object: #{string_object}"
@@ -27,7 +28,7 @@ def find_object string_object
27
28
  end
28
29
 
29
30
  # put_log "\n---dyn_pros: #{dyn_pros}"
30
- hash_object = $_RP_OBJECT[string_object]
31
+ hash_object = object[string_object]
31
32
  if hash_object == nil
32
33
  put_log ">>> OBJECT NAME MAYBE NOT FOUND!!!"
33
34
  # true.should eq false
@@ -1,5 +1,5 @@
1
1
  module Ifd
2
2
  module Automation
3
- VERSION = '1.0'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -0,0 +1 @@
1
+ textbox_username: {xpath_selector: '//*[@id="login_user"]'}
@@ -28,7 +28,7 @@ $selenium_grid_url = PROJECT_CONFIG['selenium_grid']
28
28
  $data_source_username = PROJECT_CONFIG['data_source_username']
29
29
  $data_source_password = PROJECT_CONFIG['data_source_password']
30
30
  $data_source_url = PROJECT_CONFIG['data_source_url']
31
- $db_type = PROJECT_CONFIG['sql_server']
31
+ $db_type = PROJECT_CONFIG['db_type']
32
32
  $WS_URL = PROJECT_CONFIG['WS_URL']
33
33
  $SEND_EMAIL_ADDRESS = PROJECT_CONFIG['SEND_EMAIL_USERNAME']
34
34
  $SEND_EMAIL_PASSWORD = PROJECT_CONFIG['SEND_EMAIL_PASSWORD']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Ifd_Automation
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.0'
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh Pham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-06 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cucumber
@@ -121,11 +121,10 @@ files:
121
121
  - bin/Ifd_Automation
122
122
  - project/config/cucumber.yml
123
123
  - project/features/step_definitions/lib_steps/login_steps.rb
124
- - project/features/step_definitions/repositories/ob_login.rb
124
+ - project/features/step_definitions/repositories/project_object.yml
125
125
  - project/features/support/env.rb
126
126
  - project/features/support/hooks.rb
127
127
  - project/features/support/project_config.yml
128
- - project/features/support/project_env.rb
129
128
  - project/features/TestData/actual_images/infodation.jpg
130
129
  - project/features/TestData/DownloadFolder/test.txt
131
130
  - project/features/TestData/ExpectedDataFile/test.txt
@@ -137,9 +136,7 @@ files:
137
136
  - project/features/TestSuite/Login/login.feature
138
137
  - project/Gemfile
139
138
  - project/Gemfile.lock
140
- - project/project_config.yml
141
139
  - project/Rakefile
142
- - project/test.rb
143
140
  homepage: https://rubygems.org/gems/ifd_automation
144
141
  licenses:
145
142
  - MIT
@@ -1,3 +0,0 @@
1
- $_RP_OBJECT['textbox_username'] = {xpath_selector: '//*[@id="login_user"]'}
2
- $_RP_OBJECT['textbox_password'] = {xpath_selector: '//*[@id="login_pass"]'}
3
- $_RP_OBJECT['button_login'] = {xpath_selector: '//*[@id="wp-submit"]'}
@@ -1,51 +0,0 @@
1
- # $_CFWEB = Hash.new
2
- # ###################################################################
3
- # # BROWSER CONFIGURATION #
4
- # ###################################################################
5
- # #---------------------------
6
- # # :firefox=> "FireFox"
7
- # # :internet_explorer => "Internet Explorer"
8
- # # :chrome => "Chrome"
9
- # #---------------------------
10
- # $_CFWEB['Print Log'] = true
11
- # $_CFWEB['Default Browser'] = :firefox
12
- # $_CFWEB['Wait Time'] = 30
13
- # $_CFWEB['Maximize Browser'] = true
14
- # STDOUT.sync = true
15
- # ###################################################################
16
- # # EDITABLE CONFIGURATION #
17
- # ###################################################################
18
- # $_CFWEB['Download Dir'] = "#{$test_data_dir}DownloadFolder/"
19
- # $_CFWEB['Expected Data Dir'] = "#{$test_data_dir}/ExpectedDataFile/"
20
- # $test_data_dir = $base_dir + '/features/TestData/'
21
- # $sql_dir = $base_dir + '/features/TestData/SqlScript/'
22
- # $testdata = YAML.load_file("#{$test_data_dir}/globalData.yml")
23
- # $_CFWEB['Page Address'] = 'http://google.com/'
24
- # $selenium_grid_url='http://10.5.1.202:5555/wd/hub'
25
- # ###################################################################
26
- # # DATABASE CONFIGURATION #
27
- # ###################################################################
28
- # #-----------------------------------------------------------------
29
- # # $db_type=> "sql_server" || "mysql"
30
- # #-----------------------------------------------------------------
31
- # $data_source_username = ''
32
- # $data_source_password = ''
33
- # $data_source_url = ''
34
- # $db_type='sql_server'
35
- # ###################################################################
36
- # # WEBSERVICE CONFIGURATION #
37
- # ###################################################################
38
- # $WS_URL = 'http://...'
39
- # ###################################################################
40
- # # EMAIL CONFIGURATION #
41
- # ###################################################################
42
- # $SEND_EMAIL_USERNAME=''
43
- # $SEND_EMAIL_PASSWORD=''
44
- # $SEND_EMAIL_DOMAIN='gmail.com'
45
- # $SEND_EMAIL_ADDRESS='smtp.gmail.com'
46
- # $SEND_EMAIL_PORT= 25
47
- # #------------------------------------------------------------------
48
- # $RECEIVE_EMAIL_USERNAME=''
49
- # $RECEIVE_EMAIL_PASSWORD=''
50
- # $RECEIVE_EMAIL_ADDRESS='pop.gmail.com'
51
- # $RECEIVE_EMAIL_PORT=995
@@ -1,3 +0,0 @@
1
- #################### TEST DATA FOR LOGIN ACCOUNT
2
- username: anh.pham@infodation.vn
3
- password: anhanh
data/project/test.rb DELETED
@@ -1,6 +0,0 @@
1
- require 'yaml'
2
-
3
- PROJECT_CONFIG = YAML.load_file("project_config.yml")
4
- sTestDataidArr = ('username').downcase
5
- testdata = PROJECT_CONFIG[sTestDataidArr]
6
- puts (testdata)