Skip to content

Commit

Permalink
certified copy affidavit test fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
tareq89 committed Jan 2, 2025
1 parent 988aafc commit b66d22b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,15 @@ test.describe.serial('7.0 Validate collect payment page', () => {
})

test('6.2 Should be able to add file and navigate to the "Ready to certify?" page.', async () => {
await uploadImage(
page,
page.locator('input[name="affidavitFile"][type="file"]')
)
const path = require('path')
const attachmentPath = path.resolve(__dirname, './528KB-random.png')
const inputFile = await page.locator(
'input[name="affidavitFile"][type="file"]'
)
await inputFile.setInputFiles(attachmentPath)
await expect(
inputFile.evaluate(
(input: HTMLInputElement) =>
input && Array.isArray(input.files) && input.files[0].name
)
).toBe('528KB-random.png')
page.getByRole('button', { name: 'Signed affidavit' })
).toBeVisible()
})
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,15 @@ test.describe.serial('7.0 Validate collect payment page', () => {
})

test('6.2 Should be able to add file and navigate to the "Ready to certify?" page.', async () => {
const attachmentPath = '../../birth/data/assets/528KB-random.png'
const path = require('path')
const attachmentPath = path.resolve(__dirname, './528KB-random.png')
const inputFile = await page.locator(
'input[name="affidavitFile"][type="file"]'
)

await inputFile.setInputFiles(attachmentPath)
await expect(
inputFile.evaluate(
(input: HTMLInputElement) =>
input && Array.isArray(input.files) && input.files[0].name
)
).toBe('528KB-random.png')
page.getByRole('button', { name: 'Signed affidavit' })
).toBeVisible()
})
})
})
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b66d22b

Please sign in to comment.