README.md in amazon_auth-0.3.3 vs README.md in amazon_auth-0.4.0
- old
+ new
@@ -4,10 +4,11 @@
[](https://travis-ci.org/kyamaguchi/amazon_auth)
Sign In Amazon using Capybara and Selenium

+
Recorded with [Recordit](http://recordit.co/)
## Installation
Add this line to your application's Gemfile:
@@ -46,10 +47,26 @@
Run `amazon_auth` and paste the output to _.env_.
(`AMAZON_USERNAME_CODE` , `AMAZON_PASSWORD_CODE` and `AMAZON_CODE_SALT`)

+### envchain for security
+
+You can store environment variables in macOS Keychain instead of dotenv.
+Check out [envchain](https://github.com/sorah/envchain)
+
+```
+brew install envchain
+
+envchain --set amazon AMAZON_DOMAIN AMAZON_USERNAME_CODE AMAZON_PASSWORD_CODE AMAZON_CODE_SALT
+
+# Run console with envchain
+envchain amazon bin/console
+envchain amazon bundle exec irb
+envchain amazon rails console
+```
+
### Run
In console, you can move around pages using Capybara DSL
```ruby
@@ -71,10 +88,24 @@
Set `AMAZON_DOMAIN` in _.env_.
e.g. `AMAZON_DOMAIN=amazon.co.jp` for Japanese site
+### Keep cookies
+
+Using [capybara-sessionkeeper gem](https://github.com/kyamaguchi/capybara-sessionkeeper)
+
+```
+client = AmazonAuth::Client.new(keep_cookie: true, debug: true)
+```
+
+You can change Capyabra.save_path when it isn't set
+
+```
+client = AmazonAuth::Client.new(keep_cookie: true, save_path: 'tmp/cookies', debug: true)
+```
+
### Logging
Normal logging
```ruby
@@ -107,9 +138,13 @@
In console,
```
client = AmazonAuth::Client.new(driver: :firefox)
```
+
+## TODO
+
+- [Idea] Hook `submit_signin_form` after every `visit` and `click` action
## Development
Use _.env.development_ instead of _.env_ in development.