43 lines
2.3 KiB
C#
43 lines
2.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using IntegrationTests.Properties;
|
|
using NUnit.Framework;
|
|
using OpenQA.Selenium;
|
|
using OpenQA.Selenium.Support.UI;
|
|
|
|
namespace IntegrationTests.Helpers
|
|
{
|
|
public class BLL
|
|
{
|
|
public static void CreateProject(IWebDriver webDriver)
|
|
{
|
|
webDriver.Url = Settings.Default.WebSiteUrl + "Project/Edit";
|
|
webDriver.Navigate();
|
|
Browser.WaitForPageLoad(webDriver, 10);
|
|
|
|
webDriver.FindElement(By.Id("IDDDD")).SendKeys("My First Project");
|
|
webDriver.FindElement(By.Id("Number")).SendKeys("1345");
|
|
if (!Browser.SelectOptionByValue(webDriver, "StatusId", "ead7ac04-de87-4104-a9a7-52b97ab7a4bf"))
|
|
Assert.Fail("Cannot find an option with value 'ead7ac04-de87-4104-a9a7-52b97ab7a4bf' in select#StatusId.");
|
|
if (!Browser.SelectOptionByValue(webDriver, "TypeId", "a437a456-7e95-4429-a904-2becfe92b448"))
|
|
Assert.Fail("Cannot find an option with value 'a437a456-7e95-4429-a904-2becfe92b448' in select#TypeId.");
|
|
if (!Browser.SelectOptionByValue(webDriver, "ClientId", "07211465-ed91-46f3-9029-4807df8b1efe"))
|
|
Assert.Fail("Cannot find an option with value '07211465-ed91-46f3-9029-4807df8b1efe' in select#ClientId.");
|
|
if (!Browser.SelectOptionByValue(webDriver, "CompanyId", "6a7125d9-a742-4831-9cd8-178bf1be1cfa"))
|
|
Assert.Fail("Cannot find an option with value '6a7125d9-a742-4831-9cd8-178bf1be1cfa' in select#CompanyId.");
|
|
webDriver.FindElement(By.Id("input-color")).SendKeys("#bc2525");
|
|
webDriver.FindElement(By.Id("Priority")).SendKeys("15");
|
|
webDriver.FindElement(By.Id("Details")).SendKeys("Here is some details for you");
|
|
var wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(10));
|
|
wait.Until(d => ((IJavaScriptExecutor)d).ExecuteScript("val.slider('value', 75); return true;").Equals(true));
|
|
new WebDriverWait(webDriver, TimeSpan.FromSeconds(10)).Until(driver => true);
|
|
webDriver.FindElement(By.Id("btnsave")).Click();
|
|
wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(10));
|
|
var tr = wait.Until(driver => driver.FindElement(By.CssSelector("#prjcts tbody tr")));
|
|
}
|
|
}
|
|
}
|