This commit is contained in:
Akbar Yahya
2022-11-21 16:30:31 +08:00
commit e0d4d8040c
3326 changed files with 683000 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
local UAutoLuaTestCase = class("ChangeCharacter",baseClass)
local self = UAutoLuaTestCase
UAutoLuaTestCase.TestFixture = "ChangeCharacter"
UAutoLuaTestCase.Category = "UI,角色通用"
self.Description = "换人"
UAutoLuaTestCase.SetUp = {
Order = 0.1,
Type = CaseType.MonoTest,
Description = "初始化",
Action = UAutoCoroutine(function()
yield_return(self.base:SetUpVariables())
end)
}
UAutoLuaTestCase.ChangeAyaka = {
Order = 5,
Type = CaseType.MonoTest,
Description = "换绫华",
Action = UAutoCoroutine(function()
yield_return(self:ChangeAvatar("Ayaka"))
end)
}
UAutoLuaTestCase.ChangeAmber = {
Order = 1,
Type = CaseType.MonoTest,
Description = "换安柏",
Action = UAutoCoroutine(function ()
yield_return(self:ChangeAvatar("Anbo"))
end)
}
UAutoLuaTestCase.ChangeQin = {
Order = 2,
Type = CaseType.MonoTest,
Description = "换琴",
Action = UAutoCoroutine(function ()
yield_return(self:ChangeAvatar("Qin"))
end)
}
UAutoLuaTestCase.ChangeLisa = {
Order = 3,
Type = CaseType.MonoTest,
Description = "换丽莎",
Action = UAutoCoroutine(function ()
yield_return(self:ChangeAvatar("Lisa"))
end)
}
return self

View File

@@ -0,0 +1,78 @@
local baseClass = require('UAuto/TestCases/UI/Character/CharacterPageBase')
local UAutoLuaTestCase = class("CharacterEnterReturnTwice",baseClass)
local self = UAutoLuaTestCase
self.Category="UI,角色养成系统"
UAutoLuaTestCase.TestFixture = "CharacterEnterReturnTwice"
self.Description = "在主城边打开角色界面->退出->再次打开角色界面"
UAutoLuaTestCase.FlyToHall = {
Order=0.9,
Category="角色养成系统",
Type = CaseType.MonoTest,
Description = "瞬移到主城口",
Action = UAutoCoroutine(function()
yield_return(self.base:TelePort(CS.UnityEngine.Vector3(2154.3323,210.6245,-1034.27304)))
end)
}
UAutoLuaTestCase.OpenCharacterPage = {
Order=1,
Category="角色养成系统",
Type = CaseType.MonoTest,
Description = "打开角色页面",
Action = UAutoCoroutine(self.OpenCharacterPageAction)
}
UAutoLuaTestCase.CloseCharacterPage = {
Order=2,
Category="角色养成系统",
Type = CaseType.MonoTest,
Description = "关闭角色页面",
Action = UAutoCoroutine(self.CloseCharacterPageAction)
}
UAutoLuaTestCase.ReturnToHome = {
Order=3,
Category="角色养成系统",
Type = CaseType.MonoTest,
Description = "返回到Home",
Action = UAutoCoroutine(function()
self.monoInLevelMainPage.gmButton.onClick:Invoke()
yield_return (self.base:WaitFoundGameObject("InLevelDebugMenuDialog",function(result) self.InLevelDebugMenuDialog = result end))
self.MonoInLevelDebugMenuDialog = self.InLevelDebugMenuDialog:GetComponent("MonoInLevelDebugMenuDialog")
self.MonoInLevelDebugMenuDialog.returnButton.onClick:Invoke()
yield_return (self.base:WaitLevelLoaded("Home"))
end)
}
UAutoLuaTestCase.EnterMaster = {
Order=4,
Category="角色养成系统",
Type = CaseType.MonoTest,
Description = "再次进入Daily",
Action = UAutoCoroutine(function()
yield_return(self.base:EnterBigWorldFromGame("Daily",false))
yield_return (self.base:WaitLevelLoaded("Level"))
yield_return(self:WaitCutScene(true,60,true))
end)
}
UAutoLuaTestCase.OpenCharacterPageAgain = {
Order=5,
Category="角色养成系统",
Type = CaseType.MonoTest,
Description = "再次打开角色页面",
Action = UAutoCoroutine(self.OpenCharacterPageAction)
}
UAutoLuaTestCase.CloseCharacterPageAgain = {
Order=6,
Category="角色养成系统",
Type = CaseType.MonoTest,
Description = "关闭角色页面",
Action = UAutoCoroutine(self.CloseCharacterPageAction)
}
return self

