- Remove `playwright.config.js` to clean up configuration. - Add new E2E test suites (`admin-pos-orders`, `admin-module-goals`, `admin-module-pos-mobile-order-flow`) to structure Admin module tests. - Introduce reusable authentication and data seeding utilities in `fixtures` for streamlined test flows and maintainability.
111 lines
3.0 KiB
TypeScript
111 lines
3.0 KiB
TypeScript
/**
|
|
* Shared test data and credentials
|
|
* Centralized location for all test constants to improve maintainability
|
|
*/
|
|
|
|
// User (Customer) credentials
|
|
export const userCredentials = {
|
|
customerNumber: '12345679',
|
|
password: '5679',
|
|
twoFactorAuthentication: true,
|
|
// otpauth://totp/Truck%20Wash:12345679?secret=TBIS7MUDZ2O2VNM5&issuer=Truck%20Wash
|
|
otpSecret: 'TBIS7MUDZ2O2VNM5',
|
|
};
|
|
|
|
// Subuser (Driver) credentials - Phone login
|
|
export const subuserPhoneCredentials = {
|
|
phoneCountryCode: '45',
|
|
phone: '42331128',
|
|
password: 'Test1234',
|
|
twoFactorAuthentication: false,
|
|
otpSecret: 'SUBUSER2FASECRET',
|
|
};
|
|
|
|
// Subuser (Driver) credentials - Username login
|
|
export const subuserUsernameCredentials = {
|
|
username: 'testsubuser',
|
|
password: 'Test1234',
|
|
twoFactorAuthentication: false,
|
|
otpSecret: '',
|
|
};
|
|
|
|
// Operator credentials
|
|
export const operatorCredentials = {
|
|
userId: '11',
|
|
password: 'aef18KHAPGiu90',
|
|
};
|
|
|
|
// Test data for bookings
|
|
export const bookingTestData = {
|
|
departmentId: 12,
|
|
registrationNumber: 'EC21233',
|
|
reference: 'test_ref123',
|
|
poNumber: 'test_po123',
|
|
notes: 'test_note123',
|
|
};
|
|
|
|
// Test data for customer registration
|
|
export const customerRegistrationData = {
|
|
existingCvr: '41004355',
|
|
email: '2jepp9350@gmail.com',
|
|
existingPhone: '42331128',
|
|
newCvr: '43423010',
|
|
newPhone: '42331129',
|
|
};
|
|
|
|
// Test data for subuser/driver registration
|
|
export const driverRegistrationData = {
|
|
existingCvr: '41004355',
|
|
existingPhone: '42331128',
|
|
invalidCvr7Char: '1234567',
|
|
invalidCvr9Char: '1234567890',
|
|
};
|
|
|
|
// Invalid credentials for negative tests
|
|
export const invalidCredentials = {
|
|
invalidPassword: 'invalidpassword',
|
|
invalidCustomerNumber: '99999999999',
|
|
invalidPhoneNumber: '123456789',
|
|
invalidUsername: 'invalidusername',
|
|
invalidUserId: '99999999999',
|
|
invalidOperatorPassword: '0000',
|
|
invalidToken: 'invalidtoken',
|
|
invalid2FACode: '000000',
|
|
};
|
|
|
|
// 2FA test credentials - User with 2FA enabled
|
|
export const user2FACredentials = {
|
|
customerNumber: '12345680', // User with 2FA enabled
|
|
password: '5680',
|
|
validCode: '123456', // For testing with mock/TOTP
|
|
};
|
|
|
|
// 2FA test credentials - Subuser with 2FA enabled
|
|
export const subuser2FACredentials = {
|
|
phoneCountryCode: '45',
|
|
phone: '42331129', // Subuser with 2FA enabled
|
|
password: 'Test1234',
|
|
twoFactorAuthentication: false,
|
|
// otpauth://totp/Truck%20Wash:42331128?secret=SUBUSER2FASECRET&issuer=Truck%20Wash
|
|
otpSecret: 'SUBUSER2FASECRET',
|
|
};
|
|
|
|
// Passkey test data
|
|
export const passkeyTestData = {
|
|
unsupportedBrowserMessage: 'Passkeys are not supported on this device',
|
|
cancelledMessage: 'Authentication was cancelled or not allowed',
|
|
};
|
|
|
|
// QR Code authentication token
|
|
// Set this via environment variable PLENO_QR_TOKEN or directly for testing
|
|
export const qrAuthToken = process.env.PLENO_QR_TOKEN || '';
|
|
|
|
export const vehicleTestData = {
|
|
validRegNr: 'EC21234',
|
|
invalidRegNrShort: 'EC21',
|
|
invalidRegNrLong: 'EC2123456',
|
|
invalidRegNrLetters: 'ABCDEFGH',
|
|
brand: 'Volvo',
|
|
model: 'V70',
|
|
nickname: 'Test Car',
|
|
}; |