public void AddProductById(int productId) { var product = ComponentCreateService.CreateByAttributesContaining <Anchor>("data-product_id", productId.ToString()).ToBeClickable(); product.Click(); ViewCartButton.ValidateIsVisible(); }
// 1. One way to extend the BELLATRIX common services is to create an extension method for the additional action. // 1.1. Place it in a static class like this one. // 1.2. Create a static method for the action. // 1.3. Pass the common service as a parameter with the keyword 'this'. // 1.4. Access the native driver via WrappedDriver. // // Later to use the method in your tests, add a using statement containing this class's namespace. public static void LoginToApp(this AndroidAppService appService, string userName, string password) { var elementCreateService = new ComponentCreateService(); var userNameField = elementCreateService.CreateByIdContaining <TextField>("textBox"); var passwordField = elementCreateService.CreateByIdContaining <Password>("passwordBox"); var loginButton = elementCreateService.CreateByIdContaining <Button>("loginButton"); userNameField.SetText(userName); passwordField.SetPassword(password); loginButton.Click(); }
// 1. One way to extend the BELLATRIX common services is to create an extension method for the additional action. // 1.1. Place it in a static class like this one. // 1.2. Create a static method for the action. // 1.3. Pass the common service as a parameter with the keyword 'this'. // 1.4. Access the native driver via WrappedDriver. // // Later to use the method in your tests, add a using statement containing this class's namespace. public static void LoginToApp(this IOSAppService appService, string userName, string password) { var elementCreateService = new ComponentCreateService(); var userNameField = elementCreateService.CreateById <TextField>("IntegerA"); var passwordField = elementCreateService.CreateById <Password>("IntegerB"); var loginButton = elementCreateService.CreateById <Button>("ComputeSumButton"); userNameField.SetText(userName); passwordField.SetPassword(password); loginButton.Click(); }
// 1. One way to extend the BELLATRIX common services is to create an extension method for the additional action. // 1.1. Place it in a static class like this one. // 1.2. Create a static method for the action. // 1.3. Pass the common service as a parameter with the keyword 'this'. // 1.4. Access the native driver via WrappedDriver. // // Later to use the method in your tests, add a using statement containing this class's namespace. public static void LoginToApp(this Services.AppService appService, string userName, string password) { var elementCreateService = new ComponentCreateService(); var userNameField = elementCreateService.CreateByAutomationId <TextField>("textBox"); var passwordField = elementCreateService.CreateByAutomationId <Password>("passwordBox"); var loginButton = elementCreateService.CreateByName <Button>("E Button"); // Navigate to login screen. userNameField.SetText(userName); passwordField.SetPassword(password); loginButton.Click(); }
public static ComponentsList <TComponent, FindStrategyId, IOSDriver <IOSElement>, IOSElement> CreateAllById <TComponent>(this ComponentCreateService repo, string id) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindStrategyId, IOSDriver <IOSElement>, IOSElement>(new FindStrategyId(id), null);
public static ComponentsList <TComponent> CreateAllByNgModel <TComponent>(this ComponentCreateService repository, string model, bool shouldCacheElement = false) where TComponent : Component => new ComponentsList <TComponent>(new ByNgModel(model), null, shouldCacheElement);
public static TComponent CreateByNameStartingWith <TComponent>(this ComponentCreateService repo, string tag) where TComponent : Component => repo.Create <TComponent, FindNameStartingWithStrategy>(new FindNameStartingWithStrategy(tag));
public static ComponentsList <TComponent> CreateAllByIdStartingWith <TComponent>(this ComponentCreateService repository, string idPrefix) where TComponent : Component => new ComponentsList <TComponent>(new FindIdStartingWithStrategy(idPrefix), null);
public static ComponentsList <TComponent, FindValueContainingStrategy, IOSDriver <IOSElement>, IOSElement> CreateAllByValueContaining <TComponent>(this ComponentCreateService repo, string text) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindValueContainingStrategy, IOSDriver <IOSElement>, IOSElement>(new FindValueContainingStrategy(text), null);
public static ComponentsList <TComponent, FindIOSNsPredicateStrategy, IOSDriver <IOSElement>, IOSElement> CreateAllByIOSNsPredicate <TComponent>(this ComponentCreateService repo, string predicate) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindIOSNsPredicateStrategy, IOSDriver <IOSElement>, IOSElement>(new FindIOSNsPredicateStrategy(predicate), null);
public static ComponentsList <TComponent, FindClassNameStrategy, IOSDriver <IOSElement>, IOSElement> CreateAllByClass <TComponent>(this ComponentCreateService repo, string elementClass) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindClassNameStrategy, IOSDriver <IOSElement>, IOSElement>(new FindClassNameStrategy(elementClass), null);
public static TComponent CreateById <TComponent>(this ComponentCreateService repo, string id) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => repo.Create <TComponent, FindStrategyId, IOSDriver <IOSElement>, IOSElement>(new FindStrategyId(id));
public static ComponentsList <TComponent, FindIdStartingWithStrategy, AndroidDriver <AndroidElement>, AndroidElement> CreateAllByIdStartingWith <TComponent>(this ComponentCreateService repo, string id) where TComponent : Component <AndroidDriver <AndroidElement>, AndroidElement> => new ComponentsList <TComponent, FindIdStartingWithStrategy, AndroidDriver <AndroidElement>, AndroidElement>(new FindIdStartingWithStrategy(id), null);
public static TComponent CreateByIdStartingWith <TComponent>(this ComponentCreateService repo, string id) where TComponent : Component <AndroidDriver <AndroidElement>, AndroidElement> => repo.Create <TComponent, FindIdStartingWithStrategy, AndroidDriver <AndroidElement>, AndroidElement>(new FindIdStartingWithStrategy(id));
public static ComponentsList <TComponent> CreateAllByNgSelectedOption <TComponent>(this ComponentCreateService repository, string selectedOption, bool shouldCacheElement = false) where TComponent : Component => new ComponentsList <TComponent>(new ByNgSelectedOption(selectedOption), null, shouldCacheElement);
public static ComponentsList <TComponent> CreateAllByNgRepeater <TComponent>(this ComponentCreateService repository, string repeater, bool shouldCacheElement = false) where TComponent : Component => new ComponentsList <TComponent>(new ByNgRepeater(repeater), null, shouldCacheElement);
public static ComponentsList <TComponent, FindAccessibilityIdStrategy, IOSDriver <IOSElement>, IOSElement> CreateAllByAccessibilityId <TComponent>(this ComponentCreateService repo, string accessibilityId) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindAccessibilityIdStrategy, IOSDriver <IOSElement>, IOSElement>(new FindAccessibilityIdStrategy(accessibilityId), null);
public static TComponent CreateByName <TComponent>(this ComponentCreateService repo, string name) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => repo.Create <TComponent, FindNameStrategy, IOSDriver <IOSElement>, IOSElement>(new FindNameStrategy(name));
public static ComponentsList <TComponent, FindNameStrategy, IOSDriver <IOSElement>, IOSElement> CreateAllByName <TComponent>(this ComponentCreateService repo, string name) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindNameStrategy, IOSDriver <IOSElement>, IOSElement>(new FindNameStrategy(name), null);
public static TComponent CreateByClass <TComponent>(this ComponentCreateService repo, string elementClass) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => repo.Create <TComponent, FindClassNameStrategy, IOSDriver <IOSElement>, IOSElement>(new FindClassNameStrategy(elementClass));
public static ComponentsList <TComponent, FindIOSUIAutomationStrategy, IOSDriver <IOSElement>, IOSElement> CreateAllByIOSUIAutomation <TComponent>(this ComponentCreateService repo, string automationId) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindIOSUIAutomationStrategy, IOSDriver <IOSElement>, IOSElement>(new FindIOSUIAutomationStrategy(automationId), null);
public static TComponent CreateByIOSUIAutomation <TComponent>(this ComponentCreateService repo, string automationId) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => repo.Create <TComponent, FindIOSUIAutomationStrategy, IOSDriver <IOSElement>, IOSElement>(new FindIOSUIAutomationStrategy(automationId));
public static ComponentsList <TComponent, FindXPathStrategy, IOSDriver <IOSElement>, IOSElement> CreateAllByXPath <TComponent>(this ComponentCreateService repo, string xpath) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => new ComponentsList <TComponent, FindXPathStrategy, IOSDriver <IOSElement>, IOSElement>(new FindXPathStrategy(xpath), null);
public static TComponent CreateByIOSNsPredicate <TComponent>(this ComponentCreateService repo, string predicate) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => repo.Create <TComponent, FindIOSNsPredicateStrategy, IOSDriver <IOSElement>, IOSElement>(new FindIOSNsPredicateStrategy(predicate));
public static TComponent CreateByIdStartingWith <TComponent>(this ComponentCreateService repository, string idPrefix, bool shouldCache = false) where TComponent : Component => repository.Create <TComponent, FindIdStartingWithStrategy>(new FindIdStartingWithStrategy(idPrefix), shouldCache);
public static TComponent CreateByNgSelectedOption <TComponent>(this ComponentCreateService repository, string selectedOption, bool shouldCacheElement = false) where TComponent : Component => repository.Create <TComponent, ByNgSelectedOption>(new ByNgSelectedOption(selectedOption), shouldCacheElement);
public static ComponentsList <TComponent> CreateAllByNameStartingWith <TComponent>(this ComponentCreateService repo, string tag) where TComponent : Component => new ComponentsList <TComponent>(new FindNameStartingWithStrategy(tag), null);
public static TComponent CreateByValueContaining <TComponent>(this ComponentCreateService repo, string text) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => repo.Create <TComponent, FindValueContainingStrategy, IOSDriver <IOSElement>, IOSElement>(new FindValueContainingStrategy(text));
public static TComponent CreateByXPath <TComponent>(this ComponentCreateService repo, string xpath) where TComponent : Component <IOSDriver <IOSElement>, IOSElement> => repo.Create <TComponent, FindXPathStrategy, IOSDriver <IOSElement>, IOSElement>(new FindXPathStrategy(xpath));
public static ComponentsList <TComponent> CreateAllByNgBinding <TComponent>(this ComponentCreateService repository, string binding, bool shouldCacheElement = false) where TComponent : Component => new ComponentsList <TComponent>(new ByNgBinding(binding), null, shouldCacheElement);