-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnitTest1.cs
More file actions
48 lines (37 loc) · 1.31 KB
/
Copy pathUnitTest1.cs
File metadata and controls
48 lines (37 loc) · 1.31 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
37
38
39
40
41
42
43
44
45
46
47
48
using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
using SeleniumCSharpNetCore.Pages;
using System;
namespace SeleniumCSharpNetCore
{
public class Tests : DriverHelper
{
[SetUp]
public void Setup()
{
Console.WriteLine("Setup");
Driver = new ChromeDriver();
}
[Test]
public void Test1()
{
Driver.Navigate().GoToUrl("http://demowf.aspnetawesome.com/");//http://executeautomation.com
Driver.FindElement(By.Id("ContentPlaceHolder1_Meal")).SendKeys("Tomato");
Driver.FindElement(By.XPath("//input[@name='ctl00$ContentPlaceHolder1$ChildMeal1']/following-sibling::div[text()='Celery']")).Click();
CustomControl.ComboBox("ContentPlaceHolder1_AllMealsCombo","Almond");
Assert.Pass();
}
[Test]
public void LoginTest()
{
Driver.Navigate().GoToUrl("http://eaapp.somee.com//");
HomePage homePage = new HomePage();
LoginPage loginPage = new LoginPage();
homePage.ClickLogin();
loginPage.EnterUserNameAndPassword("admin","password");
loginPage.ClickLogin();
Assert.That(homePage.IsLogOffExist(), Is.True, "Log off button did not displayed");
}
}
}