sonnar 8 left. random number fixed

This commit is contained in:
Cindy Chang
2024-08-13 13:24:05 +08:00
parent 699d7a4f6b
commit 471d8273c1
4 changed files with 15 additions and 4 deletions

View File

@@ -1,3 +1,5 @@
import { getRandomInt } from '../../../src/utils/jsUtils';
describe('Create an Account', ()=>{
beforeEach(() => {
cy.visit('https://REDACTED-HOST/account-admin');
@@ -15,7 +17,7 @@ describe('Create an Account', ()=>{
cy.contains('button', 'Create New').should('be.visible');
cy.contains('button', 'Create New').click();
const randomNumber = Math.floor(Math.random() * 1001);
const randomNumber = getRandomInt(1000);
// 將整數轉換為四位數字串,並補零
const fourDigitString = randomNumber.toString().padStart(4, '0');