From 334c0dc141420c96a9cdf25b9c95a21d72085289 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Fri, 6 Jun 2025 22:18:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E7=AB=AF=E6=AD=A5=E9=AA=A4=E5=8C=85=E5=90=AB=20validate=20?= =?UTF-8?q?=E6=97=B6=E9=AA=8C=E8=AF=81=E5=99=A8=E4=B8=8D=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/version/VERSION | 2 +- testcase.go | 73 ++++++++++++++++++++++++++++++---------- 2 files changed, 57 insertions(+), 18 deletions(-) diff --git a/internal/version/VERSION b/internal/version/VERSION index 5c57b33a..0aa278b1 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-beta-2506062217 +v5.0.0-beta-2506062218 diff --git a/testcase.go b/testcase.go index 4cf37d40..6999248f 100644 --- a/testcase.go +++ b/testcase.go @@ -237,26 +237,65 @@ func (tc *TestCaseDef) loadISteps() (*TestCase, error) { WebSocket: step.WebSocket, }) } else if step.IOS != nil { - testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ - StepConfig: step.StepConfig, - IOS: step.IOS, - }) + if len(step.Validators) > 0 { + testCase.TestSteps = append(testCase.TestSteps, &StepMobileUIValidation{ + StepMobile: &StepMobile{ + StepConfig: step.StepConfig, + IOS: step.IOS, + }, + Validators: step.Validators, + }) + } else { + testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ + StepConfig: step.StepConfig, + IOS: step.IOS, + }) + } } else if step.Harmony != nil { - testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ - StepConfig: step.StepConfig, - Harmony: step.Harmony, - }) + if len(step.Validators) > 0 { + testCase.TestSteps = append(testCase.TestSteps, &StepMobileUIValidation{ + StepMobile: &StepMobile{ + StepConfig: step.StepConfig, + Harmony: step.Harmony, + }, + Validators: step.Validators, + }) + } else { + testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ + StepConfig: step.StepConfig, + Harmony: step.Harmony, + }) + } } else if step.Android != nil { - testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ - StepConfig: step.StepConfig, - Android: step.Android, - }) + if len(step.Validators) > 0 { + testCase.TestSteps = append(testCase.TestSteps, &StepMobileUIValidation{ + StepMobile: &StepMobile{ + StepConfig: step.StepConfig, + Android: step.Android, + }, + Validators: step.Validators, + }) + } else { + testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ + StepConfig: step.StepConfig, + Android: step.Android, + }) + } } else if step.Browser != nil { - testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ - StepConfig: step.StepConfig, - Browser: step.Browser, - }) - + if len(step.Validators) > 0 { + testCase.TestSteps = append(testCase.TestSteps, &StepMobileUIValidation{ + StepMobile: &StepMobile{ + StepConfig: step.StepConfig, + Browser: step.Browser, + }, + Validators: step.Validators, + }) + } else { + testCase.TestSteps = append(testCase.TestSteps, &StepMobile{ + StepConfig: step.StepConfig, + Browser: step.Browser, + }) + } } else if step.Shell != nil { testCase.TestSteps = append(testCase.TestSteps, &StepShell{ StepConfig: step.StepConfig,