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 +4 -4
- data/lib/lhj/command/yapi/yapi_init.rb +7 -1
- data/lib/lhj/tools/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 636e87e8f38a49680d589ea0899a05f644debe88926734c8f7a2b0bb707e02a1
|
4
|
+
data.tar.gz: 170851d7bc279275151e72f6098d992aa728f5738f76075ade79b657e7a9ef03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
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
|
data/lib/lhj/tools/version.rb
CHANGED