Checkout: minimize registration data
This commit is contained in:
@@ -171,12 +171,20 @@ async function completeRegistrationOrLogin(page: Page, credentials: { email: str
|
||||
await page.fill('input[name="first_name"]', 'Play');
|
||||
await page.fill('input[name="last_name"]', 'Wright');
|
||||
await page.fill('input[name="email"]', credentials.email);
|
||||
await page.fill('input[name="address"]', 'Teststrasse 1, 12345 Berlin');
|
||||
await page.fill('input[name="phone"]', '+49123456789');
|
||||
const addressInput = page.locator('input[name="address"]');
|
||||
if (await addressInput.isVisible()) {
|
||||
await addressInput.fill('Teststrasse 1, 12345 Berlin');
|
||||
}
|
||||
|
||||
const username = credentials.email.split('@')[0]?.replace(/[^a-z0-9]+/gi, '-') ?? `playwright-${Date.now()}`;
|
||||
await page.fill('input[name="username"]', username);
|
||||
const phoneInput = page.locator('input[name="phone"]');
|
||||
if (await phoneInput.isVisible()) {
|
||||
await phoneInput.fill('+49123456789');
|
||||
}
|
||||
|
||||
const usernameInput = page.locator('input[name="username"]');
|
||||
if (await usernameInput.isVisible()) {
|
||||
await usernameInput.fill(credentials.email);
|
||||
}
|
||||
await page.fill('input[name="password"]', credentials.password);
|
||||
await page.fill('input[name="password_confirmation"]', credentials.password);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user