Produced by Araxis Merge on 12/8/2017 1:33:41 PM Central Standard Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.
| # | Location | File | Last Modified |
|---|---|---|---|
| 1 | PC_CP4_CiF.zip\FPPS_Frontend\fpps-app\Testing\src\testing | StationMaintenanceAddZipCodeTest.java | Fri Dec 8 17:53:04 2017 UTC |
| 2 | PC_CP4_CiF.zip\FPPS_Frontend\fpps-app\Testing\src\testing | StationMaintenanceAddZipCodeTest.java | Fri Dec 8 19:18:30 2017 UTC |
| Description | Between Files 1 and 2 |
|
|---|---|---|
| Text Blocks | Lines | |
| Unchanged | 3 | 590 |
| Changed | 2 | 6 |
| Inserted | 0 | 0 |
| Removed | 0 | 0 |
| Whitespace | |
|---|---|
| Character case | Differences in character case are significant |
| Line endings | Differences in line endings (CR and LF characters) are ignored |
| CR/LF characters | Not shown in the comparison detail |
No regular expressions were active.
| 1 | package te sting; | |
| 2 | ||
| 3 | import sta tic org.ju nit.Assert .*; | |
| 4 | ||
| 5 | import jav a.io.File; | |
| 6 | import jav a.util.Lis t; | |
| 7 | import jav a.util.con current.Ti meUnit; | |
| 8 | ||
| 9 | import org .junit.Aft er; | |
| 10 | import org .junit.Aft erClass; | |
| 11 | import org .junit.Bef ore; | |
| 12 | import org .junit.Bef oreClass; | |
| 13 | import org .junit.Fix MethodOrde r; | |
| 14 | import org .junit.run ners.Metho dSorters; | |
| 15 | import org .junit.Tes t; | |
| 16 | import org .junit.int ernal.Text Listener; | |
| 17 | import org .junit.run ner.JUnitC ore; | |
| 18 | import org .junit.run ner.Result ; | |
| 19 | import org .openqa.se lenium.By; | |
| 20 | import org .openqa.se lenium.Key s; | |
| 21 | import org .openqa.se lenium.NoS uchElement Exception; | |
| 22 | import org .openqa.se lenium.Web Driver; | |
| 23 | import org .openqa.se lenium.Web Element; | |
| 24 | import org .openqa.se lenium.ie. InternetEx plorerDriv er; | |
| 25 | import org .openqa.se lenium.sup port.ui.Se lect; | |
| 26 | ||
| 27 | /** | |
| 28 | * @author DN S PEREZF | |
| 29 | * | |
| 30 | */ | |
| 31 | @FixMethod Order(Meth odSorters. NAME_ASCEN DING) | |
| 32 | public cla ss Station Maintenanc eAddZipCod eTest { | |
| 33 | ||
| 34 | pr ivate WebD river driv er; | |
| 35 | pr ivate Stri ng baseUrl ; | |
| 36 | pr ivate Stri ng station Maintenanc eAddZipCod ePageUrl; | |
| 37 | ||
| 38 | pu blic stati c void mai n(String a rgs[]) { | |
| 39 | JUni tCore juni t = new JU nitCore(); | |
| 40 | juni t.addListe ner(new Te xtListener (System.ou t)); | |
| 41 | Resu lt result = junit.ru n(StationM aintenance AddZipCode Test.class ); // Repl ace "Sampl eTest" wit h the name of your c lass | |
| 42 | if ( result.get FailureCou nt() > 0) { | |
| 43 | System.out .println(" Test faile d.\n" + re sult); | |
| 44 | System.exi t(1); | |
| 45 | } el se { | |
| 46 | System.out .println(" Test finis hed succes sfully."); | |
| 47 | System.exi t(0); | |
| 48 | } | |
| 49 | } | |
| 50 | ||
| 51 | /* * | |
| 52 | * @throws j ava.lang.E xception | |
| 53 | * / | |
| 54 | @B eforeClass | |
| 55 | pu blic stati c void set UpBeforeCl ass() thro ws Excepti on { | |
| 56 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin setU pBeforeCla ss()"); | |
| 57 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End setUpB eforeClass ()"); | |
| 58 | } | |
| 59 | ||
| 60 | /* * | |
| 61 | * @throws j ava.lang.E xception | |
| 62 | * / | |
| 63 | @A fterClass | |
| 64 | pu blic stati c void tea rDownAfter Class() th rows Excep tion { | |
| 65 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin tear DownAfterC lass()"); | |
| 66 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End tearDo wnAfterCla ss()"); | |
| 67 | } | |
| 68 | ||
| 69 | /* * | |
| 70 | * @throws j ava.lang.E xception | |
| 71 | * / | |
| 72 | @B efore | |
| 73 | pu blic void setUp() th rows Excep tion { | |
| 74 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin setU p()"); | |
| 75 | ||
| 76 | File file = ne w File("dr ivers/IEDr iverServer .exe"); | |
| 77 | Syst em.setProp erty("webd river.ie.d river", fi le.getAbso lutePath() ); | |
| 78 | driv er = new I nternetExp lorerDrive r(); | |
| 79 | ||
| 80 | // baseUrl = "http:/ / SERVER : PORT /"; | |
| 81 | baseUrl = "http://lo calhost: PORT /"; | |
| 82 | driv er.manage( ).timeouts ().implici tlyWait(30 , TimeUnit .SECONDS); | |
| 83 | ||
| 84 | goTo LoginPageA ndClickLog inButton() ; | |
| 85 | Thre ad.sleep(5 000); | |
| 86 | clic kSetActive Button(); | |
| 87 | ||
| 88 | stat ionMainten anceAddZip CodePageUr l = baseUr l + "addZi pCode"; | |
| 89 | driv er.get(sta tionMainte nanceAddZi pCodePageU rl); | |
| 90 | Thre ad.sleep(3 000); | |
| 91 | ||
| 92 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End setUp( )"); | |
| 93 | } | |
| 94 | ||
| 95 | pr ivate void clickSetA ctiveButto n() throws Exception { | |
| 96 | WebE lement set ActiveButt on = drive r.findElem ent(By.id( "setActive ")); | |
| 97 | asse rtNotNull( setActiveB utton); | |
| 98 | setA ctiveButto n.click(); | |
| 99 | // s etActiveBu tton.submi t(); // No t inside o f a "form" element. | |
| 100 | setA ctiveButto n.sendKeys (Keys.ENTE R); | |
| 101 | Thre ad.sleep(3 000); | |
| 102 | } | |
| 103 | ||
| 104 | pr ivate void goToLogin PageAndCli ckLoginBut ton() thro ws Excepti on { | |
| 105 | driv er.get(bas eUrl); | |
| 106 | WebE lement log inButton = driver.fi ndElement( By.id("log inAdminBtn ")); | |
| 107 | asse rtNotNull( loginButto n); | |
| 108 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Login Butt on exists! "); | |
| 109 | ||
| 110 | // S elect the ADMIN Role . | |
| 111 | Sele ct roleSel ectBox = n ew Select( driver.fin dElement(B y.id("sele ctRole2")) ); | |
| 112 | asse rtNotNull( roleSelect Box); | |
| 113 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Role Selec t Box exis ts!"); | |
| 114 | role SelectBox. selectByVi sibleText( "ADMIN"); | |
| 115 | Thre ad.sleep(2 000); | |
| 116 | ||
| 117 | // C lick the L ogin Butto n. Had to do this as advised b y Joshua L one | |
| 118 | // t o get this to work t o forward to next pa ge. | |
| 119 | logi nButton.cl ick(); | |
| 120 | logi nButton.su bmit(); | |
| 121 | logi nButton.se ndKeys(Key s.ENTER); | |
| 122 | } | |
| 123 | ||
| 124 | /* * | |
| 125 | * @throws j ava.lang.E xception | |
| 126 | * / | |
| 127 | @A fter | |
| 128 | pu blic void tearDown() throws Ex ception { | |
| 129 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin tear Down()"); | |
| 130 | ||
| 131 | Thre ad.sleep(5 000); | |
| 132 | driv er.close() ; | |
| 133 | driv er.quit(); | |
| 134 | Thre ad.sleep(5 000); | |
| 135 | Syst em.out.pri ntln("End Executing 'tearDown' method"); | |
| 136 | ||
| 137 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End tearDo wn()"); | |
| 138 | } | |
| 139 | ||
| 140 | @T est | |
| 141 | pu blic void test_1_Ver ify_Statio nMaintenan ceAddZipCo dePage_App ears() thr ows Except ion { | |
| 142 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin test _1_Verify_ StationMai ntenanceAd dZipCodePa ge_Appears ()"); | |
| 143 | ||
| 144 | WebE lement pag eTitleElem ent = driv er.findEle ment(By.id ("pageTitl e")); | |
| 145 | asse rtNotNull( pageTitleE lement); | |
| 146 | ||
| 147 | asse rtEquals(" Incorrect Page Title for Stati on Mainten ance Add Z IP Code Pa ge!", | |
| 148 | "Station Maintenan ce | Add ZIP Code" , pageTitl eElement.g etText()); | |
| 149 | ||
| 150 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End test_1 _Verify_St ationMaint enanceAddZ ipCodePage _Appears() "); | |
| 151 | } | |
| 152 | ||
| 153 | @T est | |
| 154 | pu blic void test_2_Ver ify_Statio nMaintenan ceAddZipCo deTestFiel dExistsAnd IsMandator y() throws Exception { | |
| 155 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin test _2_Verify_ StationMai ntenanceAd dZipCodeTe stFieldExi stsAndIsMa ndatory()" ); | |
| 156 | ||
| 157 | WebE lement zip CodeTextEl ement = dr iver.findE lement(By. id("zipCod e")); | |
| 158 | asse rtNotNull( zipCodeTex tElement); | |
| 159 | ||
| 160 | Stri ng require dAttribute Str = zipC odeTextEle ment.getAt tribute("r equired"); | |
| 161 | asse rtNotNull( requiredAt tributeStr ); | |
| 162 | ||
| 163 | Stri ng zipCode TextElemen tTagName = zipCodeTe xtElement. getTagName (); | |
| 164 | asse rtNotNull( zipCodeTex tElementTa gName); | |
| 165 | asse rtEquals(" Incorrect Tag Name f or the Zip Code Text Element!" , | |
| 166 | "input", zipCodeTe xtElementT agName); | |
| 167 | ||
| 168 | Stri ng zipCode TextElemen tTypeAttri buteStr = zipCodeTex tElement.g etAttribut e("type"); | |
| 169 | asse rtNotNull( zipCodeTex tElementTy peAttribut eStr); | |
| 170 | asse rtEquals(" Incorrect Type for t he Zip Cod e Text Ele ment!", | |
| 171 | "text", zipCodeTex tElementTy peAttribut eStr); | |
| 172 | ||
| 173 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End test_2 _Verify_St ationMaint enanceAddZ ipCodeTest FieldExist sAndIsMand atory()"); | |
| 174 | } | |
| 175 | ||
| 176 | @T est | |
| 177 | pu blic void test_3_Ver ify_Active IndicatorE xistsAndIs MandatoryW ithInitial YesValue() throws Ex ception { | |
| 178 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin test _3_Verify_ ActiveIndi catorExist sAndIsMand atoryWithI nitialYesV alue()"); | |
| 179 | ||
| 180 | WebE lement act iveOptions YesRadioBu ttonElemen t = driver .findEleme nt(By.id(" activeOpti onsYes")); | |
| 181 | asse rtNotNull( activeOpti onsYesRadi oButtonEle ment); | |
| 182 | ||
| 183 | Stri ng activeO ptionsYesB uttonEleme ntType = a ctiveOptio nsYesRadio ButtonElem ent.getAtt ribute("ty pe"); | |
| 184 | asse rtNotNull( activeOpti onsYesButt onElementT ype); | |
| 185 | asse rtEquals(" Incorrect Type for A ctive Opti ons Yes Ra dio Button !", "radio ", activeO ptionsYesB uttonEleme ntType); | |
| 186 | ||
| 187 | Stri ng activeO ptionsYesR adioButton ElementVal ue = activ eOptionsYe sRadioButt onElement. getAttribu te("value" ); | |
| 188 | asse rtNotNull( activeOpti onsYesRadi oButtonEle mentValue) ; | |
| 189 | asse rtEquals(" Incorrect Value for Active Opt ions Yes R adio Butto n!", "Yes" , activeOp tionsYesRa dioButtonE lementValu e); | |
| 190 | ||
| 191 | WebE lement act iveOptions NoRadioBut tonElement = driver. findElemen t(By.id("a ctiveOptio nsNo")); | |
| 192 | asse rtNotNull( activeOpti onsNoRadio ButtonElem ent); | |
| 193 | ||
| 194 | Stri ng activeO ptionsNoBu ttonElemen tType = ac tiveOption sNoRadioBu ttonElemen t.getAttri bute("type "); | |
| 195 | asse rtNotNull( activeOpti onsNoButto nElementTy pe); | |
| 196 | asse rtEquals(" Incorrect Type for A ctive Opti ons No Rad io Button! ", "radio" , activeOp tionsNoBut tonElement Type); | |
| 197 | ||
| 198 | Stri ng activeO ptionsNoRa dioButtonE lementValu e = active OptionsNoR adioButton Element.ge tAttribute ("value"); | |
| 199 | asse rtNotNull( activeOpti onsNoRadio ButtonElem entValue); | |
| 200 | asse rtEquals(" Incorrect Value for Active Opt ions No Ra dio Button !", "No", activeOpti onsNoRadio ButtonElem entValue); | |
| 201 | ||
| 202 | // V erify init ial value of Active Indicator is Yes | |
| 203 | Stri ng activeO ptionsYesB uttonEleme ntNgReflec tModelValu e = activ eOptionsYe sRadioButt onElement. getAttribu te("ng-ref lect-model "); | |
| 204 | asse rtNotNull( activeOpti onsYesButt onElementN gReflectMo delValue); | |
| 205 | asse rtEquals(" Incorrect ng-reflect -model Val ue for Act ive Option s Yes Radi o Button!" , "Yes", a ctiveOptio nsYesButto nElementNg ReflectMod elValue); | |
| 206 | Stri ng activeO ptionsNoBu ttonElemen tNgReflect ModelValue = active OptionsNoR adioButton Element.ge tAttribute ("ng-refle ct-model") ; | |
| 207 | asse rtNotNull( activeOpti onsNoButto nElementNg ReflectMod elValue); | |
| 208 | asse rtEquals(" Incorrect ng-reflect -model Val ue for Act ive Option s No Radio Button!", "Yes", ac tiveOption sNoButtonE lementNgRe flectModel Value); | |
| 209 | ||
| 210 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End test_3 _Verify_Ac tiveIndica torExistsA ndIsMandat oryWithIni tialYesVal ue()"); | |
| 211 | } | |
| 212 | ||
| 213 | @T est | |
| 214 | pu blic void test_4_Ver ifyActiveI ndicatorVa lueChanges ToNoWhenNo RadioButto nPressed() throws Ex ception { | |
| 215 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin test _4_VerifyA ctiveIndic atorValueC hangesToNo WhenNoRadi oButtonPre ssed()"); | |
| 216 | ||
| 217 | WebE lement act iveOptions YesRadioBu ttonElemen t = driver .findEleme nt(By.id(" activeOpti onsYes")); | |
| 218 | asse rtNotNull( activeOpti onsYesRadi oButtonEle ment); | |
| 219 | ||
| 220 | WebE lement act iveOptions NoRadioBut tonElement = driver. findElemen t(By.id("a ctiveOptio nsNo")); | |
| 221 | asse rtNotNull( activeOpti onsNoRadio ButtonElem ent); | |
| 222 | ||
| 223 | // C lick the A ctive Indi cators No Button | |
| 224 | acti veOptionsN oRadioButt onElement. click(); | |
| 225 | acti veOptionsN oRadioButt onElement. sendKeys(K eys.ENTER) ; | |
| 226 | Thre ad.sleep(2 000); | |
| 227 | ||
| 228 | // V erify init ial value of Active Indicator is No | |
| 229 | Stri ng activeO ptionsYesB uttonEleme ntNgReflec tModelValu e = activ eOptionsYe sRadioButt onElement. getAttribu te("ng-ref lect-model "); | |
| 230 | asse rtNotNull( activeOpti onsYesButt onElementN gReflectMo delValue); | |
| 231 | asse rtEquals(" Incorrect ng-reflect -model Val ue for Act ive Option s Yes Radi o Button!" , "No", ac tiveOption sYesButton ElementNgR eflectMode lValue); | |
| 232 | Stri ng activeO ptionsNoBu ttonElemen tNgReflect ModelValue = active OptionsNoR adioButton Element.ge tAttribute ("ng-refle ct-model") ; | |
| 233 | asse rtNotNull( activeOpti onsNoButto nElementNg ReflectMod elValue); | |
| 234 | asse rtEquals(" Incorrect ng-reflect -model Val ue for Act ive Option s No Radio Button!", "No", act iveOptions NoButtonEl ementNgRef lectModelV alue); | |
| 235 | ||
| 236 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End test_4 _VerifyAct iveIndicat orValueCha ngesToNoWh enNoRadioB uttonPress ed()"); | |
| 237 | } | |
| 238 | ||
| 239 | @T est | |
| 240 | pu blic void test_5_Ver ifyFipsCou ntyCodeTex tFieldExis ts() { | |
| 241 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin test _5_VerifyF ipsCountyC odeTextFie ldExists() "); | |
| 242 | ||
| 243 | WebE lement fip sCountyCod eTextEleme nt = drive r.findElem ent(By.id( "fipsCount yCode")); | |
| 244 | asse rtNotNull( fipsCounty CodeTextEl ement); | |
| 245 | ||
| 246 | Stri ng fipsCou ntyCodeTex tElementTa gName = fi psCountyCo deTextElem ent.getTag Name(); | |
| 247 | asse rtNotNull( fipsCounty CodeTextEl ementTagNa me); | |
| 248 | asse rtEquals(" Incorrect Tag Name f or the FIP S County C ode Text E lement!", | |
| 249 | "input", fipsCount yCodeTextE lementTagN ame); | |
| 250 | ||
| 251 | Stri ng fipsCou ntyCodeTex tElementTy peAttribut eStr = fip sCountyCod eTextEleme nt.getAttr ibute("typ e"); | |
| 252 | asse rtNotNull( fipsCounty CodeTextEl ementTypeA ttributeSt r); | |
| 253 | asse rtEquals(" Incorrect Type for t he FIPS Co unty Code Text Eleme nt!", | |
| 254 | "text", fipsCounty CodeTextEl ementTypeA ttributeSt r); | |
| 255 | ||
| 256 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End test_5 _VerifyFip sCountyCod eTextField Exists()") ; | |
| 257 | } | |
| 258 | ||
| 259 | @T est | |
| 260 | pu blic void test_6_Ver ifyFipsSta teCodeText FieldExist s() { | |
| 261 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin test _6_VerifyF ipsStateCo deTextFiel dExists()" ); | |
| 262 | ||
| 263 | WebE lement fip sStateCode TextElemen t = driver .findEleme nt(By.id(" fipsStateC ode")); | |
| 264 | asse rtNotNull( fipsStateC odeTextEle ment); | |
| 265 | ||
| 266 | Stri ng fipsSta teCodeText ElementTag Name = fip sStateCode TextElemen t.getTagNa me(); | |
| 267 | asse rtNotNull( fipsStateC odeTextEle mentTagNam e); | |
| 268 | asse rtEquals(" Incorrect Tag Name f or the FIP S State Co de Text El ement!", | |
| 269 | "input", fipsState CodeTextEl ementTagNa me); | |
| 270 | ||
| 271 | Stri ng fipsSta teCodeText ElementTyp eAttribute Str = fips StateCodeT extElement .getAttrib ute("type" ); | |
| 272 | asse rtNotNull( fipsStateC odeTextEle mentTypeAt tributeStr ); | |
| 273 | asse rtEquals(" Incorrect Type for t he FIPS St ate Code T ext Elemen t!", | |
| 274 | "text", fipsStateC odeTextEle mentTypeAt tributeStr ); | |
| 275 | ||
| 276 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End test_6 _VerifyFip sStateCode TextFieldE xists()"); | |
| 277 | } | |
| 278 | ||
| 279 | @T est | |
| 280 | pu blic void test_7_Ver ifyUrbanIn dicatorTex tFieldExis ts() { | |
| 281 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: Begin test _7_VerifyU rbanIndica torTextFie ldExists() "); | |
| 282 | ||
| 283 | WebE lement urb anIndicato rTextEleme nt = drive r.findElem ent(By.id( "urbanIndi cator")); | |
| 284 | asse rtNotNull( urbanIndic atorTextEl ement); | |
| 285 | ||
| 286 | Stri ng urbanIn dicatorTex tElementTa gName = ur banIndicat orTextElem ent.getTag Name(); | |
| 287 | asse rtNotNull( urbanIndic atorTextEl ementTagNa me); | |
| 288 | asse rtEquals(" Incorrect Tag Name f or the Urb an Indicat or Text El ement!", | |
| 289 | "input", urbanIndi catorTextE lementTagN ame); | |
| 290 | ||
| 291 | Stri ng urbanIn dicatorTex tElementTy peAttribut eStr = urb anIndicato rTextEleme nt.getAttr ibute("typ e"); | |
| 292 | asse rtNotNull( urbanIndic atorTextEl ementTypeA ttributeSt r); | |
| 293 | asse rtEquals(" Incorrect Type for t he Urban I ndictor Te xt Element !", | |
| 294 | "text", urbanIndic atorTextEl ementTypeA ttributeSt r); | |
| 295 | ||
| 296 | Syst em.out.pri ntln("Stat ionMainten anceAddZip CodeTest: End test_7 _VerifyUrb anIndicato rTextField Exists()") ; | |
| 297 | } | |
| 298 | } |
Araxis Merge (but not the data content of this report) is Copyright © 1993-2016 Araxis Ltd (www.araxis.com). All rights reserved.