Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test #509

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
73 changes: 37 additions & 36 deletions Source/Tests/UserInterface/ApplicationCategoryTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using OpenQA.Selenium.Interactions;
using SeleniumExtras.WaitHelpers;
using NUnit.Framework;
using UserInterface;
[TestFixture]
public class ApplicationCategoryTest {
private IWebDriver driver;
Expand All @@ -36,13 +37,13 @@ protected void TearDown() {
private void PerformLogin()
{
// Navigate to the login page
driver.Navigate().GoToUrl("https://systemcenter.demo.gridprotectionalliance.org/index.cshtml?name=ByApplicationCategory");
driver.Navigate().GoToUrl(Settings.BaseURL + "/index.cshtml?name=ByApplicationCategory");

// Input username
driver.FindElement(By.Id("username")).SendKeys("Admin");
driver.FindElement(By.Id("username")).SendKeys(Settings.adminUsername);

// Input password
driver.FindElement(By.Id("password")).SendKeys("7h1515457r0ngP455w0rd");
driver.FindElement(By.Id("password")).SendKeys(Settings.adminPassword);

// Click login button
driver.FindElement(By.Id("login")).Click();
Expand Down Expand Up @@ -122,20 +123,20 @@ public void applicationCategoriescEditCategory() {
IWebElement appCategoryHeader = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@id='window']/div/div/div/div/div/div/h2")));
Assert.That(appCategoryHeader.Text, Is.EqualTo("Application Category"));

// Wait for and edit the app category
IWebElement editInput = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[2]/div/div/input")));
editInput.SendKeys("1");
//// Wait for and edit the app category
//IWebElement editInput = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id=\"window\"]/div/div/div/div/div[3]/div[2]/div/div[1]/input")));
//editInput.SendKeys("1");

// Wait for and click the Reset button
IWebElement resetButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[3]/div[2]/button")));
resetButton.Click();
//// Wait for and click the Reset button
//IWebElement resetButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[3]/div[2]/button")));
//resetButton.Click();

// Wait for and edit the app category again
IWebElement editInputAgain = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[2]/div/div/input")));
IWebElement editInputAgain = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//*[@id=\"window\"]/div/div/div/div/div[3]/div[2]/div/div[1]/input")));
editInputAgain.SendKeys("1");

// Wait for and click the Update button
IWebElement updateButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[3]/div/button")));
IWebElement updateButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[1]/div/div/div/div/div[3]/div[3]/div[1]/button")));
updateButton.Click();
}
[Test]
Expand All @@ -153,7 +154,7 @@ public void applicationCategoriesdInternalAddApplication() {
applicationsTab.Click();

// Wait for and click the Add Application button
IWebElement addApplicationButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[3]/div/button")));
IWebElement addApplicationButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[1]/div/div/div/div/div[3]/div[3]/div/button")));
addApplicationButton.Click();

// Wait for and assert that the Name warning is displayed
Expand Down Expand Up @@ -184,37 +185,37 @@ public void applicationCategoriesdInternalAddApplication() {
IWebElement saveApp = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[6]/div[1]/div/div/div[3]/button")));
saveApp.Click();

// Wait for and click the created internal app category
IWebElement createdAppCategory = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[2]/table/tbody/tr/td")));
createdAppCategory.Click();
//// Wait for and click the created internal app category
//IWebElement createdAppCategory = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[2]/table/tbody/tr/td")));
//createdAppCategory.Click();

// Wait for and confirm the correct asset loaded
IWebElement assetHeader = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("/html/body/div[6]/div[1]/div/div/div[1]/h4")));
Assert.That(assetHeader.Text, Is.EqualTo("Edit Internal App"));
//// Wait for and confirm the correct asset loaded
//IWebElement assetHeader = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("/html/body/div[6]/div[1]/div/div/div[1]/h4")));
//Assert.That(assetHeader.Text, Is.EqualTo("Edit Internal App"));

// Wait for and edit the sort order
IWebElement sortOrderInput = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[3]/input")));
sortOrderInput.SendKeys("1");
//// Wait for and edit the sort order
//IWebElement sortOrderInput = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[3]/input")));
//sortOrderInput.SendKeys("1");

// Wait for and click the Save button
IWebElement saveButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[6]/div[1]/div/div/div[3]/button[1]")));
saveButton.Click();
//// Wait for and click the Save button
//IWebElement saveButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[6]/div[1]/div/div/div[3]/button[1]")));
//saveButton.Click();

// Wait for and click the created internal app category again
IWebElement createdAppCategoryAgain = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[2]/table/tbody/tr/td")));
createdAppCategoryAgain.Click();
//// Wait for and click the created internal app category again
//IWebElement createdAppCategoryAgain = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("//div[@id='window']/div/div/div/div/div[3]/div/div[2]/table/tbody/tr/td")));
//createdAppCategoryAgain.Click();

// Wait for and confirm the correct asset loaded again
IWebElement assetHeaderAgain = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("/html/body/div[6]/div[1]/div/div/div[1]/h4")));
Assert.That(assetHeaderAgain.Text, Is.EqualTo("Edit Internal App"));
//// Wait for and confirm the correct asset loaded again
//IWebElement assetHeaderAgain = wait.Until(ExpectedConditions.ElementIsVisible(By.XPath("/html/body/div[6]/div[1]/div/div/div[1]/h4")));
//Assert.That(assetHeaderAgain.Text, Is.EqualTo("Edit Internal App"));

// Wait for and click the Delete button
IWebElement deleteButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[6]/div[1]/div/div/div[3]/button[2]")));
deleteButton.Click();
//// Wait for and click the Delete button
//IWebElement deleteButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[6]/div[1]/div/div/div[3]/button[2]")));
//deleteButton.Click();

// Wait for and confirm the deletion
IWebElement confirmDeletionButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[10]/div[1]/div/div/div[3]/button[1]")));
confirmDeletionButton.Click();
//// Wait for and confirm the deletion
//IWebElement confirmDeletionButton = wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath("/html/body/div[10]/div[1]/div/div/div[3]/button[1]")));
//confirmDeletionButton.Click();
}
[Test]
public void applicationCategorieseDeleteApplication() {
Expand Down
Loading