diff --git a/selectable.go b/selectable.go index 2d3e528..461b4a1 100644 --- a/selectable.go +++ b/selectable.go @@ -106,6 +106,16 @@ func (s *selectable) FindByID(id string) *Selection { return newSelection(s.session, s.selectors.Append(target.ID, id).Single()) } +//Find by android ui automator +func (s *selectable) FindByAndroidUIAutomator(selector string) * Selection { + return newSelection(s.session, s.selectors.Append(target.AndroidAut, selector).Single()) +} + +//Find by iOS ui automator +func (s *selectable) FindByIOSUIAutomator(selector string) * Selection { + return newSelection(s.session, s.selectors.Append(target.IOSAut, selector).Single()) +} + // First finds the first element by CSS selector. func (s *selectable) First(selector string) *Selection { return newSelection(s.session, s.selectors.Append(target.CSS, selector).At(0)) @@ -142,6 +152,16 @@ func (s *selectable) FirstByClass(text string) *Selection { return newSelection(s.session, s.selectors.Append(target.Class, text).At(0)) } +//FirstByAndroidUIAutomator finds the first element given by the ui automation expression. +func (s *selectable) FirstByAndroidUIAutomator(selector string) * Selection { + return newSelection(s.session, s.selectors.Append(target.AndroidAut, selector).At(0)) +} + +//FirstByIOSUIAutomator finds the first element given by the ui automation expression. +func (s *selectable) FirstByIOSUIAutomator(selector string) * Selection { + return newSelection(s.session, s.selectors.Append(target.IOSAut, selector).At(0)) +} + // All finds zero or more elements by CSS selector. func (s *selectable) All(selector string) *MultiSelection { return newMultiSelection(s.session, s.selectors.Append(target.CSS, selector)) @@ -183,6 +203,16 @@ func (s *selectable) AllByID(text string) *MultiSelection { return newMultiSelection(s.session, s.selectors.Append(target.ID, text)) } +//Find by android ui automator +func (s *selectable) AllByAndroidUIAutomator(text string) * Selection { + return newSelection(s.session, s.selectors.Append(target.AndroidAut, text).Single()) +} + +//Find by ios ui automator +func (s *selectable) AllByIOSUIAutomator(text string) * Selection { + return newSelection(s.session, s.selectors.Append(target.IOSAut, text).Single()) +} + // FirstByClass finds the first element with a given CSS class. func (s *selectable) FindForAppium(selectorType string, text string) *Selection { return newSelection(s.session, s.selectors.Append(target.Class, text).At(0))