itms_automation 2.0 → 2.1

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: ef5b0f174d63ba42209fad531cd561dc3bf6398543f0fee23a3e90244871fc73
4
- data.tar.gz: cefaf79a5d680b5dd9d1febe5a23a7d9add46c790328d98f84c707c6f09ad3dd
3
+ metadata.gz: 22ff0afb795d8a0743046146c7c33211f2ba6713b08c8d163100905b15b365e4
4
+ data.tar.gz: fbd7065336f40f3891d6c78423804199b71088684c4a8ad55f4538016487bd66
5
5
  SHA512:
6
- metadata.gz: e962ee90dd38c0487412b0814f958600acc01195909b010c7eaae2ccd8f7f9753bcc2420cf98fb45203185c669951fb46123769f29696d8bbd12e732e1e20d74
7
- data.tar.gz: 9bfb98df8e2dc065c51e6345d70dcb5cd65982fb0340944a3252588a244839d6f6024905ba1e2f30aef9d8d7a00be398fdde680478a84d41d74a3527a44eb3dd
6
+ metadata.gz: e5f416aaec55dba549728e3083290d5d76064eb6ac88600550dfe9a794add4c08e403934b470eabd97579fa47bf432498626a3b84bad7ebe67102bb1b8bd5e1d
7
+ data.tar.gz: 1c1d9ad81b4f11ad8ae83eebdf4ba18e500cd579f5a1a5b61080b68a9da159447d94f8b7b08dc06a72522a10a4dfc1f6f434795e5a5294277a10eef940b8ba27
@@ -1,3 +1,3 @@
1
1
  module ItmsAutomation
2
- VERSION = "2.0"
2
+ VERSION = "2.1"
3
3
  end
@@ -23,17 +23,17 @@ def clear_cookie()
23
23
  if browser.respond_to?(:clear_cookies)
24
24
  # Rack::MockSession
25
25
  browser.clear_cookies
26
- print_log("passed", start, _method_)
26
+ print_log("passed", start, __method__)
27
27
  elsif browser.respond_to?(:manage) and browser.manage.respond_to?(:delete_all_cookies)
28
28
  # Selenium::WebDriver
29
29
  browser.manage.delete_all_cookies
30
- print_log("passed", start, _method_)
30
+ print_log("passed", start, __method__)
31
31
  else
32
- print_log("failed", start, _method_)
32
+ print_log("failed", start, __method__)
33
33
  raise "Error: Don't know how to clear cookies. Weird driver?"
34
34
  end
35
35
  rescue Exception => e
36
- print_log("failed", start, _method_)
36
+ print_log("failed", start, __method__)
37
37
  raise "Error: #{e.message}"
38
38
  end
39
39
  end
@@ -19,4 +19,28 @@ When /^Go to Test Cycle Sumary of iTMS project$/ do
19
19
  switch_to_iframe("iframe1")
20
20
  execute_click("itms_cyclesumarylink")
21
21
  sleep(3)
22
+ custom_action
22
23
  end
24
+
25
+
26
+ def custom_action()
27
+ begin
28
+ browser = Capybara.current_session.driver.browser
29
+ if browser.respond_to?(:clear_cookies)
30
+ # Rack::MockSession
31
+ browser.clear_cookies
32
+ print_log("passed", start, _method_)
33
+ elsif browser.respond_to?(:manage) and browser.manage.respond_to?(:delete_all_cookies)
34
+ # Selenium::WebDriver
35
+ browser.manage.delete_all_cookies
36
+ print_log("passed", start, _method_)
37
+ else
38
+ print_log("failed", start, _method_)
39
+ raise "Error: Don't know how to clear cookies. Weird driver?"
40
+ end
41
+ rescue Exception => e
42
+ print_log("failed", start, _method_)
43
+ raise "Error: #{e.message}"
44
+ end
45
+
46
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itms_automation
3
3
  version: !ruby/object:Gem::Version
4
- version: '2.0'
4
+ version: '2.1'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh Pham
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-13 00:00:00.000000000 Z
11
+ date: 2020-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: selenium-webdriver