mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 12:42:15 +01:00
Fixed e2e tests
This commit is contained in:
@@ -2,7 +2,8 @@ import { expect, test } from '@playwright/test';
|
|||||||
import { PLAYWRIGHT_BASE_URL } from '../playwright/config';
|
import { PLAYWRIGHT_BASE_URL } from '../playwright/config';
|
||||||
|
|
||||||
async function registerNewUser(page, email, password) {
|
async function registerNewUser(page, email, password) {
|
||||||
await page.getByRole('link', { name: 'Register' }).click();
|
//await page.getByRole('link', { name: 'Register' }).click();
|
||||||
|
await page.goto(PLAYWRIGHT_BASE_URL + '/register');
|
||||||
await page.getByLabel('Name').fill('John Doe');
|
await page.getByLabel('Name').fill('John Doe');
|
||||||
await page.getByLabel('Email').fill(email);
|
await page.getByLabel('Email').fill(email);
|
||||||
await page.getByLabel('Password', { exact: true }).fill(password);
|
await page.getByLabel('Password', { exact: true }).fill(password);
|
||||||
@@ -19,7 +20,7 @@ test('can register, logout and log back in', async ({ page }) => {
|
|||||||
await expect(page.getByTestId('dashboard_view')).toBeVisible();
|
await expect(page.getByTestId('dashboard_view')).toBeVisible();
|
||||||
await page.getByTestId('current_user_button').click();
|
await page.getByTestId('current_user_button').click();
|
||||||
await page.getByText('Log Out').click();
|
await page.getByText('Log Out').click();
|
||||||
await page.waitForURL(PLAYWRIGHT_BASE_URL + '/');
|
await page.waitForURL(PLAYWRIGHT_BASE_URL + '/login');
|
||||||
await page.goto(PLAYWRIGHT_BASE_URL + '/login');
|
await page.goto(PLAYWRIGHT_BASE_URL + '/login');
|
||||||
await page.getByLabel('Email').fill(email);
|
await page.getByLabel('Email').fill(email);
|
||||||
await page.getByLabel('Password').fill(password);
|
await page.getByLabel('Password').fill(password);
|
||||||
@@ -36,7 +37,7 @@ test('can register and delete account', async ({ page }) => {
|
|||||||
await page.getByRole('button', { name: 'Delete Account' }).click();
|
await page.getByRole('button', { name: 'Delete Account' }).click();
|
||||||
await page.getByPlaceholder('Password').fill(password);
|
await page.getByPlaceholder('Password').fill(password);
|
||||||
await page.getByRole('button', { name: 'Delete Account' }).nth(1).click();
|
await page.getByRole('button', { name: 'Delete Account' }).nth(1).click();
|
||||||
await page.waitForURL(PLAYWRIGHT_BASE_URL + '/');
|
await page.waitForURL(PLAYWRIGHT_BASE_URL + '/login');
|
||||||
await page.goto(PLAYWRIGHT_BASE_URL + '/login');
|
await page.goto(PLAYWRIGHT_BASE_URL + '/login');
|
||||||
await page.getByLabel('Email').fill(email);
|
await page.getByLabel('Email').fill(email);
|
||||||
await page.getByLabel('Password').fill(password);
|
await page.getByLabel('Password').fill(password);
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
use App\Http\Controllers\Web\DashboardController;
|
use App\Http\Controllers\Web\DashboardController;
|
||||||
use App\Http\Controllers\Web\HomeController;
|
use App\Http\Controllers\Web\HomeController;
|
||||||
use Illuminate\Foundation\Application;
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
|
use Inertia\Inertia;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user