diff --git a/e2e/testcases/print-certificate/birth/36.05.06-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/birth/36.05.06-validate-certify-record-page.spec.ts index 050a0493..d50332cb 100644 --- a/e2e/testcases/print-certificate/birth/36.05.06-validate-certify-record-page.spec.ts +++ b/e2e/testcases/print-certificate/birth/36.05.06-validate-certify-record-page.spec.ts @@ -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() }) }) }) diff --git a/e2e/testcases/print-certificate/birth/528KB-random.png b/e2e/testcases/print-certificate/birth/528KB-random.png new file mode 100644 index 00000000..02bd6901 Binary files /dev/null and b/e2e/testcases/print-certificate/birth/528KB-random.png differ diff --git a/e2e/testcases/print-certificate/death/36.05.06-validate-certify-record-page.spec.ts b/e2e/testcases/print-certificate/death/36.05.06-validate-certify-record-page.spec.ts index a1e803db..3c9c650c 100644 --- a/e2e/testcases/print-certificate/death/36.05.06-validate-certify-record-page.spec.ts +++ b/e2e/testcases/print-certificate/death/36.05.06-validate-certify-record-page.spec.ts @@ -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() }) }) }) diff --git a/e2e/testcases/print-certificate/death/528KB-random.png b/e2e/testcases/print-certificate/death/528KB-random.png new file mode 100644 index 00000000..02bd6901 Binary files /dev/null and b/e2e/testcases/print-certificate/death/528KB-random.png differ