Files
roblox-project/bunsik-tycoon/tests/cloud/integration.luau
EJClaw 25df3d4846 feat(bunsik): 꾸미기 모드(아래 물건 줄·이동·삭제), 가게 이름 색 10가지, 개발자 결제 테스트 모드
- [가게 꾸미기]를 누르면 창 없이 바로 꾸미기 모드: 아래 물건 줄(테이블·의자·소품 6가지, 값·개수)에서 고르면
  투명 미리보기를 들고 걸어가 [배치]. [이동]은 고른 가구를 들고 옮기기, [삭제]는 고른 가구를 빨갛게 표시한 뒤
  한 번 더 눌러 지우고 산 값 돌려받기(조리대·마지막 테이블/의자·의자가 보는 테이블·손님 앉은 의자는 막음)
- 새 요청 remove, Floor.remove, Shop.removeSeat(뒤 자리 손님·걷는 시간 번호 당김)
- 내 가게 탭: 이름 색 무료 10색 + 무지개(게임패스) 칸. 부지 속성 NameColor로 모두에게 보임
- 개발자 테스트 [결제 테스트 켜기/끄기]: 켜면 2배·부스트·러시·쫓아내기·광고 홍보·무지개·유료 디자인이
  결제 창 없이 바로 지급(이번 접속만), 게임패스는 안 가진 상태로 바꿔 사는 흐름을 볼 수 있고 끄면 실제 보유로 복구

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 05:32:32 +09:00

523 lines
24 KiB
Lua

