-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(boxes): adding react frontend tests
This PR adds a frontend test for the react box
- Loading branch information
1 parent
cc6d374
commit 086e478
Showing
8 changed files
with
243 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { defineConfig, devices } from '@playwright/test'; | ||
|
||
export default defineConfig({ | ||
testDir: './tests', | ||
testMatch: '**.spec.ts', | ||
fullyParallel: true, | ||
retries: 3, | ||
workers: process.env.CI ? 1 : 3, | ||
reporter: 'list', | ||
use: { | ||
baseURL: 'http://127.0.0.1:5173', | ||
trace: 'on-first-retry', | ||
screenshot: 'only-on-failure', | ||
video: 'on-first-retry', | ||
}, | ||
expect: { | ||
timeout: 90000, | ||
}, | ||
projects: [ | ||
{ | ||
name: 'chromium', | ||
use: { ...devices['Desktop Chrome'] }, | ||
}, | ||
{ | ||
name: 'firefox', | ||
use: { ...devices['Desktop Firefox'] }, | ||
}, | ||
|
||
{ | ||
name: 'webkit', | ||
use: { ...devices['Desktop Safari'] }, | ||
}, | ||
], | ||
webServer: { | ||
command: 'yarn serve', | ||
port: 5173, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { test, expect } from '@playwright/test'; | ||
|
||
test('test', async ({ page }) => { | ||
test.slow(); | ||
await page.goto('/'); | ||
|
||
// Deploy contract | ||
await page.getByRole('button', { name: 'Deploy dummy contract' }).click(); | ||
await expect(page.getByText('Deploying contract...')).toBeVisible(); | ||
await expect(page.getByText('Address:')).toBeVisible(); | ||
|
||
// Read number | ||
await page.getByRole('button', { name: 'Read' }).click(); | ||
await expect(page.getByText('Number is:')).toBeVisible(); | ||
|
||
// Set number | ||
await page.locator('#numberToSet').fill('1'); | ||
await page.getByRole('button', { name: 'Write' }).click(); | ||
await expect(page.getByText('Setting number...')).toBeVisible(); | ||
await expect(page.getByText('Number set to: 1')).toBeVisible(); | ||
|
||
// Read number | ||
await page.getByRole('button', { name: 'Read' }).click(); | ||
await expect(page.getByText('Number is: 1')).toBeVisible(); | ||
}); |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.