generated from pricelees/issue-pr-template
refactor: 테스트 스크립트 일부 수정
This commit is contained in:
parent
cfaf83b70c
commit
4ec1e0c813
@ -31,7 +31,7 @@ export function maxIterations() {
|
||||
}
|
||||
|
||||
export function fetchUsers() {
|
||||
const userCount = Math.round(maxIterations() * 1.2)
|
||||
const userCount = Math.round(maxIterations() * 0.5)
|
||||
const userAccountRes = http.get(`${BASE_URL}/tests/users?count=${userCount}`)
|
||||
|
||||
if (userAccountRes.status !== 200) {
|
||||
|
||||
@ -17,15 +17,17 @@ export const options = {
|
||||
executor: 'ramping-vus',
|
||||
startVUs: 0,
|
||||
stages: [
|
||||
{ duration: '1m', target: 5 },
|
||||
{ duration: '1m', target: 10 },
|
||||
{ duration: '1m', target: 15 },
|
||||
{ duration: '1m', target: 20 },
|
||||
{ duration: '1m', target: 25 },
|
||||
{ duration: '1m', target: 30 },
|
||||
{ duration: '1m', target: 35 },
|
||||
{ duration: '1m', target: 40 },
|
||||
{ duration: '1m', target: 0 },
|
||||
{ duration: '1m', target: 100 },
|
||||
{ duration: '1m', target: 200 },
|
||||
{ duration: '1m', target: 300 },
|
||||
{ duration: '1m', target: 300 },
|
||||
{ duration: '1m', target: 400 },
|
||||
{ duration: '1m', target: 500 },
|
||||
{ duration: '2m', target: 500 },
|
||||
{ duration: '1m', target: 600 },
|
||||
{ duration: '1m', target: 800 },
|
||||
{ duration: '1m', target: 1000 },
|
||||
{ duration: '3m', target: 0 },
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -88,7 +90,7 @@ export default function (data) {
|
||||
console.log(`로그인 실패: token=${accessToken}`)
|
||||
return
|
||||
}
|
||||
const targetDate = randomDayBetween(1, 6)
|
||||
const targetDate = randomDayBetween(1, 4)
|
||||
|
||||
let availableScheduleId, selectedThemeId, selectedThemeInfo, reservationId, totalAmount
|
||||
|
||||
@ -101,9 +103,11 @@ export default function (data) {
|
||||
if (!schedules || schedules.length === 0) {
|
||||
console.log("일정 없음. 1회 재시도")
|
||||
const storeId = randomItem(stores).storeId
|
||||
const targetDate = randomDayBetween(0, 6)
|
||||
const targetDate = randomDayBetween(1, 4)
|
||||
const res = http.get(`${BASE_URL}/stores/${storeId}/schedules?date=${targetDate}`)
|
||||
schedules = parseIdToString(res).data.schedules
|
||||
if (check(res, { '일정 조회 성공': (r) => r.status === 200 })) {
|
||||
schedules = parseIdToString(res).data.schedules
|
||||
}
|
||||
}
|
||||
|
||||
if (schedules && schedules.length > 0) {
|
||||
@ -134,6 +138,8 @@ export default function (data) {
|
||||
return;
|
||||
}
|
||||
|
||||
let isScheduleHeld = false
|
||||
|
||||
group(`일정 Holding 및 테마 정보 조회 -> 예약 과정중 첫 페이지의 작업 완료`, function () {
|
||||
const holdRes = http.post(`${BASE_URL}/schedules/${availableScheduleId}/hold`, null, getHeaders(accessToken))
|
||||
|
||||
@ -143,9 +149,15 @@ export default function (data) {
|
||||
throw new Error("테마 상세 조회 실패")
|
||||
}
|
||||
selectedThemeInfo = parseIdToString(themeInfoRes).data
|
||||
isScheduleHeld = true
|
||||
}
|
||||
})
|
||||
|
||||
if (!isScheduleHeld) {
|
||||
console.log("일정 점유 실패")
|
||||
return
|
||||
}
|
||||
|
||||
let isPendingReservationCreated = false
|
||||
|
||||
group(`예약 정보 입력 페이지`, function () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user