testcentricity_web 0.3.0 → 0.3.7
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5c975046093d3f1df905a8eccdaa96d489f2e3a
|
4
|
+
data.tar.gz: 48048165acc5ddde21fe93fd351c064a70bc464e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b05177cdae2a2e9ab69bd445cf78a4748285281e08d9dae574d9484877de4a5532e76cf9c0104ec2caff7cd89202b75aead2c20b11ad3d7270df0c070025168
|
7
|
+
data.tar.gz: 5ea51dd85b38b6400f8e7a56a7ff264873e70affeea6d6434c834a45215a2f6d1b4ef17d4b839407bf07d91c73c3065c4c6c729b3f16194657823a4c8efbeffb
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module TestCentricity
|
2
|
-
|
2
|
+
module Browsers
|
3
3
|
include Capybara::DSL
|
4
4
|
|
5
5
|
# Resize selenium browser window to avoid Selenium::WebDriver::Error::MoveTargetOutOfBoundsError errors
|
@@ -21,35 +21,35 @@ module TestCentricity
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.refresh_browser
|
24
|
-
page.driver.browser.navigate.refresh
|
24
|
+
Capybara.page.driver.browser.navigate.refresh
|
25
25
|
end
|
26
26
|
|
27
27
|
def self.switch_to_new_browser_instance
|
28
|
-
page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
|
28
|
+
Capybara.page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
|
29
29
|
end
|
30
30
|
|
31
31
|
def self.close_all_browser_instances
|
32
|
-
page.driver.browser.window_handles.each do |handle|
|
32
|
+
Capybara.page.driver.browser.window_handles.each do |handle|
|
33
33
|
page.driver.browser.switch_to.window(handle)
|
34
34
|
page.driver.browser.close
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.close_current_browser_window
|
39
|
-
page.driver.browser.close
|
40
|
-
page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
|
39
|
+
Capybara.page.driver.browser.close
|
40
|
+
Capybara.page.driver.browser.switch_to.window(Capybara.page.driver.browser.window_handles.last)
|
41
41
|
end
|
42
42
|
|
43
43
|
def self.close_old_browser_instance
|
44
|
-
page.driver.browser.switch_to.window(page.driver.browser.window_handles.first)
|
45
|
-
page.driver.browser.close
|
46
|
-
page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
|
44
|
+
Capybara.page.driver.browser.switch_to.window(Capybara.page.driver.browser.window_handles.first)
|
45
|
+
Capybara.page.driver.browser.close
|
46
|
+
Capybara.page.driver.browser.switch_to.window(Capybara.page.driver.browser.window_handles.last)
|
47
47
|
end
|
48
48
|
|
49
49
|
def self.close_named_browser_instance(name)
|
50
|
-
page.driver.browser.switch_to.window(page.driver.find_window(name))
|
51
|
-
page.driver.browser.close
|
52
|
-
page.driver.browser.switch_to.window(page.driver.browser.window_handles.last)
|
50
|
+
Capybara.page.driver.browser.switch_to.window(Capybara.page.driver.find_window(name))
|
51
|
+
Capybara.page.driver.browser.close
|
52
|
+
Capybara.page.driver.browser.switch_to.window(Capybara.page.driver.browser.window_handles.last)
|
53
53
|
end
|
54
54
|
|
55
55
|
def self.delete_all_cookies
|
@@ -228,7 +228,7 @@ module TestCentricity
|
|
228
228
|
test_value = value.split('!', 2)
|
229
229
|
parameter = test_value[1].split('.', 2)
|
230
230
|
case parameter[0]
|
231
|
-
when 'Address', 'Business', 'Code', '
|
231
|
+
when 'Address', 'Business', 'Code', 'Color', 'Commerce', 'Company', 'Hacker', 'Internet', 'Lorem', 'Name', 'Number', 'PhoneNumber'
|
232
232
|
result = eval("Faker::#{parameter[0]}.#{parameter[1]}")
|
233
233
|
when 'Date'
|
234
234
|
result = eval("Chronic.parse('#{parameter[1]}')")
|
@@ -5,14 +5,14 @@ module TestCentricity
|
|
5
5
|
def self.enqueue_assert_equal(expected, actual, error_message)
|
6
6
|
unless expected == actual
|
7
7
|
@error_queue = "#{@error_queue}#{error_message} to be\n #{expected}\nbut found\n #{actual}\n\n"
|
8
|
-
screen_shot_and_save_page
|
8
|
+
screen_shot_and_save_page
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
12
|
def self.enqueue_assert_not_equal(expected, actual, error_message)
|
13
13
|
unless expected != actual
|
14
14
|
@error_queue = "#{@error_queue}#{error_message} to not be equal to #{expected}\n\n"
|
15
|
-
screen_shot_and_save_page
|
15
|
+
screen_shot_and_save_page
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -26,4 +26,17 @@ module TestCentricity
|
|
26
26
|
@error_queue = nil
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
private
|
31
|
+
|
32
|
+
|
33
|
+
def self.screen_shot_and_save_page
|
34
|
+
timestamp = Time.now.strftime('%Y%m%d%H%M%S')
|
35
|
+
filename = "Screenshot-#{timestamp}"
|
36
|
+
path = File.join Dir.pwd, "reports/screenshots/", filename
|
37
|
+
save_screenshot "#{path}.png"
|
38
|
+
puts "Screenshot saved at #{path}.png"
|
39
|
+
screen_shot = { :path => path, :filename => filename }
|
40
|
+
Environ.save_screen_shot(screen_shot)
|
41
|
+
end
|
29
42
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: testcentricity_web
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- A.J. Mrozinski
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|