mirror of
https://gitlab.com/YuukiPS/GSServer-CBT.git
synced 2025-10-06 03:46:00 +03:00
melon
This commit is contained in:
@@ -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