-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalTest.cs
More file actions
36 lines (31 loc) · 1.39 KB
/
LocalTest.cs
File metadata and controls
36 lines (31 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Threading;
using System.Collections.ObjectModel;
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Support.UI;
namespace android
{
[TestFixture("local", "galaxy-s7")]
public class LocalTest : BrowserStackNUnitTest
{
public LocalTest(string profile, string device) : base(profile,device){ }
[Test]
public void testLocal()
{
AndroidElement searchElement = (AndroidElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(ExpectedConditions.ElementToBeClickable(By.Id("com.example.android.basicnetworking:id/test_action")));
searchElement.Click();
AndroidElement testElement = (AndroidElement)new WebDriverWait(driver, TimeSpan.FromSeconds(30)).Until(ExpectedConditions.ElementToBeClickable(By.ClassName("android.widget.TextView")));
ReadOnlyCollection<AndroidElement> allTextViewElements = driver.FindElements(By.ClassName("android.widget.TextView"));
Thread.Sleep(5000);
foreach (AndroidElement textElement in allTextViewElements)
{
if (textElement.Text.Contains("The active connection is"))
{
Assert.True(textElement.Text.Contains("The active connection is wifi"),"Incorrect Text");
}
}
}
}
}