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
parent
7cab766c38
commit
58f417aea9
11
xactfetch.py
11
xactfetch.py
|
@ -551,15 +551,14 @@ class Chase:
|
|||
log.debug('Waiting for page to load completely')
|
||||
self.page.get_by_role('link', name='Sort Options').wait_for()
|
||||
self.page.wait_for_timeout(random.randint(1500, 2500))
|
||||
s = self.page.locator('#downloadActivityIcon')
|
||||
s.wait_for()
|
||||
self.page.wait_for_timeout(random.randint(1500, 2500))
|
||||
log.debug('Clicking "Download account activity" button')
|
||||
s.click()
|
||||
href = '#/dashboard/accountDetails/downloadAccountTransactions/index'
|
||||
self.page.evaluate(f'window.location.href = "{href}";')
|
||||
log.debug('Waiting for page to load')
|
||||
s = self.page.locator('button#select-downloadActivityOptionId')
|
||||
s.wait_for()
|
||||
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()
|
||||
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.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(
|
||||
'button', name='Download', exact=True
|
||||
).click()
|
||||
|
|
Loading…
Reference in New Issue