Пример #1
0
        public void AndClass()
        {
            // Act
            By configuration = new By().AndClass("SomeClass");

            // Assert
            Assert.AreEqual(1, configuration.Configuration.Count);
        }
Пример #2
0
        public void AndId()
        {
            // Act
            By configuration = new By().AndId("SomeId");

            // Assert
            Assert.AreEqual(1, configuration.Configuration.Count);
        }
Пример #3
0
 /// <summary>
 /// Adds a mechanism to find controls by specified automation id.
 /// </summary>
 /// <param name="automationId">The automation id.</param>
 /// <param name="conditionOperator">
 /// The operator to use to compare the values (either the values are equal or the property
 /// value contains the provided property value).
 /// </param>
 /// <returns>
 /// The mechanisms by how particular instances of <see cref="UITestControl"/> are found in
 /// the UI.
 /// </returns>
 public static By AutomationId(
     string automationId,
     PropertyExpressionOperator conditionOperator = PropertyExpressionOperator.EqualTo)
 {
     var by = new By();
     by.configurators.Add(new AutomationIdConfigurator(automationId, conditionOperator));
     return by;
 }
Пример #4
0
        public void AndValueAttribute()
        {
            // Act
            By configuration = new By().AndValueAttribute("SomeValueAttribute");

            // Assert
            Assert.AreEqual(1, configuration.Configuration.Count);
        }
Пример #5
0
        public void AndSearchProperties()
        {
            // Act
            By configuration = new By().AndSearchProperties("SomeName=SomeValue");

            // Assert
            Assert.AreEqual(1, configuration.Configuration.Count);
        }
Пример #6
0
        public void AndTagName()
        {
            // Act
            By configuration = new By().AndTagName("SomeTagName");

            // Assert
            Assert.AreEqual(1, configuration.Configuration.Count);
        }
Пример #7
0
        public void AndControlName()
        {
            // Act
            By configuration = new By().AndControlName("SomeControlName");

            // Assert
            Assert.AreEqual(1, configuration.Configuration.Count);
            Assert.AreEqual(PropertyExpressionOperator.EqualTo, configuration.Configuration.First().PropertyOperator);
        }
Пример #8
0
        public void AndClassNameContains()
        {
            // Act
            By configuration = new By().AndClassNameContains("SomeClassName");

            // Assert
            Assert.AreEqual(1, configuration.Configuration.Count);
            Assert.AreEqual(PropertyExpressionOperator.Contains, configuration.Configuration.First().PropertyOperator);
        }
Пример #9
0
 // TODO: The factory should be able to create instances with default constructor
 // ReSharper disable once UnusedParameter.Local
 // the constructor requires a parameter in order for it to be dynamically created by CUITe
 public Div2(By searchConfiguration)
     : base(By.Id("div2"))
 {
 }
Пример #10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlOrderedList"/> class.
 /// </summary>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlOrderedList(By searchConfiguration = null)
     : this(new CUITControls.HtmlCustom(), searchConfiguration)
 {
 }
Пример #11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlPassword"/> class.
 /// </summary>
 /// <param name="sourceControl">The source control.</param>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlPassword(CUITControls.HtmlEdit sourceControl, By searchConfiguration = null)
     : base(sourceControl, searchConfiguration)
 {
     AddSearchProperty(CUITControls.HtmlControl.PropertyNames.Type, "PASSWORD");
 }
Пример #12
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlHeading1"/> class.
 /// </summary>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlHeading1(By searchConfiguration = null)
     : this(new CUITControls.HtmlCustom(), searchConfiguration)
 {
 }
Пример #13
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlListItem"/> class.
 /// </summary>
 /// <param name="sourceControl">The source control.</param>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlListItem(CUITControls.HtmlCustom sourceControl, By searchConfiguration = null)
     : base(sourceControl, searchConfiguration)
 {
 }
Пример #14
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlListItem"/> class.
 /// </summary>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlListItem(By searchConfiguration = null)
     : this(new CUITControls.HtmlCustom(), searchConfiguration)
 {
 }
Пример #15
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SilverlightPassword" /> class.
 /// </summary>
 /// <param name="parent">The parent.</param>
 /// <param name="searchConfiguration">The search configuration.</param>
 public SilverlightPassword(UITestControl parent, By searchConfiguration = null)
     : this(new CUITControls.SilverlightEdit(parent), searchConfiguration)
 {
 }
Пример #16
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SilverlightPassword"/> class.
 /// </summary>
 /// <param name="searchConfiguration">The search configuration.</param>
 public SilverlightPassword(By searchConfiguration = null)
     : this(new CUITControls.SilverlightEdit(), searchConfiguration)
 {
 }
Пример #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SilverlightPassword"/> class.
 /// </summary>
 /// <param name="sourceControl">The source control.</param>
 /// <param name="searchConfiguration">The search configuration.</param>
 public SilverlightPassword(CUITControls.SilverlightEdit sourceControl, By searchConfiguration = null)
     : base(sourceControl, searchConfiguration)
 {
 }
Пример #18
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlParagraph"/> class.
 /// </summary>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlParagraph(By searchConfiguration = null)
     : this(new CUITControls.HtmlCustom(), searchConfiguration)
 {
 }
Пример #19
0
 /// <summary>
 /// Adds a mechanism to find controls by specified part of the automation id.
 /// </summary>
 /// <param name="automationIdPart">The part of the automation id.</param>
 /// <returns>
 /// The mechanisms by how particular instances of <see cref="UITestControl"/> are found in
 /// the UI.
 /// </returns>
 public static By AutomationIdContains(string automationIdPart)
 {
     var by = new By();
     by.configurators.Add(new AutomationIdConfigurator(automationIdPart, PropertyExpressionOperator.Contains));
     return by;
 }
Пример #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlHeading1"/> class.
 /// </summary>
 /// <param name="sourceControl">The source control.</param>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlHeading1(CUITControls.HtmlCustom sourceControl, By searchConfiguration = null)
     : base(sourceControl, searchConfiguration)
 {
     AddSearchProperty(CUITControls.HtmlControl.PropertyNames.TagName, TagName);
 }
Пример #21
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HtmlPassword"/> class.
 /// </summary>
 /// <param name="searchConfiguration">The search configuration.</param>
 public HtmlPassword(By searchConfiguration = null)
     : this(new CUITControls.HtmlEdit(), searchConfiguration)
 {
 }