change: remove xpath validation

This commit is contained in:
debugtalk
2022-08-28 10:31:16 +08:00
parent bfc8f89cba
commit 98f0f5de90
4 changed files with 11 additions and 52 deletions

View File

@@ -158,31 +158,31 @@ type StepAndroidValidation struct {
step *TStep
}
func (s *StepAndroidValidation) AssertXpathExists(expectedXpath string, msg ...string) *StepAndroidValidation {
func (s *StepAndroidValidation) AssertNameExists(expectedName string, msg ...string) *StepAndroidValidation {
v := Validator{
Check: uiSelectorXpath,
Check: uiSelectorName,
Assert: assertionExists,
Expect: expectedXpath,
Expect: expectedName,
}
if len(msg) > 0 {
v.Message = msg[0]
} else {
v.Message = fmt.Sprintf("xpath [%s] not found", expectedXpath)
v.Message = fmt.Sprintf("[%s] not found", expectedName)
}
s.step.Validators = append(s.step.Validators, v)
return s
}
func (s *StepAndroidValidation) AssertXpathNotExists(expectedXpath string, msg ...string) *StepAndroidValidation {
func (s *StepAndroidValidation) AssertNameNotExists(expectedName string, msg ...string) *StepAndroidValidation {
v := Validator{
Check: uiSelectorXpath,
Check: uiSelectorName,
Assert: assertionNotExists,
Expect: expectedXpath,
Expect: expectedName,
}
if len(msg) > 0 {
v.Message = msg[0]
} else {
v.Message = fmt.Sprintf("xpath [%s] should not exist", expectedXpath)
v.Message = fmt.Sprintf("[%s] should not exist", expectedName)
}
s.step.Validators = append(s.step.Validators, v)
return s