selenium-framework 1.0.2 → 1.0.3
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.
- data/LICENSE +1 -1
- data/bin/copyfiles/project_file.rb +3 -1
- data/lib/selenium-framework.rb +4 -0
- data/lib/userextension/user_extension.rb +2 -1
- data/lib/userextension/utilities.rb +18 -0
- metadata +2 -1
data/LICENSE
CHANGED
@@ -8,7 +8,7 @@ class Project < Test::Unit::TestCase
|
|
8
8
|
$report_file = PreRequisite.create_report_file(Dir.pwd.to_s, build_path)
|
9
9
|
$log_file = PreRequisite.create_log_file(Dir.pwd.to_s, build_path)
|
10
10
|
|
11
|
-
SeleniumConfig = YAML.load_file(Dir.pwd.to_s + '/
|
11
|
+
SeleniumConfig = YAML.load_file(Dir.pwd.to_s + '/libraries/selenium-framework.yml')
|
12
12
|
|
13
13
|
def setup
|
14
14
|
client = Selenium::WebDriver::Remote::Http::Default.new
|
@@ -19,6 +19,8 @@ class Project < Test::Unit::TestCase
|
|
19
19
|
@verification_errors = []
|
20
20
|
end
|
21
21
|
|
22
|
+
# Write the testcases here:
|
23
|
+
|
22
24
|
def teardown
|
23
25
|
$driver.quit
|
24
26
|
assert_equal [], @verification_errors
|
data/lib/selenium-framework.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'selenium-framework'
|
2
2
|
require 'userextension/user_extension.rb'
|
3
3
|
require 'userextension/pre_requisite.rb'
|
4
|
+
require 'userextension/utilities.rb'
|
4
5
|
require 'modules/login/login.rb'
|
5
6
|
require 'time'
|
6
7
|
require 'fileutils'
|
@@ -8,5 +9,8 @@ require 'csv'
|
|
8
9
|
require 'faker'
|
9
10
|
require 'headless'
|
10
11
|
require 'yaml'
|
12
|
+
require 'rubygems'
|
13
|
+
require 'zip/zip'
|
14
|
+
require 'find'
|
11
15
|
|
12
16
|
|
@@ -134,7 +134,8 @@ class UserExtension
|
|
134
134
|
end
|
135
135
|
end
|
136
136
|
|
137
|
-
|
137
|
+
# Call this function this way "current_timestamp".
|
138
|
+
# This function will return the current timestamp.
|
138
139
|
def self.current_timestamp
|
139
140
|
timestamp = Time.now
|
140
141
|
timestamp = timestamp.strftime("%d-%m-%Y-%H-%M-%S")
|
@@ -0,0 +1,18 @@
|
|
1
|
+
class Utility
|
2
|
+
|
3
|
+
def self.zip(dir, zip_dir, remove_after = false)
|
4
|
+
Zip::ZipFile.open(zip_dir, Zip::ZipFile::CREATE)do |zipfile|
|
5
|
+
Find.find(dir) do |path|
|
6
|
+
Find.prune if File.basename(path)[0] == ?.
|
7
|
+
dest = /#{dir}\/(\w.*)/.match(path)
|
8
|
+
# Skip files if they exists
|
9
|
+
begin
|
10
|
+
zipfile.add(dest[1],path) if dest
|
11
|
+
rescue Zip::ZipEntryExistsError
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
FileUtils.rm_rf(dir) if remove_after
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: selenium-framework
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -140,6 +140,7 @@ files:
|
|
140
140
|
- bin/copyfiles/include.rb
|
141
141
|
- bin/copyfiles/project_file.rb
|
142
142
|
- lib/userextension/pre_requisite.rb
|
143
|
+
- lib/userextension/utilities.rb
|
143
144
|
- LICENSE
|
144
145
|
- README.md
|
145
146
|
- bin/testframe
|