amazon_auth 0.1.4 → 0.1.5

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: 435ea0526c11b6d7fe4cbba0d6ebe7e552a998f3
4
- data.tar.gz: 2365efdd3b8eb344ba290261b7b4fd12acbd97eb
3
+ metadata.gz: 9bb189eb92ba2db5dcf11bc40d40bda8bc490ea2
4
+ data.tar.gz: 2498a86f72cabefebef0682de2debe8697cf841d
5
5
  SHA512:
6
- metadata.gz: 5c0dd506e3afcecc1788fd3fb1920cec2df9204709961ddfb96399f03ac1732ec940d97d1fd78bde7d7e357117eebbd6a6ba2a94a15fdc00b58fdd61e29fa2a5
7
- data.tar.gz: b3983393dd83beca479aa6313ab7623d45e2a0f9b0e634c0089a533713ad0a14ee5f04059dc28cec5c1518b165b179c79a3f843a0a54567906d0f573d859a00e
6
+ metadata.gz: df882ca03728ed34c328f76cb4607836e1dda1185093fd7af1df4e40080ef746fbb72a5377a4dee5f1a3cc5d941c7f1060c75e69562a26e911578910c1f97da1
7
+ data.tar.gz: 2af1a90785ec4f78770feb83e90b141de50a1d155697c7dd213137ce03c5f7c3431bc66dee6c49b4d3e7293a17f9e6f87f2611ebe9d1127eb8c4ecb42bddec48
data/.gitignore CHANGED
@@ -10,3 +10,4 @@
10
10
  /.env
11
11
  /.env.development
12
12
  /.byebug_history
13
+ /.ruby-version
data/README.md CHANGED
@@ -47,6 +47,8 @@ If the browser doesn't work, try selenium-webdriver version '~> 2.0' or differen
47
47
  Run `amazon_auth` and paste the output to _.env_.
48
48
  (`AMAZON_USERNAME_CODE` , `AMAZON_PASSWORD_CODE` and `AMAZON_CODE_SALT`)
49
49
 
50
+ ![amazon_auth_setup](https://cloud.githubusercontent.com/assets/275284/25064607/9b9b80be-2238-11e7-95fc-c1547a83f178.gif)
51
+
50
52
  ### Run
51
53
 
52
54
  In console, you can move around pages using Capybara DSL
@@ -25,8 +25,9 @@ module AmazonAuth
25
25
  session.visit initial_url
26
26
  session.first('#a-autoid-0-announce').click
27
27
 
28
- fill_in_with_stroke('ap_email', @login)
29
- fill_in_with_stroke('ap_password', @password)
28
+ sleep_s
29
+ session.fill_in 'ap_email', with: @login
30
+ session.fill_in 'ap_password', with: @password
30
31
  session.click_on('signInSubmit')
31
32
 
32
33
  while alert_displayed? do
@@ -38,23 +39,14 @@ module AmazonAuth
38
39
  end
39
40
 
40
41
  def retry_sign_in
41
- fill_in_with_stroke('ap_password', @password)
42
+ session.fill_in 'ap_password', with: @password
42
43
  if image_recognition_displayed?
43
44
  input = ask "Got the prompt. Read characters from the image: "
44
- fill_in_with_stroke('auth-captcha-guess', input)
45
+ session.fill_in 'auth-captcha-guess', with: input
45
46
  end
46
47
  session.click_on('signInSubmit')
47
48
  end
48
49
 
49
- def fill_in_with_stroke(dom_id, value)
50
- sleep_s
51
- element = session.first("##{dom_id}")
52
- value.split(//u).each do |char|
53
- element.send_keys(char)
54
- sleep rand
55
- end
56
- end
57
-
58
50
  def alert_displayed?
59
51
  session.has_selector?('.a-alert-container')
60
52
  end
@@ -1,3 +1,3 @@
1
1
  module AmazonAuth
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amazon_auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kazuho Yamaguchi