mirror of
https://gitlab.com/YuukiPS/GSServer-CBT.git
synced 2025-08-05 11:17:05 +03:00
melon
This commit is contained in:
101
soggy_resources/lua/UAuto/TestCases/item/AllTreasurebox.lua
Normal file
101
soggy_resources/lua/UAuto/TestCases/item/AllTreasurebox.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
|
||||
local UAutoLuaTestCase = class("AllTreasurebox",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "AllTreasurebox"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description="遍历所有01,02,03类型宝箱"
|
||||
self.Order=705
|
||||
function self:CheckTreasureDisappear()
|
||||
local timeout=60
|
||||
while self.Treasurebox:IsDestroied() == false do
|
||||
timeout=timeout-1
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
assert(timeout>0,"宝箱没有在60s内消失")
|
||||
end
|
||||
end
|
||||
|
||||
function self:PickItem()
|
||||
yield_return(self.base:WaitFoundAllNearbyEntities(function(result) self.items = result end,30))
|
||||
assert(self.items.Count>0,tostring(self.pos) .. " 宝箱没有掉落物")
|
||||
-- for k,v in pairs(self.items) do
|
||||
-- yield_return(self.base:MoveToPosition(v.transform.position,10))
|
||||
-- self:Pick(0)
|
||||
-- end
|
||||
end
|
||||
|
||||
UAutoLuaTestCase.SetUp = {
|
||||
Order = 0.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="初始化",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:RunGM("clear all",true,true))
|
||||
yield_return(self.base:SetUpVariables())
|
||||
yield_return(self:ChangeAvatar("Anbo"))
|
||||
yield_return(self.base:RunGM("WUDI ON"))
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE ON"))
|
||||
self.sceneData = sceneData:LoadScene(3,true)
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
|
||||
self.OpenTreasurebox = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="遍历宝箱",
|
||||
Action = UAutoCoroutine(function()
|
||||
print(self.sceneData.GetSuiteGadgets)
|
||||
self.Gadgets = self.sceneData:GetSuiteGadgets()
|
||||
for k,v in pairs(self.Gadgets) do
|
||||
if v.gadget_id==70210001 then
|
||||
self.searchName = 'SceneObj_Item_Treasurebox01'
|
||||
elseif v.gadget_id==70210002 then
|
||||
self.searchName = 'SceneObj_Item_Treasurebox02'
|
||||
elseif v.gadget_id==70210003 then
|
||||
self.searchName = 'SceneObj_Item_Treasurebox03'
|
||||
end
|
||||
|
||||
--普通宝箱
|
||||
if v.gadget_id==70210001 or v.gadget_id==70210002 or v.gadget_id==70210003 then
|
||||
local teleportCmd = "goto " .. v.pos.x+1.5 .. " " .. (v.pos.y+10) .. " " .. (v.pos.z+1.5)
|
||||
self.pos = CS.UnityEngine.Vector3(v.pos.x,v.pos.y,v.pos.z)
|
||||
yield_return(self.base:RunGM(teleportCmd,true,true))
|
||||
yield_return(self.base:WaitFoundGameObject("InLevelMainPage", function(result) self.InLevelMainPage=result end))
|
||||
yield_return(self.base:WaitLevelLoaded("Level"))
|
||||
|
||||
yield_return(self.base:WaitFoundNearByEntityByName(self.searchName,function(result) self.Treasurebox = result end))
|
||||
assert(self.Treasurebox~=nil,self.searchName.." 宝箱没找到 "..tostring(self.pos))
|
||||
|
||||
if v.gadget_id == 70210003 then
|
||||
yield_return(self.base:RunGM("KILL MONSTER ALL"))
|
||||
end
|
||||
|
||||
yield_return(self.base:MoveToPosition(self.pos,10,1))
|
||||
|
||||
yield_return(self:WaitTalk(0))
|
||||
if v.gadget_id==70210002 then
|
||||
yield_return(self.base:RunGM("KILL MONSTER ALL"))
|
||||
yield_return(self.base:MoveByAngle(0))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
yield_return(self.base:MoveByAngle(0,true))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position,5))
|
||||
yield_return(self.base:RunGM("KILL MONSTER ALL"))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(15))
|
||||
yield_return(self:WaitTalk(0))
|
||||
end
|
||||
yield_return(self:CheckTreasureDisappear())
|
||||
yield_return(self:PickItem())
|
||||
end
|
||||
|
||||
|
||||
|
||||
end
|
||||
yield_return(self.base:RunGM("WUDI OFF"))
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE OFF"))
|
||||
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
return self
|
82
soggy_resources/lua/UAuto/TestCases/item/KapokFlower01.lua
Normal file
82
soggy_resources/lua/UAuto/TestCases/item/KapokFlower01.lua
Normal file
@@ -0,0 +1,82 @@
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
local UAutoLuaTestCase = class("KapokFlower01",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "KapokFlower01"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description = "打击木棉花,捡取物品"
|
||||
self.Order=706
|
||||
local StartPosition = CS.UnityEngine.Vector3(1869.9863,195.8449,-5268.864)
|
||||
local AttackPosition = CS.UnityEngine.Vector3(1865.5633,195.2825,-5264.2233)
|
||||
local MovePosition = CS.UnityEngine.Vector3(1864.9346,195.0369,-5261.4623)
|
||||
local TargetPosition = CS.UnityEngine.Vector3(1866.3359,195.3827,-5265.4314)
|
||||
UAutoLuaTestCase.SetUp = {
|
||||
Order = 0.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description = "初始化",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:SetUpVariables())
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.FindKapokFlower01 = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description = "瞬移到1869.9863,195.8449,-5268.864,找到木棉花,切换到绫华",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:TelePort(StartPosition))
|
||||
yield_return(self:ChangeAvatar("Ayaka"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
UAutoLuaTestCase.WaterOnKapokFlower01 = {
|
||||
Order = 2,
|
||||
Type = CaseType.MonoTest,
|
||||
Description = "使用绫华的水激流给木棉花上水",
|
||||
Action = UAutoCoroutine(function()
|
||||
|
||||
yield_return(self.base:Skill(2,false))
|
||||
yield_return(self.base:MoveToPosition(TargetPosition))
|
||||
yield_return(self.base:MoveToPosition(MovePosition))
|
||||
yield_return(self.base:MoveToPosition(TargetPosition))
|
||||
yield_return(self.base:MoveToPosition(StartPosition))
|
||||
yield_return(self.base:SkillUp(2))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
UAutoLuaTestCase.AttackKapokFlower01 = {
|
||||
Order = 3,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="攻击木棉花",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:MoveToPosition(MovePosition))
|
||||
yield_return(self.base:MoveToPosition(AttackPosition))
|
||||
local attackCount = 6
|
||||
while attackCount > 0 do
|
||||
yield_return(self.base:Skill(0))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(0.3))
|
||||
attackCount = attackCount - 1
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
UAutoLuaTestCase.GetKapokFlower01 = {
|
||||
Order = 4,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="捡取木棉花掉落物",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:MoveToPosition(TargetPosition))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(2))
|
||||
yield_return(self.base:WaitFoundAllNearbyEntities(function(result) self.items = result end))
|
||||
print(self.items)
|
||||
for k,v in pairs(self.items) do
|
||||
yield_return(self.base:MoveToPosition(v.transform.position))
|
||||
self:Pick(0)
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
return self
|
63
soggy_resources/lua/UAuto/TestCases/item/PumpkinBomb01.lua
Normal file
63
soggy_resources/lua/UAuto/TestCases/item/PumpkinBomb01.lua
Normal file
@@ -0,0 +1,63 @@
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
local UAutoLuaTestCase = class("PumpkinBomb01",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "PumpkinBomb01"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description="爆炸南瓜"
|
||||
local PumpPosition = CS.UnityEngine.Vector3(2745.824, 194.5971, -1718.185)
|
||||
local AttackPosition = CS.UnityEngine.Vector3(2740.824, 194.5971, -1718.185)
|
||||
self.Order=707
|
||||
UAutoLuaTestCase.SetUp = {
|
||||
Order = 0.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="初始化",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:SetUpVariables())
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.FindPumpkinBomb01 = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="在2745.824, 194.5971, -1718.185创建爆炸南瓜",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:TelePort(PumpPosition))
|
||||
yield_return(self.base:RunGM("GADGET 70220004 1"))
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE ON"))
|
||||
yield_return(self.base:RunGM("WUDI ON"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
UAutoLuaTestCase.FireOnPumpkinBomb01 = {
|
||||
Order = 2,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="使用安柏充能技打击南瓜",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self:ChangeAvatar("Anbo"))
|
||||
|
||||
self.oldCount = self.base:GetEntityCount("PumpkinBomb01")
|
||||
print(self.oldCount)
|
||||
yield_return(self.base:MoveToPosition(AttackPosition))
|
||||
yield_return(self.base:RotateCamera(PumpPosition))
|
||||
yield_return(self.base:Skill(4))
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE OFF"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
UAutoLuaTestCase.WaitPumpkinBombFinish = {
|
||||
Order = 3,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="等待爆炸并检查南瓜消失",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(10))
|
||||
self.newCount = self.base:GetEntityCount("PumpkinBomb01")
|
||||
print(self.newCount-self.oldCount)
|
||||
assert(self.oldCount - self.newCount >= 1, "PumpkinBomb01 not disappear")
|
||||
yield_return(self.base:RunGM("WUDI OFF"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
return self
|
@@ -0,0 +1,69 @@
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
local UAutoLuaTestCase = class("OpenTreasure01",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "OpenTreasure01"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description="打开01普通类型宝箱"
|
||||
self.Order=700
|
||||
UAutoLuaTestCase.SetUp = {
|
||||
Order = 0.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="初始化",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:SetUpVariables())
|
||||
end)
|
||||
}
|
||||
|
||||
self.FindTreasure01 = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="瞬移到2799.7,199.6,-1742.7处的宝箱",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:TelePort(CS.UnityEngine.Vector3(2796.7,198.8336,-1742.461)))--2799.7,199.6,-1742.7
|
||||
yield_return(self.base:WaitFoundNearByEntityByName("Treasurebox01",function(result) self.Treasurebox = result end))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
self.OpenTreasure01 = {
|
||||
Order = 2,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="打开宝箱",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self:WaitTalk(0))
|
||||
end)
|
||||
}
|
||||
|
||||
self.WaitTreasureBoxDisappear = {
|
||||
Order = 2.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="验证宝箱开启后消失",
|
||||
Action = UAutoCoroutine(function ()
|
||||
local timeout=60
|
||||
while self.Treasurebox:IsDestroied() == false do
|
||||
timeout=timeout-1
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
assert(timeout>0,"宝箱没有在60s内消失")
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
||||
self.GetTreasureItem = {
|
||||
Order = 3,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="捡取掉落物",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
yield_return(self.base:WaitFoundAllNearbyEntities(function(result) self.items = result end))
|
||||
print(self.items)
|
||||
--for k,v in pairs(self.items) do
|
||||
-- yield_return(self.base:MoveToPosition(v.transform.position))
|
||||
-- self:Pick(0)
|
||||
--end
|
||||
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
return self
|
@@ -0,0 +1,95 @@
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
local UAutoLuaTestCase = class("OpenTreasure02",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "OpenTreasure02"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description = "打开02类型杀怪宝箱"
|
||||
self.Order=701
|
||||
UAutoLuaTestCase.SetUp = {
|
||||
Order = 0.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:SetUpVariables())
|
||||
yield_return(self.base:RunGM("WUDI ON"))
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.FindTreasure02 = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description = "移动到02类型宝箱",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:TelePort(CS.UnityEngine.Vector3(1975.93193,215.6965,-1481.5383)))
|
||||
yield_return(self.base:WaitFoundNearByEntityByName("SceneObj_Item_Treasurebox02",function(result) self.Treasurebox = result end))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
UAutoLuaTestCase.OpenTreasure02FailedWhenHasMonster = {
|
||||
Order = 2,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="有怪时,开启宝箱",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self:WaitTalk(0))
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.KillMonster = {
|
||||
Order = 3,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="清怪",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:RunGM("KILL MONSTER ALL"))
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.OpenTreasure02 = {
|
||||
Order = 4,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="开启宝箱",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:MoveByAngle(0))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1.5))
|
||||
yield_return(self.base:MoveByAngle(0,true))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(20))
|
||||
yield_return(self:WaitTalk(0))
|
||||
end)
|
||||
}
|
||||
|
||||
self.WaitTreasureBoxDisappear = {
|
||||
Order = 4.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="验证宝箱开启后消失",
|
||||
Action = UAutoCoroutine(function ()
|
||||
local timeout=60
|
||||
while self.Treasurebox:IsDestroied() == false do
|
||||
timeout=timeout-1
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
assert(timeout>0,"宝箱没有在60s内消失")
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.GetTreasureItem = {
|
||||
Order = 5,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="捡取掉落物",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
yield_return(self.base:WaitFoundAllNearbyEntities(function(result) self.items = result end))
|
||||
print(self.items)
|
||||
for k,v in pairs(self.items) do
|
||||
if(v~=nil and v.transform~=nil) then
|
||||
yield_return(self.base:MoveToPosition(v.transform.position))
|
||||
self:Pick(0)
|
||||
end
|
||||
end
|
||||
yield_return(self.base:RunGM("WUDI OFF"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
|
||||
return self
|
@@ -0,0 +1,71 @@
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
local UAutoLuaTestCase = class("OpenTreasure03",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "OpenTreasure03"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description="开启03类型黄金宝箱"
|
||||
self.Order=702
|
||||
UAutoLuaTestCase.SetUp = {
|
||||
Order = 0.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="初始化",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:SetUpVariables())
|
||||
yield_return(self.base:RunGM("wudi on"))
|
||||
end)
|
||||
}
|
||||
|
||||
self.FindTreasure03 = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="瞬移到(2316.558 218.1997 -1111.945)找到03类型黄金宝箱",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:TelePort(CS.UnityEngine.Vector3(2316.558, 218.1997, -1111.945)))
|
||||
yield_return(self.base:RunGM("KILL MONSTER ALL"))
|
||||
yield_return(self.base:WaitFoundNearByEntityByName("TreasureBox03",function(result) self.Treasurebox = result end,100))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position,60,2))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
self.OpenTreasure03 = {
|
||||
Order = 4,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="开启宝箱",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self:WaitTalk(0))
|
||||
end)
|
||||
}
|
||||
|
||||
self.WaitTreasureBoxDisappear = {
|
||||
Order = 4.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="验证宝箱开启后消失",
|
||||
Action = UAutoCoroutine(function ()
|
||||
local timeout=60
|
||||
while self.Treasurebox:IsDestroied() == false do
|
||||
timeout=timeout-1
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
assert(timeout>0,"宝箱没有在60s内消失")
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
||||
self.GetTreasureItem = {
|
||||
Order = 5,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="捡取物品",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
yield_return(self.base:WaitFoundAllNearbyEntities(function(result) self.items = result end))
|
||||
print(self.items)
|
||||
for k,v in pairs(self.items) do
|
||||
yield_return(self.base:MoveToPosition(v.transform.position))
|
||||
yield_return(self:Pick(0))
|
||||
end
|
||||
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
return self
|
@@ -0,0 +1,102 @@
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
local UAutoLuaTestCase = class("OpenTreasure04",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "OpenTreasure04"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description = "打开蔓藤宝箱"
|
||||
self.Order=703
|
||||
|
||||
local AttackPosition = CS.UnityEngine.Vector3(2652.6,252,-1674.5)
|
||||
local MovePosition = AttackPosition
|
||||
|
||||
UAutoLuaTestCase.SetUp = {
|
||||
Order = 0.1,
|
||||
Description = "初始化",
|
||||
Type = CaseType.MonoTest,
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:SetUpVariables())
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.FindTreasure04 = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description = "找到蔓藤宝箱",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:TelePort(MovePosition))
|
||||
yield_return(self.base:WaitFoundNearByEntityByName("Treasurebox04",function(result) self.Treasurebox = result end))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position,60,2))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
UAutoLuaTestCase.OpenTreasure04Failed = {
|
||||
Order = 4,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="不去掉蔓藤,开启宝箱失败",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self:WaitTalk(0))
|
||||
end)
|
||||
}
|
||||
|
||||
UAutoLuaTestCase.AttackTreasure04 = {
|
||||
Order = 5,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="换成安柏,用充能技攻击宝箱",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:MoveToPosition(MovePosition))
|
||||
yield_return(self:ChangeAvatar("Anbo"))
|
||||
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE ON"))
|
||||
yield_return(self.base:RunGM("WUDI ON"))
|
||||
yield_return(self.base:RotateCamera(self.Treasurebox.transform.position))
|
||||
yield_return(self.base:Skill(4))
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE OFF"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
|
||||
UAutoLuaTestCase.OpenTreasure04Success = {
|
||||
Order = 5.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="蔓藤烧毁,开启宝箱",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position,60,2))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(5))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position,60,2))
|
||||
yield_return(self:WaitTalk(0))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
self.WaitTreasureBoxDisappear = {
|
||||
Order = 5.2,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="验证宝箱开启后消失",
|
||||
Action = UAutoCoroutine(function ()
|
||||
local timeout=60
|
||||
while self.Treasurebox:IsDestroied() == false do
|
||||
timeout=timeout-1
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
assert(timeout>0,"宝箱没有在60s内消失")
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
||||
self.GetTreasureItem = {
|
||||
Order = 6,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="获取宝箱的掉落物",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:WaitFoundAllNearbyEntities(function(result) self.items = result end))
|
||||
for k,v in pairs(self.items) do
|
||||
yield_return(self.base:MoveToPosition(v.transform.position))
|
||||
self:Pick(0)
|
||||
end
|
||||
yield_return(self.base:RunGM("WUDI OFF"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
return self
|
@@ -0,0 +1,94 @@
|
||||
|
||||
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
|
||||
local UAutoLuaTestCase = class("OpenTreasure05",baseClass)
|
||||
local self = UAutoLuaTestCase
|
||||
UAutoLuaTestCase.TestFixture = "OpenTreasure05"
|
||||
UAutoLuaTestCase.Category = "交互机关"
|
||||
self.Description = "打开05类型的冰宝箱"
|
||||
self.Order=704
|
||||
local StartPosition = CS.UnityEngine.Vector3(2540,354,-1677)
|
||||
local AttackPosition = CS.UnityEngine.Vector3(2540,354,-1674)
|
||||
|
||||
self.SetUp = {
|
||||
Order = 0.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description = "初始化",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:SetUpVariables())
|
||||
yield_return(self.base:RunGM("clear all",true,true))
|
||||
end)
|
||||
}
|
||||
|
||||
self.FindTreasure05 = {
|
||||
Order = 1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description = "找到冰宝箱",
|
||||
Action = UAutoCoroutine(function()
|
||||
yield_return(self.base:TelePort(StartPosition))
|
||||
yield_return(self.base:WaitFoundNearByEntityByName("SceneObj_Item_Treasurebox05",function(result) self.Treasurebox = result end))
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
self.OpenTreasure05Failed = {
|
||||
Order = 4,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="未烧掉冰时开启宝箱失败",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self:WaitTalk(0))
|
||||
end)
|
||||
}
|
||||
|
||||
self.AttackTreasure05 = {
|
||||
Order = 5,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="切换安柏,使用充能技攻击冰宝箱",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:MoveToPosition(StartPosition))
|
||||
yield_return(self:ChangeAvatar("Anbo"))
|
||||
yield_return(self.base:MoveToPosition(AttackPosition))
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE ON"))
|
||||
yield_return(self.base:RunGM("WUDI ON"))
|
||||
yield_return(self.base:Skill(4))
|
||||
yield_return(self.base:RunGM("ENERGY INFINITE OFF"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
self.WaitTreasureBoxDisappear = {
|
||||
Order = 5.1,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="验证宝箱开启后消失",
|
||||
Action = UAutoCoroutine(function ()
|
||||
local timeout=60
|
||||
while self.Treasurebox:IsDestroied() == false do
|
||||
timeout=timeout-1
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(1))
|
||||
assert(timeout>0,"宝箱没有在60s内消失")
|
||||
end
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
self.GetTreasureItem = {
|
||||
Order = 6,
|
||||
Type = CaseType.MonoTest,
|
||||
Description="获取宝箱掉落物",
|
||||
Action = UAutoCoroutine(function ()
|
||||
yield_return(self.base:MoveToPosition(self.Treasurebox.transform.position))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(5))
|
||||
yield_return(self:WaitTalk(0))
|
||||
yield_return(CS.UnityEngine.WaitForSeconds(5))
|
||||
yield_return(self.base:WaitFoundAllNearbyEntities(function(result) self.items = result end))
|
||||
print(self.items)
|
||||
for k,v in pairs(self.items) do
|
||||
yield_return(self.base:MoveToPosition(v.transform.position))
|
||||
self:Pick(0)
|
||||
end
|
||||
yield_return(self.base:RunGM("WUDI OFF"))
|
||||
end)
|
||||
}
|
||||
|
||||
|
||||
return self
|
Reference in New Issue
Block a user