|
@ -2,23 +2,17 @@ import { test, expect } from '@playwright/test'; |
|
|
import { importUser } from './testUtils'; |
|
|
import { importUser } from './testUtils'; |
|
|
|
|
|
|
|
|
test('Record something given', async ({ page }) => { |
|
|
test('Record something given', async ({ page }) => { |
|
|
// Generate a random string of 16 characters
|
|
|
// Generate a random string of 3 characters
|
|
|
let randomString = Math.random().toString(36).substring(2, 18); |
|
|
const randomString = Math.random().toString(36).substring(2, 5); |
|
|
|
|
|
|
|
|
// In case the string is shorter than 16 characters, generate more characters until it is 16 characters long
|
|
|
|
|
|
while (randomString.length < 16) { |
|
|
|
|
|
randomString += Math.random().toString(36).substring(2, 18); |
|
|
|
|
|
} |
|
|
|
|
|
const finalRandomString = randomString.substring(0, 16); |
|
|
|
|
|
|
|
|
|
|
|
// Generate a random non-zero single-digit number
|
|
|
// Generate a random non-zero single-digit number
|
|
|
const randomNonZeroNumber = Math.floor(Math.random() * 99) + 1; |
|
|
const randomNonZeroNumber = Math.floor(Math.random() * 99) + 1; |
|
|
|
|
|
|
|
|
// Standard title prefix
|
|
|
// Standard title prefix
|
|
|
const standardTitle = "Gift "; |
|
|
const standardTitle = 'Gift '; |
|
|
|
|
|
|
|
|
// Combine title prefix with the random string
|
|
|
// Combine title prefix with the random string
|
|
|
const finalTitle = standardTitle + finalRandomString; |
|
|
const finalTitle = standardTitle + randomString; |
|
|
|
|
|
|
|
|
// Import user 00
|
|
|
// Import user 00
|
|
|
await importUser(page, '00'); |
|
|
await importUser(page, '00'); |
|
|