1
0
Fork 0

chase: Go directly to the download page

When there are no transactions in the default display, the *Download
account activity* button is disabled.  To avoid failing in this case, we
now navigate directly to the download page.  This requires explicitly
selecting the credit card account from the dropdown list, as it is not
pre-filled when the page is loaded directly.
master
Dustin 2023-05-11 22:55:42 -05:00
parent 7cab766c38
commit 58f417aea9
1 changed files with 5 additions and 6 deletions

View File

@ -551,15 +551,14 @@ class Chase:
log.debug('Waiting for page to load completely') log.debug('Waiting for page to load completely')
self.page.get_by_role('link', name='Sort Options').wait_for() self.page.get_by_role('link', name='Sort Options').wait_for()
self.page.wait_for_timeout(random.randint(1500, 2500)) self.page.wait_for_timeout(random.randint(1500, 2500))
s = self.page.locator('#downloadActivityIcon') href = '#/dashboard/accountDetails/downloadAccountTransactions/index'
s.wait_for() self.page.evaluate(f'window.location.href = "{href}";')
self.page.wait_for_timeout(random.randint(1500, 2500))
log.debug('Clicking "Download account activity" button')
s.click()
log.debug('Waiting for page to load') log.debug('Waiting for page to load')
s = self.page.locator('button#select-downloadActivityOptionId') s = self.page.locator('button#select-downloadActivityOptionId')
s.wait_for() s.wait_for()
log.debug('Filling account activity download form') log.debug('Filling account activity download form')
self.page.locator('button#select-account-selector').click()
self.page.get_by_text('CREDIT CARD').nth(1).locator('../..').click()
s.click() s.click()
self.page.get_by_text('Choose a date range').nth(1).locator( self.page.get_by_text('Choose a date range').nth(1).locator(
'../..' '../..'
@ -575,7 +574,7 @@ class Chase:
) )
self.page.locator('#accountActivityToDate-input-input').blur() self.page.locator('#accountActivityToDate-input-input').blur()
self.page.wait_for_timeout(random.randint(500, 1500)) self.page.wait_for_timeout(random.randint(500, 1500))
with self.page.expect_download() as di: with self.page.expect_download(timeout=5000) as di:
self.page.get_by_role( self.page.get_by_role(
'button', name='Download', exact=True 'button', name='Download', exact=True
).click() ).click()