public static void ValidateNumberIs <T>(this T control, int value, int?timeout = null, int?sleepInterval = null) where T : IElementNumber, IElement <IOSElement> { ValidateControlWaitService.WaitUntil <IOSDriver <IOSElement>, IOSElement>(() => control.GetNumber().Equals(value), $"The control's number should be '{value}' but was '{control.GetNumber()}'.", timeout, sleepInterval); ValidatedNumberIsEvent?.Invoke(control, new ElementActionEventArgs <IOSElement>(control, value.ToString())); }
public static void ValidateTimeIs <T>(this T control, string value, int?timeout = null, int?sleepInterval = null) where T : IElementTime, IElement <AndroidElement> { ValidateControlWaitService.WaitUntil <AndroidDriver <AndroidElement>, AndroidElement>(() => control.GetTime().Equals(value), $"The control's time should be '{value}' but was '{control.GetTime()}'.", timeout, sleepInterval); ValidatedTimeIsEvent?.Invoke(control, new ElementActionEventArgs <AndroidElement>(control, value)); }
public static void ValidateTextIsNotSet <TComponent>(this TComponent control, int?timeout = null, int?sleepInterval = null) where TComponent : IComponentText, IComponent <IOSElement> { ValidateControlWaitService.WaitUntil <IOSDriver <IOSElement>, IOSElement>(() => string.IsNullOrEmpty(control.GetText()), $"The control's text should be null but was '{control.GetText()}'.", timeout, sleepInterval); ValidatedTextIsNotSetEvent?.Invoke(control, new ComponentActionEventArgs <IOSElement>(control)); }
public static void ValidateTextIs <TComponent>(this TComponent control, string value, int?timeout = null, int?sleepInterval = null) where TComponent : IComponentText, IComponent <IOSElement> { ValidateControlWaitService.WaitUntil <IOSDriver <IOSElement>, IOSElement>(() => control.GetText().Equals(value), $"The control's text should be '{value}' but was '{control.GetText()}'.", timeout, sleepInterval); ValidatedTextIsEvent?.Invoke(control, new ComponentActionEventArgs <IOSElement>(control, value)); }
public static void ValidateIsNotDisabled <T>(this T control, int?timeout = null, int?sleepInterval = null) where T : IComponentDisabled, IComponent <AndroidElement> { ValidateControlWaitService.WaitUntil <AndroidDriver <AndroidElement>, AndroidElement>(() => !control.IsDisabled.Equals(true), "The control should NOT be disabled but it was.", timeout, sleepInterval); ValidatedIsNotDisabledEvent?.Invoke(control, new ComponentActionEventArgs <AndroidElement>(control)); }
public static void ValidateIsNotSelected <T>(this T control, int?timeout = null, int?sleepInterval = null) where T : IElementSelected, IElement <AndroidElement> { ValidateControlWaitService.WaitUntil <AndroidDriver <AndroidElement>, AndroidElement>(() => control.IsSelected.Equals(false), "The control should be not selected but it WAS.", timeout, sleepInterval); ValidatedIsNotSelectedEvent?.Invoke(control, new ElementActionEventArgs <AndroidElement>(control)); }
public static void ValidateIsSelected <T>(this T control, int?timeout = null, int?sleepInterval = null) where T : IComponentSelected, IComponent <IOSElement> { ValidateControlWaitService.WaitUntil <IOSDriver <IOSElement>, IOSElement>(() => control.IsSelected.Equals(true), "The control should be selected but was NOT.", timeout, sleepInterval); ValidatedIsSelectedEvent?.Invoke(control, new ComponentActionEventArgs <IOSElement>(control)); }
public static void ValidateIsNotVisible <T>(this T control, int?timeout = null, int?sleepInterval = null) where T : IElementVisible, IElement <IOSElement> { ValidateControlWaitService.WaitUntil <IOSDriver <IOSElement>, IOSElement>(() => !control.IsVisible.Equals(true), "The control should be NOT visible but was NOT.", timeout, sleepInterval); ValidatedIsNotVisibleEvent?.Invoke(control, new ElementActionEventArgs <IOSElement>(control)); }
public static void ValidateIsOff <T>(this T control, int?timeout = null, int?sleepInterval = null) where T : IComponentOn, IComponent <IOSElement> { ValidateControlWaitService.WaitUntil <IOSDriver <IOSElement>, IOSElement>(() => control.IsOn.Equals(false), "The control should be OFF but it was ON.", timeout, sleepInterval); ValidatedIsOffEvent?.Invoke(control, new ComponentActionEventArgs <IOSElement>(control)); }
public static void ValidateIsVisible <T>(this T control, int?timeout = null, int?sleepInterval = null) where T : IComponentVisible, IComponent <AndroidElement> { ValidateControlWaitService.WaitUntil <AndroidDriver <AndroidElement>, AndroidElement>(() => control.IsVisible.Equals(true), "The control should be visible but was NOT.", timeout, sleepInterval); ValidatedIsVisibleEvent?.Invoke(control, new ComponentActionEventArgs <AndroidElement>(control)); }
public static void ValidateIsOn <T>(this T control, int?timeout = null, int?sleepInterval = null) where T : IElementOn, IElement <AndroidElement> { ValidateControlWaitService.WaitUntil <AndroidDriver <AndroidElement>, AndroidElement>(() => control.IsOn.Equals(true), "The control should be ON but was OFF.", timeout, sleepInterval); ValidatedIsOnEvent?.Invoke(control, new ElementActionEventArgs <AndroidElement>(control)); }