-- 로블록스 서버(Open Cloud Luau Execution)에서 돌리는 화면 UI·클라이언트 모듈 통합 테스트(서버 로직은 server.luau).
-- python3 tools/cloud.py run tests/cloud/integration.luau --version <저장 버전>
-- 이 환경에서는 플레이어가 없고 물리가 돌지 않으며 Script가 자동 실행되지 않으므로,
-- 모듈을 직접 불러 가짜 플레이어(Folder)와 가상 시계로 가게를 돌립니다.
local Players = game:GetService("Players")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local ServerScriptService = game:GetService("ServerScriptService")
local StarterPlayer = game:GetService("StarterPlayer")
local Server = ServerScriptService.Server
local failures = {}
local count = 0
local function check(cond: any, msg: string)
count += 1
if not cond then
table.insert(failures, msg)
print("FAIL " .. msg)
end
end
local function eq(a: any, b: any, msg: string)
check(a == b, `{msg} (기대 {tostring(b)}, 실제 {tostring(a)})`)
end
local function section(name: string)
print("== " .. name)
end
local Economy = require(ReplicatedStorage.Shared.Economy)
local Icons = require(ReplicatedStorage.Shared.Icons)
local Locale = require(ReplicatedStorage.Shared.Locale)
local Recipes = require(ReplicatedStorage.Shared.Recipes)
section("맵·부지 글자·손님 버튼(클라이언트 모듈)")
local World = require(Server.World)
local slots = World.build()
local Neighbor = require(Server.Neighbor)
local Plots = require(StarterPlayer.StarterPlayerScripts.Client.Plots)
local viewer = Instance.new("Folder")
viewer:SetAttribute("Lang", "en")
viewer:SetAttribute("KickCredits", 0)
local nb2 = Neighbor.open(slots[6], 0)
eq(Plots.nameText(slots[4].model, "en"), "Empty lot", "빈 자리 이름판")
local detach = Plots.attach(slots[6].model, viewer, 999, function() end)
local visitPrompt = slots[6].model.Base.VisitPoint:FindFirstChild("VisitPrompt") :: ProximityPrompt
check(visitPrompt ~= nil and visitPrompt.Enabled, "이웃 가게 입구에 손님 버튼")
eq(visitPrompt.ActionText, "Eat here as a customer", "손님 버튼 글자(영어)")
local kickPrompt = slots[6].model.Base.VisitPoint:FindFirstChild("KickPrompt") :: ProximityPrompt
check(kickPrompt ~= nil and kickPrompt.Enabled, "이웃 가게 입구에 쫓아내기 버튼")
check(kickPrompt.KeyboardKeyCode ~= visitPrompt.KeyboardKeyCode, "두 버튼은 다른 키")
local boardLabel = slots[6].model.Base.NameBoard:FindFirstChildOfClass("SurfaceGui"):FindFirstChildOfClass("TextLabel")
check(string.find(boardLabel.Text, "Twigim King") ~= nil, `이름판 영어 ({boardLabel.Text})`)
viewer:SetAttribute("Lang", "ja")
check(string.find(boardLabel.Text, "天ぷら") ~= nil, `언어 바꾸면 이름판도 바뀜 ({boardLabel.Text})`)
check(string.find(Plots.menuText(slots[6].model, "ko"), "떡볶이") ~= nil, "메뉴판(부지 속성 Menus)")
-- 가게 이름·무지개: 이름판과 지붕·천막 간판(ShopNameLabel)에 보임
slots[6].model:SetAttribute("ShopName", "Yummy Land")
check(string.find(boardLabel.Text, "Yummy Land") ~= nil, `가게 이름이 이름판에 ({boardLabel.Text})`)
local valance = slots[6].model.Base.Stall.Valance:FindFirstChild("ShopNameLabel", true) :: TextLabel
eq(valance and valance.Text, "Yummy Land", "천막 간판에 가게 이름")
slots[6].model:SetAttribute("Rainbow", true)
task.wait(0.2)
check(boardLabel:FindFirstChild("RainbowGradient") ~= nil, "무지개 이름(그러데이션)")
slots[6].model:SetAttribute("Rainbow", false)
task.wait(0.2)
eq(boardLabel:FindFirstChild("RainbowGradient"), nil, "무지개 끄면 사라짐")
slots[6].model:SetAttribute("ShieldUntil", workspace:GetServerTimeNow() + 60)
task.wait(0.2)
check(not kickPrompt.Enabled, "보호 중인 가게엔 쫓아내기 버튼 꺼짐")
Neighbor.close(nb2)
check(not visitPrompt.Enabled, "닫힌 가게엔 손님 버튼 없음")
slots[6].model:SetAttribute("OwnerId", 999)
check(not visitPrompt.Enabled and not kickPrompt.Enabled, "내 가게엔 버튼 없음")
slots[6].model:SetAttribute("OwnerId", nil)
detach()
section("마우스 회전 판단")
local MouseLook = require(StarterPlayer.StarterPlayerScripts.Client.MouseLook)
check(MouseLook.shouldLock(true, true, false, false), "켜짐 + 마우스 = 고정")
check(not MouseLook.shouldLock(false, true, false, false), "설정 끄면 안 고정")
check(not MouseLook.shouldLock(true, false, false, false), "마우스 없으면(모바일) 안 고정")
check(not MouseLook.shouldLock(true, true, true, false), "Ctrl 누르면 커서 풀림")
check(not MouseLook.shouldLock(true, true, false, true), "창 열리면 커서 풀림")
section("화면 UI(서버에서 생성)")
local Hud = require(StarterPlayer.StarterPlayerScripts.Client.Hud)
local Theme = require(StarterPlayer.StarterPlayerScripts.Client.Theme)
local state = Instance.new("Folder")
state:SetAttribute("Lang", "ko")
state:SetAttribute("Money", 5)
state:SetAttribute("Levels", "")
state:SetAttribute("Stage", 1)
state:SetAttribute("Seats", 1)
state:SetAttribute("Tables", 1)
state:SetAttribute("Staff", "")
state:SetAttribute("Tut", 3)
local sent = {}
local holder = Instance.new("Folder")
local hud = Hud.build(holder, state, function(kind, arg)
table.insert(sent, { kind, arg })
end)
local root = hud.gui:FindFirstChild("Root") :: Frame
local function label(o: Instance?): string?
local t = o and o:FindFirstChild("Label", true) :: TextLabel?
return t and t.Text
end
local moneyText = root:FindFirstChild("Money"):FindFirstChild("Text", true) :: TextLabel
eq(moneyText.Text, "5", "돈 표시")
check(root:FindFirstChild("Next") == nil, "아래 [사기] 막대 없음")
local hintFrame = root:FindFirstChild("Hint") :: Frame
check(hintFrame.Visible, "튜토리얼 말풍선 보임")
local hintText = hintFrame:FindFirstChild("Text", true) :: TextLabel
check(
string.find(hintText.Text, "가게 꾸미기") ~= nil,
`튜토리얼 3은 가게 꾸미기 안내 ({hintText.Text})`
)
check((root:FindFirstChild("Pointer") :: ImageLabel).Visible, "튜토리얼 3: [가게 꾸미기] 가리키는 손")
local lay0 = hud.layout()
check(hintFrame.Position.Y.Offset > lay0.height / 2, "튜토리얼 말풍선은 화면 아래쪽")
local listButton = root:FindFirstChild("ListButton") :: TextButton
eq(label(listButton), "상점", "상점 버튼 글자")
local decoButton = root:FindFirstChild("Decorate") :: TextButton
eq(label(decoButton), "가게 꾸미기", "가게 꾸미기 버튼 글자")
check(not (listButton:FindFirstChild("Badge") :: Frame).Visible, "살 것이 없으면 배지 없음")
state:SetAttribute("Money", 15)
check((listButton:FindFirstChild("Badge") :: Frame).Visible, "살 수 있으면 상점 버튼에 ! 배지")
eq(
(root:FindFirstChild("Gain") :: TextLabel?) and (root:FindFirstChild("Gain") :: TextLabel).Text,
"+10",
"늘어난 돈"
)
for _, name in { "Promote", "Rush", "Double", "Boost", "Settings" } do
check(root:FindFirstChild(name) ~= nil, `버튼 {name}`)
end
state:SetAttribute("Lang", "en")
eq(label(decoButton), "Decorate", "영어 가게 꾸미기 버튼")
state:SetAttribute("Lang", "ko")
state:SetAttribute("Tut", 0)
check(
not hintFrame.Visible and not (root:FindFirstChild("Pointer") :: ImageLabel).Visible,
"튜토리얼 끝나면 아래 말풍선 없음"
)
section("상점 창(탭 3개)")
hud.open("shop")
local panel = root:FindFirstChild("Panel") :: Frame
check(hud.menuOpen() and panel.Visible, "상점 창 열기")
local function page(id: string): Frame
return panel:FindFirstChild("Page_" .. id, true) :: Frame
end
for _, id in { "upgrade", "staff", "mine" } do
check(page(id) ~= nil, `탭 {id}`)
check(panel:FindFirstChild("Tab_" .. id, true) ~= nil, `탭 버튼 {id}`)
end
check(panel:FindFirstChild("Tab_decor", true) == nil, "상점에는 꾸미기 탭 없음")
check(page("upgrade").Visible, "처음엔 업그레이드 탭")
for _, id in Economy.TRACK_ORDER do
local card = page("upgrade"):FindFirstChild("Track_" .. id, true)
check(card ~= nil, `갈래 카드 {id}`)
local nm = card and card:FindFirstChild("Name", true) :: TextLabel?
check(nm and nm.Text ~= "" and not string.find(nm.Text, "track_"), `갈래 이름 {id} ({nm and nm.Text})`)
end
local tray = page("upgrade"):FindFirstChild("Track_Tray", true) :: Frame
check((tray:FindFirstChild("Lock", true) :: ImageLabel).Visible, "쟁반은 포장마차에서 잠김")
check(root:FindFirstChild("DecorPanel") == nil, "가게 꾸미기 창 없음(바로 꾸미기 모드)")
hud.open("shop", "staff")
check((page("staff"):FindFirstChild("Locked", true) :: Frame).Visible, "알바생 기능 전에는 잠김")
state:SetAttribute("Levels", "Staff=1")
state:SetAttribute("Staff", "Cook=1,Server=0,Promoter=0")
state:SetAttribute("Strike", true)
check(not (page("staff"):FindFirstChild("Locked", true) :: Frame).Visible, "알바생 기능을 사면 열림")
for _, r in Economy.ROLES do
check(page("staff"):FindFirstChild("Role_" .. r.id, true) ~= nil, `알바 카드 {r.id}`)
end
hud.open("shop", "mine")
check(page("mine"):FindFirstChild("NameBox", true) ~= nil, "가게 이름 입력칸")
for n = 1, #Economy.NAME_COLORS do
check(page("mine"):FindFirstChild("Color" .. n, true) ~= nil, `이름 색 {n}`)
end
local rainbowSw = page("mine"):FindFirstChild("Rainbow", true)
check(rainbowSw ~= nil, "무지개 칸")
state:SetAttribute("NameColor", 4)
check((page("mine"):FindFirstChild("Color4", true) :: Frame):FindFirstChild("Done").Visible, "고른 색에 체크")
check(
not (page("mine"):FindFirstChild("Color3", true) :: Frame):FindFirstChild("Done").Visible,
"안 고른 색은 체크 없음"
)
for _, d in Economy.DESIGNS do
check(page("mine"):FindFirstChild("Design_" .. d.id, true) ~= nil, `디자인 {d.id}`)
end
hud.open("settings")
local settingsPanel = root:FindFirstChild("SettingsPanel") :: Frame
check(settingsPanel.Visible and not panel.Visible, "창은 하나만 열림")
hud.open(nil)
check(not hud.menuOpen(), "창 닫기")
section("알림 글자(모든 알림 키, 4개 언어)")
local Info = require(StarterPlayer.StarterPlayerScripts.Client.Info)
local SAMPLES = {
upgraded = { track = "Speed", level = 2 },
newMenu = { menu = "Gimbap" },
expanded = {},
floor2 = {},
seatAdded = {},
tableAdded = {},
decorAdded = { kind = "Teddy" },
noSpace = {},
seatMax = {},
tableMax = {},
tableFull = {},
needStage = {},
placeFail = { why = "blocked" },
hired = { role = "Cook" },
fired = { role = "Server" },
staffLocked = {},
staffMax = {},
strike = {},
strikeOver = {},
renamed = {},
nameRejected = {},
designSet = { design = "Hanok" },
designLocked = {},
promoted = { n = 2 },
promoteNone = {},
promoteFull = {},
promoteWait = { sec = 30 },
adUnavailable = {},
kicked = { n = 3 },
kickedBy = { name = "Mina" },
shielded = {},
kickOwn = {},
rushOn = { min = 10 },
notEnough = { need = "100" },
doubleOwned = {},
removed = { thing = "chair", money = "45" },
removeFail = { why = "hasChairs" },
devFreeOn = {},
devFreeOff = {},
}
for _, lang in { "ko", "en", "ja", "zh" } do
for key, args in SAMPLES do
local text = Info.toast(lang, key, args)
check(text ~= key and not string.find(text, "{") and text ~= "", `{lang} 알림 {key}: {text}`)
end
end
state:SetAttribute("Lang", "en")
hud.notify("upgraded", { track = "Speed", level = 2 })
local toastText = root.Toasts:FindFirstChild("Toast"):FindFirstChild("Text") :: TextLabel
check(string.find(toastText.Text, "Customer Speed") ~= nil, `알림에 갈래 이름(내 언어) ({toastText.Text})`)
for _ = 1, 5 do
hud.notify("seatAdded")
end
local toastCount = 0
for _, ch in root.Toasts:GetChildren() do
if ch:IsA("Frame") then
toastCount += 1
end
end
check(toastCount <= 3, `알림은 3개까지만 쌓임 ({toastCount})`)
section("휴대폰·PC 배치")
local doubleBtn = root:FindFirstChild("Double") :: TextButton
hud.setLayout(Vector2.new(750, 332), true)
local lay = hud.layout()
local scaleObj = root:FindFirstChildOfClass("UIScale") :: UIScale
check(
root.Size.X.Offset * scaleObj.Scale - 750 >= -1e-3 and root.Size.X.Offset * scaleObj.Scale - 750 < scaleObj.Scale,
"휴대폰: 루트 너비 = 화면"
)
check(lay.double.y + lay.double.h < lay.height / 3, "휴대폰: 결제 버튼은 조이스틱 자리 위")
check(not (settingsPanel:FindFirstChild("MouseLook") :: TextButton).Visible, "휴대폰: 마우스 회전 줄 숨김")
eq(doubleBtn.Size.Y.Offset, lay.double.h, "휴대폰: 2배 수익 버튼 크기")
hud.setLayout(Vector2.new(1366, 710), false)
check((settingsPanel:FindFirstChild("MouseLook") :: TextButton).Visible, "PC: 마우스 회전 줄 보임")
hud.destroy()
section("꾸미기 화면(클라이언트 모듈)")
local Decorate = require(StarterPlayer.StarterPlayerScripts.Client.Decorate)
check(typeof(Decorate.build) == "function", "꾸미기 모듈")
local dstate = Instance.new("Folder")
dstate:SetAttribute("Lang", "ko")
dstate:SetAttribute("Stage", 1)
dstate:SetAttribute("Money", 100)
local dplot = Instance.new("Model")
dplot:SetAttribute("Origin", CFrame.new())
local dholder = Instance.new("Folder")
local deco = Decorate.build(dholder, dstate, dplot, function() end)
local Layout = require(StarterPlayer.StarterPlayerScripts.Client.Layout)
deco.setLayout(Layout.compute(750, 332, true, false))
local droot = deco.gui:FindFirstChild("Root") :: Frame
for _, name in { "Exit", "Info", "Rotate", "Cancel", "Place" } do
check(droot:FindFirstChild(name) ~= nil, `꾸미기 {name}`)
end
check(droot:FindFirstChild("Floor") == nil and droot:FindFirstChild("Side1") == nil, "예전 층·쪽 버튼 없음")
check(not deco.isOpen() and not deco.holding(), "처음엔 닫힘")
local items = droot:FindFirstChild("Items") :: ScrollingFrame
check(items ~= nil, "아래 물건 줄")
for _, it in Decorate.ITEMS do
check(items:FindFirstChild("Item_" .. (it.k or it.kind)) ~= nil, `물건 줄 {it.k or it.kind}`)
end
deco.open()
check(deco.isOpen() and items.Visible, "꾸미기 모드: 물건 줄 보임")
check((droot:FindFirstChild("Move") :: GuiObject).Visible, "이동 버튼")
check((droot:FindFirstChild("Delete") :: GuiObject).Visible, "삭제 버튼")
check(not (droot:FindFirstChild("Place") :: GuiObject).Visible, "고를 때는 배치 버튼 숨김")
local itemTable = items:FindFirstChild("Item_table") :: TextButton
eq((itemTable:FindFirstChild("Price") :: TextLabel).Text, Locale.number(Economy.tableCost(1)), "테이블 값")
local infoT = (droot:FindFirstChild("Info") :: Frame):FindFirstChild("Text") :: TextLabel
check(string.find(infoT.Text, "이동") ~= nil, `안내 글 ({infoT.Text})`)
deco.close()
check(not deco.isOpen(), "나가기")
deco.destroy()
section("요리 창(메뉴 고르기 → 조리 과정 → 완성)")
local kstate = Instance.new("Folder")
kstate:SetAttribute("Lang", "ko")
kstate:SetAttribute("Money", 0)
kstate:SetAttribute("Levels", "Menu=2") -- 떡볶이·김밥·순대 해금
kstate:SetAttribute("Tut", 1)
kstate:SetAttribute("Orders", "Gimbap=2")
local ksent = {}
local khud = Hud.build(Instance.new("Folder"), kstate, function(kind, arg)
table.insert(ksent, { kind, arg })
end)
local kroot = khud.gui:FindFirstChild("Root") :: Frame
local kitchen = khud.kitchen
local kframe = kroot:FindFirstChild("Kitchen") :: Frame
check(not kframe.Visible, "요리 창은 처음엔 닫힘")
khud.open("kitchen")
check(kframe.Visible and kitchen.isOpen() and khud.menuOpen(), "요리 창 열림(커서 풀림)")
check((kroot:FindFirstChild("Dim") :: TextButton).Visible, "요리 창 뒤 어둡게")
local menuPage = kframe:FindFirstChild("MenuPage", true) :: Frame
check(menuPage.Visible, "처음엔 메뉴 고르기")
local function menuCard(m: string): Frame
return menuPage:FindFirstChild("Menu_" .. m, true) :: Frame
end
for _, m in Economy.MENU_ORDER do
check(menuCard(m) ~= nil, `메뉴 카드 {m}`)
end
check((menuCard("Gimbap"):FindFirstChild("Orders", true) :: Frame).Visible, "주문 있는 김밥에 손님 표시")
eq((menuCard("Gimbap"):FindFirstChild("Orders", true):FindFirstChild("Text") :: TextLabel).Text, "x2", "주문 수 2")
check(
not (menuCard("Tteokbokki"):FindFirstChild("Orders", true) :: Frame).Visible,
"주문 없는 떡볶이는 표시 없음"
)
check((menuCard("Eomuk"):FindFirstChild("Lock", true) :: ImageLabel).Visible, "안 산 어묵은 자물쇠")
check(not (menuCard("Sundae"):FindFirstChild("Lock", true) :: ImageLabel).Visible, "산 순대는 자물쇠 없음")
check(
(menuPage:FindFirstChild("Pointer") or menuCard("Gimbap"):FindFirstChild("Pointer", true)) ~= nil,
"튜토리얼 손가락"
)
eq(kitchen.choose("Tteokbokki"), false, "주문 없는 메뉴는 못 고름")
eq(kitchen.choose("Eomuk"), false, "안 산 메뉴는 못 고름")
eq(kitchen.choose("Gimbap"), true, "김밥 고름")
local cookPage = kframe:FindFirstChild("CookPage", true) :: Frame
check(cookPage.Visible and not menuPage.Visible, "조리 화면으로")
eq((cookPage:FindFirstChild("Instruction") :: TextLabel).Text, "김 위에 재료를 올려요", "1단계 안내")
check(
(cookPage:FindFirstChild("Base", true) :: ImageLabel).Image == Icons.KITCHEN_ASSET,
"조리 도구 그림(도마)"
)
eq((cookPage:FindFirstChild("Base", true) :: ImageLabel).ImageRectOffset, Icons.KITCHEN.board, "김밥은 도마")
local flowK = kitchen.flow()
local need1 = flowK.need
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, `톡톡! {need1}번`, "톡톡 남은 횟수")
eq(kitchen.input("hold", 1), nil, "다른 동작은 무시")
eq(kitchen.input("tap", 1), "progress", "톡 1")
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, `톡톡! {need1 - 1}번`, "남은 횟수 줄어듦")
local strip1 = cookPage:FindFirstChild("Strip1", true) :: Frame
check(strip1 ~= nil and strip1.Visible, "누를 때마다 재료가 올라감")
for _ = 2, need1 do
kitchen.input("tap", 1)
end
eq(flowK.step, 2, "2단계(말기)")
eq((cookPage:FindFirstChild("Instruction") :: TextLabel).Text, "돌돌 말아요", "2단계 안내")
eq((cookPage:FindFirstChild("Gesture") :: TextLabel).Text, "문질문질!", "문지르기 안내")
eq(kitchen.input("rub", flowK.need), "step", "다 문지름 → 3단계")
check((cookPage:FindFirstChild("Roll", true) :: ImageLabel).Visible, "김밥이 말림")
eq(#ksent, 1, "완성 전에는 시작만 보냄")
eq(kitchen.input("tap", flowK.need), "done", "썰기 끝 → 완성")
eq(ksent[1] and ksent[1][1], "cookStart", "메뉴를 고르면 서버에 cookStart")
eq(ksent[1] and ksent[1][2], "Gimbap", "고른 메뉴로 시작")
eq(ksent[2] and ksent[2][1], "cook", "다 만들면 서버에 cook")
eq(ksent[2] and ksent[2][2], "Gimbap", "고른 메뉴를 보냄")
local donePage = kframe:FindFirstChild("DonePage", true) :: Frame
check(donePage.Visible, "완성 화면")
eq((donePage:FindFirstChild("Dish") :: ImageLabel).ImageRectOffset, Icons.OFFSET.Gimbap, "완성 접시 그림")
-- 주문이 남아 있고 손에 자리가 있으면 다시 메뉴 고르기, 아니면 닫힘
kstate:SetAttribute("Orders", "Gimbap=1")
kstate:SetAttribute("Carry", 0)
task.wait(1.5)
check(kitchen.isOpen() and menuPage.Visible, "주문이 남으면 다음 접시 고르기")
kitchen.choose("Gimbap")
for _ = 1, 20 do
local st = Recipes.current(kitchen.flow())
if not st then
break
end
kitchen.input(st.kind, kitchen.flow().need)
end
kstate:SetAttribute("Carry", 1) -- 손이 꽉 참(쟁반 없음)
kstate:SetAttribute("Orders", "")
task.wait(1.5)
check(not kitchen.isOpen() and not kframe.Visible, "더 만들 것이 없으면 창이 닫힘")
check(not (kroot:FindFirstChild("Dim") :: TextButton).Visible, "닫히면 어둡게도 꺼짐")
-- 메뉴마다 과정이 다르고 끝까지 갈 수 있음
for _, m in Economy.MENU_ORDER do
kstate:SetAttribute("Levels", "Stage=1,Menu=4")
kstate:SetAttribute("Carry", 0)
kstate:SetAttribute("Orders", `{m}=1`)
khud.open("kitchen")
check(kitchen.choose(m), `{m} 고름`)
eq(
(cookPage:FindFirstChild("Base", true) :: ImageLabel).ImageRectOffset,
Icons.KITCHEN[Recipes.LIST[m].stage],
`{m} 조리 도구 그림`
)
local guard = 0
while kitchen.flow().phase == "cook" and guard < 10 do
local st = Recipes.current(kitchen.flow()) :: Recipes.Step
check(
Icons.OFFSET[({ roll = "mat", fire = "flame", skewer = "Eomuk" } :: any)[st.tool] or st.tool] ~= nil,
`{m} 도구 그림 {st.tool}`
)
kitchen.input(st.kind, kitchen.flow().need)
guard += 1
end
eq(kitchen.flow().phase, "done", `{m} 완성`)
eq(ksent[#ksent][1], "cook", `{m} 완성 보냄`)
eq(ksent[#ksent][2], m, `{m} 서버에 보냄`)
eq(ksent[#ksent - 1][1], "cookStart", `{m} 시작 보냄`)
khud.open(nil)
check(not kitchen.isOpen(), `{m} 창 닫기`)
end
-- 요리 창은 화면 안에(휴대폰)
khud.setLayout(Vector2.new(667, 317), true)
local kl = khud.layout().kitchen
check(kl.x >= 0 and kl.y >= 0 and kl.x + kl.w <= khud.layout().width + 1e-6, "휴대폰: 요리 창 화면 안")
khud.destroy()
section("조리대 버튼(클라이언트 모듈)")
local Stove = require(StarterPlayer.StarterPlayerScripts.Client.Stove)
local stove = slots[3].refs.stove
local pstate = Instance.new("Folder")
pstate:SetAttribute("Lang", "ko")
local prompt = Stove.attach(stove, pstate, function() end)
check(not prompt.Enabled, "주문 없으면 버튼 꺼짐")
stove:SetAttribute("CookMenu", "Gimbap")
check(prompt.Enabled, "주문 있으면 버튼 켜짐")
eq(prompt.ActionText, "요리하기", "버튼 글자")
eq(prompt.HoldDuration, 0, "누르면 바로 요리 창(꾹 누르지 않음)")
prompt:Destroy()
section("효과음(직접 만든 오디오 에셋)")
local Sounds = require(ReplicatedStorage.Shared.Sounds)
for name, id in Sounds do
local num = tonumber(string.match(id, "%d+"))
local okInfo, info = pcall(function()
return game:GetService("MarketplaceService"):GetProductInfoAsync(num :: number, Enum.InfoType.Asset)
end)
check(okInfo, `효과음 {name} 정보 조회`)
if okInfo then
eq(info.AssetTypeId, 3, `효과음 {name}은 오디오`)
eq(info.Creator.CreatorTargetId, game.CreatorId, `효과음 {name}은 게임 주인 소유`)
end
end
section("UI 그림(직접 그린 이미지 에셋)")
for _, asset in { Icons.ASSET, Icons.KITCHEN_ASSET } do
local num = tonumber(string.match(asset, "%d+"))
local okInfo, info = pcall(function()
return game:GetService("MarketplaceService"):GetProductInfoAsync(num :: number, Enum.InfoType.Asset)
end)
check(okInfo, `그림 {num} 정보 조회`)
if okInfo then
eq(info.AssetTypeId, 1, `그림 {num}은 이미지`)
eq(info.Creator.CreatorTargetId, game.CreatorId, `그림 {num}은 게임 주인 소유`)
end
end
section("Products(게임패스·개발자 상품)")
local Products = require(ReplicatedStorage.Shared.Products)
local MarketplaceService = game:GetService("MarketplaceService")
for key, id in Products do
check(id ~= 0, `{key} ID 있음`)
local isPass = string.find(key, "_PASS$") ~= nil
local okInfo, info = pcall(function()
return MarketplaceService:GetProductInfoAsync(
id,
if isPass then Enum.InfoType.GamePass else Enum.InfoType.Product
)
end)
check(okInfo, `{key} 정보 조회`)
if okInfo then
print(key, info.Name, info.PriceInRobux, info.IsForSale)
check(info.PriceInRobux ~= nil and info.PriceInRobux > 0, `{key} 가격`)
end
end
section("Game.start(실제 서버 시작 순서)")
local Game = require(Server.Game)
local okStart, errStart = pcall(Game.start)
check(okStart, `Game.start 오류 없음 ({errStart})`)
task.wait(1)
eq(#workspace.BunsikWorld.Plots:GetChildren(), 6, "시작 후 부지 6칸")
for _, plot in workspace.BunsikWorld.Plots:GetChildren() do
check(plot:GetAttribute("Npc") ~= nil, `{plot.Name}: 빈 부지에 이웃 가게`)
end
task.wait(3)
local npcCustomers = 0
for _, d in workspace.BunsikWorld.Plots:GetDescendants() do
if d.Name == "Customer" then
npcCustomers += 1
end
end
print("이웃 가게 손님 수", npcCustomers)
check(npcCustomers > 0, "이웃 가게에 손님이 옴(실제 Heartbeat)")
print(`통합 테스트: {count - #failures}/{count} 통과`)
if #failures > 0 then
error(`{#failures} failed: ` .. table.concat(failures, " | "))
end
return { passed = count }