Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add test for login by importing private key #218

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions tests/login.spec.ts
Original file line number Diff line number Diff line change
@@ -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);
});
4 changes: 4 additions & 0 deletions tests/testdata/nairobi.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"accountId": "f734f5aa37d06d86c3979f829f1394ab332ec83dcae287caf1c801dc33457318",
dxphilo marked this conversation as resolved.
Show resolved Hide resolved
"privateKey": "3XQgWjaXn92odEemoHcdKLN8JKsSpMCe2PN3SofUR6MP3Q3Zda4Gbtk4NmYfxhaFmWSNkZaefych9URLQFUJpZFd"
}