lhj-tools 0.1.88 → 0.1.89

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: add25469f790212700cc67823a7a1709bd5dc530b3d954d0ce33b133e59d8429
4
- data.tar.gz: 662a20b818f0f57a2d0eee758c8165021cd73fe44b18ad405a63f8a4f3c0fab7
3
+ metadata.gz: 636e87e8f38a49680d589ea0899a05f644debe88926734c8f7a2b0bb707e02a1
4
+ data.tar.gz: 170851d7bc279275151e72f6098d992aa728f5738f76075ade79b657e7a9ef03
5
5
  SHA512:
6
- metadata.gz: b7e0e45bbb6c9fb2af985537440ae9de3a34d3beeac5337670814a5ba3f8b1b324c301ee27211d029b9d2abe283d4292a35dfcd89fb80eb799c033242af2b631
7
- data.tar.gz: 8d47349754781091db87c22003f853373e94a0a0e3a3f2bae932b4e33656d9a21f2fdde54523d140cd270a466cf4705770a5c73a85f3a6b7da8c08fc2ca4c931
6
+ metadata.gz: 1af599df60ad3ad1a91059d55d13971e52de3f081ed365c5fa66ea3a8f7e438a16cf7dd6ffd7724a29c8166dbc338a00e430e13eb53eb6213639a638034121f7
7
+ data.tar.gz: ea2ae987669a7a1a1a925c94e53e96db6bf40c553ade5970fcef9f74fba577840a627a76c2d0ae9ed01248612234c455a8e6d063b8f1391f9041279c11aa5902
@@ -12,14 +12,16 @@ module Lhj
12
12
  driver = Selenium::WebDriver.for(:chrome, capabilities: options)
13
13
  driver.get url
14
14
  manage = driver.manage
15
+ window = manage.window
15
16
  manage.timeouts.implicit_wait = 10
16
17
  manage.timeouts.page_load = 10
17
18
  # 1.登录
18
19
  all_btn = driver.all(tag_name: 'button')
19
20
  login_btn = all_btn.find { |ele| ele.text =~ /钉钉登录/ } if all_btn
20
21
  login_btn&.click
22
+ window.resize_to(200, 500)
21
23
  # 2.获取cookies
22
- wait = Selenium::WebDriver::Wait.new(timeout: 60)
24
+ wait = Selenium::WebDriver::Wait.new(timeout: 90)
23
25
  need_notify = true
24
26
  wait.until do
25
27
  res = {}
@@ -29,6 +31,10 @@ module Lhj
29
31
  res[:token] = cookie[:value] if cookie[:name] == '_yapi_token'
30
32
  end
31
33
  if need_notify
34
+ file_name = 'qrcode.png'
35
+ file = File.join(Lhj::Config.instance.home_dir, file_name)
36
+ driver.save_screenshot(file)
37
+ Lhj::OSS::Helper.instance.upload(file_name, file)
32
38
  notify_robot(driver.current_url)
33
39
  need_notify = false
34
40
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lhj
4
4
  module Tools
5
- VERSION = "0.1.88"
5
+ VERSION = "0.1.89"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lhj-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.88
4
+ version: 0.1.89
5
5
  platform: ruby
6
6
  authors:
7
7
  - lihaijian