feat(test): added e2e tests

This commit is contained in:
Corentin Thomasset 2023-04-09 17:59:57 +02:00 committed by Corentin THOMASSET
parent ebfdb64fde
commit ec7cb9351c
11 changed files with 245 additions and 5 deletions

View file

@ -0,0 +1,19 @@
import { test, expect } from '@playwright/test';
test.describe('Tool - Token generator', () => {
test.beforeEach(async ({ page }) => {
await page.goto('/token-generator');
});
test('Has title', async ({ page }) => {
await expect(page).toHaveTitle('Token generator - IT Tools');
});
test('New token on refresh', async ({ page }) => {
const initialToken = await page.getByPlaceholder('The token...').inputValue();
await page.getByRole('button', { name: 'Refresh' }).click();
const newToken = await page.getByPlaceholder('The token...').inputValue();
expect(newToken).not.toEqual(initialToken);
});
});