Skip to content

Commit 9b3748f

Browse files
fix: ♻️ Add user data generation methods for username and password using Faker
1 parent a8f62cc commit 9b3748f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

tests/api.ui.spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ test.afterEach(async () => {
2727
* This test is a simple smoke test.
2828
*/
2929
test('API SignUp | Login UI', async ({ page }) => {
30-
const username = faker.internet.userName() + faker.string.numeric(2);
30+
const username = `${faker.person.firstName()}${faker.string.numeric(2)}`;
3131
const password = faker.internet.password();
3232

3333
// New User
@@ -50,7 +50,7 @@ test('API SignUp | Login UI', async ({ page }) => {
5050
* Login and find the new task in the list.
5151
*/
5252
test('API: SignUp, Create Task | UI: Login, Find a task', async ({ page }) => {
53-
const username = faker.internet.userName() + faker.string.numeric(2);
53+
const username = `${faker.person.firstName()}${faker.string.numeric(2)}`;
5454
const password = faker.internet.password();
5555

5656
// New User

utils/userData.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { faker } from '@faker-js/faker';
22

33
export class UserData {
44
public getUsername(): string {
5-
return faker.internet.userName() + faker.string.numeric(2);
5+
return `${faker.person.firstName()}${faker.string.numeric(2)}`;
66
}
77

88
public getPassword(): string {

0 commit comments

Comments
 (0)