diff --git a/tests/login.spec.ts b/tests/login.spec.ts new file mode 100644 index 00000000..6d47ccc7 --- /dev/null +++ b/tests/login.spec.ts @@ -0,0 +1,17 @@ +import { test, expect } from '@playwright/test'; + +test('Login by Importing Blogchain private key', async ({ page }) => { + await page.goto('/login'); + + await expect(page).toHaveTitle(/Login - Blogchain/); + + await page.locator('text=Import Blogchain private key').click(); + + await page.setInputFiles('input[type="file"]', './tests/testdata/nairobi.test.json'); + + await expect(page).toHaveTitle(/Home - Blogchain/); + + await expect(page.locator('text=Hello, Test Account')).toBeVisible(); + + await page.waitForTimeout(5000); +}); diff --git a/tests/testdata/testaccount.test.json b/tests/testdata/testaccount.test.json new file mode 100644 index 00000000..e69de29b