Skip to content

Commit

Permalink
Merge pull request #13 from McPolemic/fix-chase
Browse files Browse the repository at this point in the history
Modify Chase to keep up with webpage changes
  • Loading branch information
searls authored Oct 1, 2017
2 parents 7a62947 + 408b401 commit 566c28f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/fine_ants/adapters/chase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ def initialize(credentials)

def login
visit "https://www.chase.com"

within_frame(find("#logonbox")) do
fill_in "Username", :with => @user
fill_in "Password", :with => @password
Expand All @@ -19,6 +20,7 @@ def login
sleep 0.1
click_on "Sign in"
end

verify_login!
end

Expand All @@ -30,15 +32,14 @@ def download
# Select credit card
find("h3", text: "CREDIT CARDS")
.find(:xpath, "../..")
.find("section")
.first("div")
.first(".account-tile")
.click

credit_card_table = find("table.dl-box")
credit_card_table = find("div.account")

balance = credit_card_table.find("#accountCurrentBalance").text
available_balance = credit_card_table.find("#accountAvailableCreditBalance").text
next_due_date = credit_card_table.find("#nextPaymentDueDate").text
balance = credit_card_table.find("#accountCurrentBalanceWithToolTipValue").text
available_balance = credit_card_table.find("#availableCreditWithTransferBalanceValue").text
next_due_date = credit_card_table.find("#nextPaymentDueDateValue").text

accounts = [
{
Expand Down Expand Up @@ -68,7 +69,7 @@ def parse_due_date(due_date_string)
end

def verify_login!
find '[data-attr="LOGON_DETAILS.lastLogonDetailsLabel"]'
find "#logonDetailsContainer"
rescue Capybara::ElementNotFound
raise FineAnts::LoginFailedError.new
end
Expand Down

0 comments on commit 566c28f

Please sign in to comment.