1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.samplu.admin.test;
17
18 import static org.junit.Assert.assertEquals;
19
20 import edu.samplu.common.AdminMenuLegacyITBase;
21 import edu.samplu.common.ITUtil;
22 import edu.samplu.common.WebDriverLegacyITBase;
23
24 import org.junit.Test;
25 import org.openqa.selenium.By;
26
27
28
29
30
31
32 public class AddingNameSpaceLegacyIT extends AdminMenuLegacyITBase {
33
34
35
36
37
38 @Override
39 protected String getLinkLocator() {
40 return "Namespace";
41 }
42 @Test
43 public void testAddingNamespace() throws Exception {
44
45
46
47
48
49
50
51
52
53
54
55
56
57 super.gotoCreateNew();
58 waitForPageToLoad();
59 assertElementPresentByXpath("//*[@name='methodToCall.save' and @alt='save']","save button does not exist on the page");
60
61 waitAndTypeByXpath("//input[@id='document.documentHeader.documentDescription']", "Adding PEANUTS");
62 waitAndTypeByXpath("//*[@id='document.documentHeader.explanation']", "I want to add PEANUTS to test KIM");
63 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.code']", "PEANUTS");
64 waitAndTypeByXpath("//input[@id='document.newMaintainableObject.name']","The Peanuts Gang");
65 checkByXpath("//input[@id='document.newMaintainableObject.active']");
66 waitAndClickByXpath("//*[@name='methodToCall.save' and @alt='save']");
67 waitForPageToLoad();
68 checkForIncidentReport();
69 assertElementPresentByXpath("//div[contains(div,'Document was successfully saved.')]", "Document is not saved successfully");
70
71 assertEquals("SAVED", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[1]/td[2]")).getText());
72 assertEquals("admin", driver.findElement(By.xpath("//table[@class='headerinfo']/tbody/tr[2]/td[1]/a")).getText());
73
74 }
75
76
77 }