View File

@@ -0,0 +1,26 @@
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
local UAutoLuaTestCase = class("CharacterPageBase",baseClass)
UAutoLuaTestCase.TestFixture = "CharacterPageBase"
local self = UAutoLuaTestCase
function self.OpenCharacterPageAction()
yield_return(CS.UnityEngine.WaitForSeconds(1))
yield_return(self.base:SetUpVariables())
print(self.InLevelMainPage)
self.monoInLevelMainPage = self.InLevelMainPage:GetComponent("MonoInLevelMainPage")
self.monoInLevelMainPage.characterPageToggle.onClick:Invoke()
yield_return (self.base:WaitFoundGameObject("CharacterPage",function(result) self.CharacterPage = result end))
end
function self.CloseCharacterPageAction()
yield_return (self.base:WaitFoundGameObject("CharacterPage",function(result) self.CharacterPage = result end))
yield_return(CS.UnityEngine.WaitForSeconds(5))
self.MonoCharacterPage = self.CharacterPage:GetComponent("MonoCharacterPage")
assert(self.MonoCharacterPage~=nil,"MonoCharacterPage is nil")
self._returnButton = self.MonoCharacterPage:GetPrivateField("_returnButton")
self._returnButton:GetButton().onClick:Invoke()
yield_return(CS.UnityEngine.WaitForSeconds(5))
end
return self

View File

@@ -0,0 +1,141 @@
local baseClass = require('UAuto/TestCases/UI/Character/CharacterPageBase')
local UAutoLuaTestCase = class("OpenAllProperties",baseClass)
local self = UAutoLuaTestCase
UAutoLuaTestCase.TestFixture = self.__className
self.Description = "打开角色页面,依次查看各角色属性页面"
self.Category="UI,角色养成系统"
UAutoLuaTestCase.SetUp = {
Order = 0.1,
Type = CaseType.MonoTest,
Description = "初始化",
Action = UAutoCoroutine(function()
yield_return(self.base:SetUpVariables())
end)
}
self.OpenCharacter = {
Order=1,
Category="角色养成系统",
Description = "打开角色页面",
Type = CaseType.MonoTest,
Action = UAutoCoroutine(self.OpenCharacterPageAction)
}
self.ChoosePropertyTab = {
Order=2,
Category="角色养成系统",
Description = "选择属性页",
Type = CaseType.MonoTest,
Action = UAutoCoroutine(function()
self.MonoCharacterPage = self.CharacterPage:GetComponent("MonoCharacterPage")
assert(self.MonoCharacterPage~=nil,"MonoCharacterPage is nil")
self.MonoCharacterPage.weaponButton.onClick:Invoke()
yield_return(CS.UnityEngine.WaitForSeconds(1))
self.MonoCharacterPage.propertyButton.onClick:Invoke()
local timeout=10
while self.MonoCharacterPage.propertyButton.interactable do
yield_return(CS.UnityEngine.WaitForSeconds(1))
timeout=timeout-1
assert(timeout>0,"打开属性页失败")
end
end)
}
self.ChooseWeaponTab = {
Order=3,
Category="角色养成系统",
Description = "选择武器页",
Type = CaseType.MonoTest,
Action = UAutoCoroutine(function()
self.MonoCharacterPage = self.CharacterPage:GetComponent("MonoCharacterPage")
assert(self.MonoCharacterPage~=nil,"MonoCharacterPage is nil")
self.MonoCharacterPage.weaponButton.onClick:Invoke()
yield_return(CS.UnityEngine.WaitForSeconds(1))
self.MonoCharacterPage.weaponButton.onClick:Invoke()
local timeout=10
while self.MonoCharacterPage.weaponButton.interactable do
yield_return(CS.UnityEngine.WaitForSeconds(1))
timeout=timeout-1
assert(timeout>0,"打开武器页失败")
end
end)
}
self.ChooseRelicTab = {
Order=4,
Category="角色养成系统",
Description = "选择圣遗物页",
Type = CaseType.MonoTest,
Action = UAutoCoroutine(function()
self.MonoCharacterPage = self.CharacterPage:GetComponent("MonoCharacterPage")
assert(self.MonoCharacterPage~=nil,"MonoCharacterPage is nil")
self.MonoCharacterPage.relicButton.onClick:Invoke()
yield_return(CS.UnityEngine.WaitForSeconds(1))
self.MonoCharacterPage.relicButton.onClick:Invoke()
local timeout=10
while self.MonoCharacterPage.relicButton.interactable do
yield_return(CS.UnityEngine.WaitForSeconds(1))
timeout=timeout-1
assert(timeout>0,"打开圣遗物页失败")
end
end)
}
self.ChooseTalentTab = {
Order=5,
Category="角色养成系统",
Description = "选择天赋页",
Type = CaseType.MonoTest,
Action = UAutoCoroutine(function()
yield_return(self.base:RunGM("player exp 1000"))
self.MonoCharacterPage = self.CharacterPage:GetComponent("MonoCharacterPage")
assert(self.MonoCharacterPage~=nil,"MonoCharacterPage is nil")
self.MonoCharacterPage.talentButton.onClick:Invoke()
yield_return(CS.UnityEngine.WaitForSeconds(1))
self.MonoCharacterPage.talentButton.onClick:Invoke()
local timeout=10
while self.MonoCharacterPage.talentButton.interactable do
yield_return(CS.UnityEngine.WaitForSeconds(1))
timeout=timeout-1
assert(timeout>0,"打开天赋页失败")
end
end)
}
self.ChooseAvatarTabs = {
Order=6,
Category="角色养成系统",
Description = "依次点击各角色",
Type = CaseType.MonoTest,
Action = UAutoCoroutine(function()
assert(self.MonoCharacterPage~=nil,"MonoCharacterPage is nil")
local MonoImgTabs = self.MonoCharacterPage.grpTab:GetComponentsInChildren(typeof(CS.MoleMole.MonoImgTab))
print(MonoImgTabs.Length)
for i=0,MonoImgTabs.Length-1 do
yield_return(CS.UnityEngine.WaitForSeconds(1))
yield_return(self.base:ClickOnPointerObject(MonoImgTabs[i].gameObject))
end
end)
}
self.Close = {
Order=7,
Category="角色养成系统",
Description = "关闭CharacterPage",
Type = CaseType.MonoTest,
Action = UAutoCoroutine(function()
self:CloseCharacterPageAction()
end)
}
return self

