Ifd_Mobile 1.0.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 +4 -4
- data/lib/Ifd_Mobile/methods/required_files.rb +11 -12
- data/lib/Ifd_Mobile/version.rb +1 -1
- data/project/features/TestSuite/login.feature +0 -1
- data/project/features/support/env.rb +8 -0
- data/project/features/support/project_config.yml +2 -2
- metadata +2 -4
- data/lib/Ifd_Mobile/methods/database_methods.rb +0 -25
- data/lib/Ifd_Mobile/methods/lib_schema_data_steps.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2bc0c93dd5cba25c44ff9ccea1c48cb175000406
|
4
|
+
data.tar.gz: de898685b4c9ff6b275a6033143d550620c08419
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 976c2fa5ce4adc3ccd15ba37f5b9127569f66a8fc727580e8d91a53b13a3b834436ec35372e6e15ecf4455cfcab26e99ec0bfb680980a0728d462d4e468d3e1f
|
7
|
+
data.tar.gz: 1f4c8cc5c4a3d0d6e42a31059f435c2f7fd1e17f75d57b32c7cf9b1e5411137b9d7752898e59dde2eaead83dc4b8be58344688465ca531955223113c5f0adffc
|
@@ -1,14 +1,15 @@
|
|
1
1
|
require 'rubygems'
|
2
|
-
require 'selenium-webdriver'
|
3
|
-
require 'open-uri'
|
4
|
-
require 'rbconfig'
|
5
|
-
require 'appium_lib'
|
6
|
-
require 'rubygems'
|
7
|
-
require 'yaml'
|
8
|
-
require 'cucumber'
|
9
|
-
require 'rack/utf8_sanitizer'
|
10
|
-
require 'net/https'
|
11
|
-
require 'rspec/expectations'
|
2
|
+
# require 'selenium-webdriver'
|
3
|
+
# require 'open-uri'
|
4
|
+
# require 'rbconfig'
|
5
|
+
# require 'appium_lib'
|
6
|
+
# require 'rubygems'
|
7
|
+
# require 'yaml'
|
8
|
+
# require 'cucumber'
|
9
|
+
# require 'rack/utf8_sanitizer'
|
10
|
+
# require 'net/https'
|
11
|
+
# require 'rspec/expectations'
|
12
|
+
require 'Ifd_Mobile'
|
12
13
|
include RbConfig
|
13
14
|
|
14
15
|
require_relative 'core'
|
@@ -16,6 +17,4 @@ require_relative 'IFD_Assertion'
|
|
16
17
|
require_relative 'lib_var'
|
17
18
|
require_relative 'IFD_Assertion'
|
18
19
|
require_relative 'IFD_Connection'
|
19
|
-
require_relative 'lib_schema_data_steps'
|
20
|
-
|
21
20
|
|
data/lib/Ifd_Mobile/version.rb
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
require 'rspec/expectations'
|
2
2
|
require 'appium_lib'
|
3
3
|
require 'cucumber/ast'
|
4
|
+
require 'selenium-webdriver'
|
5
|
+
require 'open-uri'
|
6
|
+
require 'rbconfig'
|
7
|
+
require 'rubygems'
|
8
|
+
require 'yaml'
|
9
|
+
require 'cucumber'
|
10
|
+
require 'rack/utf8_sanitizer'
|
11
|
+
require 'net/https'
|
4
12
|
require 'Ifd_Mobile'
|
5
13
|
$current_dir = File.expand_path(File.dirname(__FILE__))
|
6
14
|
$base_dir = File.expand_path(File.dirname(__FILE__) + '/../..')
|
@@ -2,7 +2,7 @@ capabilities:
|
|
2
2
|
platformName: android
|
3
3
|
deviceName: 192.168.56.101:5555
|
4
4
|
platformVersion: 4.4.4
|
5
|
-
app: C:/Users/anhpham2710/Desktop/
|
5
|
+
app: C:/Users/anhpham2710/Desktop/mobile/project/apps/android-2016.apk
|
6
6
|
|
7
|
-
server_url: http://192.168.2.
|
7
|
+
server_url: http://192.168.2.122:1234/wd/hub
|
8
8
|
wait_time: 2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Ifd_Mobile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
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-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber
|
@@ -74,10 +74,8 @@ extra_rdoc_files: []
|
|
74
74
|
files:
|
75
75
|
- lib/Ifd_Mobile/lib_steps.rb
|
76
76
|
- lib/Ifd_Mobile/methods/core.rb
|
77
|
-
- lib/Ifd_Mobile/methods/database_methods.rb
|
78
77
|
- lib/Ifd_Mobile/methods/IFD_Assertion.rb
|
79
78
|
- lib/Ifd_Mobile/methods/IFD_Connection.rb
|
80
|
-
- lib/Ifd_Mobile/methods/lib_schema_data_steps.rb
|
81
79
|
- lib/Ifd_Mobile/methods/lib_var.rb
|
82
80
|
- lib/Ifd_Mobile/methods/required_files.rb
|
83
81
|
- lib/Ifd_Mobile/version.rb
|
@@ -1,25 +0,0 @@
|
|
1
|
-
class DatabaseMethods
|
2
|
-
def self.execute_select (schema,sql)
|
3
|
-
case $db_type.to_sym
|
4
|
-
when :sql_server then
|
5
|
-
conn = IFD_Connections.get_sql_server_db_connection(schema)
|
6
|
-
conn.execute sql
|
7
|
-
when :mysql then
|
8
|
-
conn = IFD_Connections.get_mysql_db_connection(schema)
|
9
|
-
conn.query sql
|
10
|
-
else
|
11
|
-
raise "*** ERROR: schema type (#{$db_type}) is not supported (SQL SERVER, MY SQL)."
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def self.close_connection (schema)
|
16
|
-
case $db_type.to_sym
|
17
|
-
when :sql_server then
|
18
|
-
conn = IFD_Connections.get_sql_server_db_connection(schema)
|
19
|
-
conn.close
|
20
|
-
when :mysql then
|
21
|
-
conn = IFD_Connections.get_mysql_db_connection(schema)
|
22
|
-
conn.close
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
require_relative 'methods/required_files'
|
2
|
-
#====================================
|
3
|
-
# INTERACTION STEPS
|
4
|
-
#====================================
|
5
|
-
# Step used to execute a SQL script on a specific schema
|
6
|
-
And /^I run sql script "([^\"]*)" on "([^\"]*)" schema$/ do |script, schema|
|
7
|
-
begin
|
8
|
-
sql = "#{script}"
|
9
|
-
DatabaseMethods.execute_select(schema, sql)
|
10
|
-
DatabaseMethods.close_connection(schema)
|
11
|
-
ensure
|
12
|
-
end
|
13
|
-
end
|
14
|
-
# Step used to execute SQL script from SQL file on specific schema
|
15
|
-
Given /^I run sql script from file "([^\"]*)" on "([^\"]*)" schema$/ do |sql_script, schema|
|
16
|
-
if sql_script != nil and sql_script != ""
|
17
|
-
begin
|
18
|
-
File.readlines($sql_dir + sql_script).each do |line|
|
19
|
-
if line.nil? || line =~ /^\s*\n*--/
|
20
|
-
# puts "\nSQL: " + line;
|
21
|
-
next;
|
22
|
-
end
|
23
|
-
line = line.strip();
|
24
|
-
line = line[0..-2];
|
25
|
-
#puts "\nSQL: " + line;
|
26
|
-
DatabaseMethods.execute_select(schema, line)
|
27
|
-
sleep(1);
|
28
|
-
end
|
29
|
-
DatabaseMethods.close_connection(schema)
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
# Step used to check if data exists in database or not with condition in file
|
35
|
-
Then /^I should ( not)? see data in schema "(.*)" database with SQL query in file "(.*)"$/ do |negative, schema, file|
|
36
|
-
sql = File.read($sql_dir + file)
|
37
|
-
filepath = ($sql_dir + file)
|
38
|
-
if File.exist?(filepath)
|
39
|
-
begin
|
40
|
-
rs = DatabaseMethods.execute_select(schema, sql)
|
41
|
-
obj_array = Array.new
|
42
|
-
rs.each { |row|
|
43
|
-
row.each_pair { |col, value|
|
44
|
-
assert(false) if negative.nil? && value == 0 || !negative.nil? && value == 1
|
45
|
-
}
|
46
|
-
}
|
47
|
-
ensure
|
48
|
-
DatabaseMethods.close_connection(schema)
|
49
|
-
end
|
50
|
-
else
|
51
|
-
raise "*** ERROR: Please check #{filepath} exists."
|
52
|
-
end
|
53
|
-
end
|