itms_automation 1.9 → 2.0

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: b3cd33a56017874390bf06146259f97f12fb33f5d059e47d963671cc9f1a4ff3
4
- data.tar.gz: c61c4ffb48e9531d396673c45d4a25a6f29f02f189584c1f1dd4d66993c65ab3
3
+ metadata.gz: ef5b0f174d63ba42209fad531cd561dc3bf6398543f0fee23a3e90244871fc73
4
+ data.tar.gz: cefaf79a5d680b5dd9d1febe5a23a7d9add46c790328d98f84c707c6f09ad3dd
5
5
  SHA512:
6
- metadata.gz: 75ef344cee7343f2665b2aa87a35d1640dc4bca09936e46c0444f564f97926017337f7112c51f4c39613964754da1440df3a242a5d3f8f546c07619b8aa6c897
7
- data.tar.gz: c96a1255d27529709054fd2262faf4d3e8ea1e2fea33955b4df36277fa983c2e46c76facc278017fbba4302cf9899d8a3a191484d81ad3933a7b5c03094487b8
6
+ metadata.gz: e962ee90dd38c0487412b0814f958600acc01195909b010c7eaae2ccd8f7f9753bcc2420cf98fb45203185c669951fb46123769f29696d8bbd12e732e1e20d74
7
+ data.tar.gz: 9bfb98df8e2dc065c51e6345d70dcb5cd65982fb0340944a3252588a244839d6f6024905ba1e2f30aef9d8d7a00be398fdde680478a84d41d74a3527a44eb3dd
@@ -1,3 +1,3 @@
1
1
  module ItmsAutomation
2
- VERSION = "1.9"
2
+ VERSION = "2.0"
3
3
  end
@@ -16,6 +16,28 @@ def execute_openbrowser(url_site)
16
16
  end
17
17
  end
18
18
 
19
+ def clear_cookie()
20
+ start = Time.now
21
+ begin
22
+ browser = Capybara.current_session.driver.browser
23
+ if browser.respond_to?(:clear_cookies)
24
+ # Rack::MockSession
25
+ browser.clear_cookies
26
+ print_log("passed", start, _method_)
27
+ elsif browser.respond_to?(:manage) and browser.manage.respond_to?(:delete_all_cookies)
28
+ # Selenium::WebDriver
29
+ browser.manage.delete_all_cookies
30
+ print_log("passed", start, _method_)
31
+ else
32
+ print_log("failed", start, _method_)
33
+ raise "Error: Don't know how to clear cookies. Weird driver?"
34
+ end
35
+ rescue Exception => e
36
+ print_log("failed", start, _method_)
37
+ raise "Error: #{e.message}"
38
+ end
39
+ end
40
+
19
41
  def execute_click(element)
20
42
  start = Time.now
21
43
  foundElement = find_object(element)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itms_automation
3
3
  version: !ruby/object:Gem::Version
4
- version: '1.9'
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anh Pham