View File

@@ -0,0 +1,68 @@
local baseClass = require('UAuto/Base/UAutoLuaTestBase')
local UAutoLuaTestCase = class("MapTransPoint",baseClass)
local self = UAutoLuaTestCase
UAutoLuaTestCase.TestFixture = "MapTransPoint"
UAutoLuaTestCase.Category = "UI,小地图"
self.Description = "点击小地图上各传送点"
function UAutoLuaTestCase.FindAllMapPointAction()
yield_return(self:OpenMap())
yield_return(self.base:WaitFoundGameObjectsInChildren(self.InLevelMapPage,"MarkPoint",function(result) self.MarkPoints = result end))
assert(self.MarkPoints~=nil,"FindAllMapPointAction No MarkTransPoints")
end
function UAutoLuaTestCase.ClickTransPointsAction()
yield_return(self.FindAllMapPointAction())
assert(self.MarkPoints~=nil,"ClickTransPointsAction No MonoMapMark")
yield_return(self:CloseMap())
for k,v in pairs(self.MarkPoints) do
self.monoMapMark = v:GetComponent("MonoMapMark")
print(self.monoMapMark.markType:EnumToInt())
if(self.monoMapMark.markType:EnumToInt()==1 and (self.monoMapMark.iconType:EnumToInt()==100
or (self.monoMapMark.iconType:EnumToInt()>=200 and self.monoMapMark.iconType:EnumToInt()<300))) then
if (v.transform.localPosition.x < math.huge and v.transform.localPosition.x > -math.huge) then
print(v.transform.localPosition)
yield_return(self:OpenMap())
yield_return(CS.UnityEngine.WaitForSeconds(2))
yield_return(self.base:ClickOnMap(v))
yield_return(CS.UnityEngine.WaitForSeconds(1))
yield_return(self.base:WaitLevelLoaded("Level"));
yield_return(CS.UnityEngine.WaitForSeconds(2))
end
end
end
end
UAutoLuaTestCase.SetUp = {
Order = 0.1,
Type = CaseType.MonoTest,
Description = "初始化GM命令开启传送点",
Action = UAutoCoroutine(function()
yield_return(self.base:RunGM("quest finish 35001"))
yield_return(self.base:RunGM("point 3 all"))
yield_return(self.base:SetUpVariables())
end)
}
UAutoLuaTestCase.ClickAllTransPoints = {
Order = 1,
Type = CaseType.MonoTest,
Description = "依次点击各个传送点,并传送",
Action = UAutoCoroutine(self.ClickTransPointsAction)
}
UAutoLuaTestCase.CloseMiniMap = {
Order = 3,
Type = CaseType.MonoTest,
Description = "关闭小地图",
Action = UAutoCoroutine(function()
self:CloseMap()
end)
}
return self