Upgrade sonar plugin
[vid.git] / vid-app-common / src / test / java / org / openecomp / ecomp / vid / selenium / FirstClass.java
1 /*-\r
2  * ============LICENSE_START=======================================================\r
3  * VID\r
4  * ================================================================================\r
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.\r
6  * ================================================================================\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  * \r
11  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * \r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  * ============LICENSE_END=========================================================\r
19  */\r
20 \r
21 package org.openecomp.ecomp.vid.selenium;\r
22 \r
23 import org.testng.annotations.AfterClass;\r
24 import org.testng.annotations.AfterMethod;\r
25 import org.testng.annotations.AfterSuite;\r
26 import org.testng.annotations.BeforeClass;\r
27 import org.testng.annotations.BeforeMethod;\r
28 import org.testng.annotations.BeforeSuite;\r
29 import org.testng.annotations.BeforeTest;\r
30 import org.testng.annotations.Test;\r
31 \r
32 \r
33 import org.openqa.selenium.By;\r
34 import org.openqa.selenium.WebDriver;\r
35 import org.openqa.selenium.WebElement;\r
36 import org.openqa.selenium.firefox.FirefoxDriver;\r
37 import org.openqa.selenium.ie.InternetExplorerDriver;\r
38 import org.openqa.selenium.support.ui.Select;\r
39 \r
40 import java.io.FileInputStream;\r
41 import java.io.IOException;\r
42 import java.io.InputStream;\r
43 import java.util.List;\r
44 import java.util.Properties;\r
45 import java.util.concurrent.TimeUnit;\r
46 import org.apache.log4j.Logger;\r
47 import org.testng.Assert;\r
48 import org.testng.asserts.*;\r
49 \r
50 /**\r
51  * The Class FirstClass.\r
52  */\r
53 public class FirstClass {\r
54         \r
55                 /** The login button. */\r
56                 WebElement loginButton;\r
57                 \r
58                 /** The eg. */\r
59                 String eg;\r
60                 \r
61                 /** The login. */\r
62                 WebElement login;\r
63                 \r
64                 /** The pwd. */\r
65                 WebElement pwd;\r
66                 \r
67                 /** The log. */\r
68                 Logger log;\r
69                 \r
70                 /** The errormessage. */\r
71                 WebElement errormessage;\r
72                 \r
73                                         \r
74                 /** The driver. */\r
75                 WebDriver driver=new FirefoxDriver();\r
76                 \r
77                 \r
78                 \r
79                 /** The config prop. */\r
80                 private final Properties configProp = new Properties();\r
81                 \r
82                 \r
83                 /**\r
84                  * Instantiates a new first class.\r
85                  */\r
86                 private  FirstClass() {\r
87                         // TODO Auto-generated constructor stub\r
88                         //\r
89                         try{\r
90                         //      InputStream input =this.getClass().getClassLoader().getResourceAsStream("objectmap.properties");\r
91                         //FileInputStream input1 = new FileInputStream("objectmap.properties");\r
92                                 \r
93                         InputStream input =new FileInputStream("objectconfig.properties");\r
94                         System.out.println("Read all properties from file");\r
95                         configProp.load(input);\r
96                         System.out.println("Read all properties from file completed");\r
97                         }\r
98                         catch(IOException e) {\r
99                                 \r
100                                 e.printStackTrace();\r
101                         }\r
102                 }\r
103                 \r
104                 \r
105                 /*\r
106                 \r
107                 \r
108                 @BeforeClass\r
109                 public void setUp() {\r
110                         System.out.println("*******************");\r
111                         System.out.println("launching IE browser");\r
112                         System.setProperty("webdriver.ie.driver", driverPath+"IEDriverServer.exe");\r
113                         driver = new InternetExplorerDriver();\r
114                         driver.findElement(By.className());\r
115                         driver.manage().window().maximize();\r
116                         \r
117 \r
118                          login = driver.findElement(By.xpath("//input[@class='fn-ebz-text ng-pristine ng-valid']"));\r
119                          pwd = driver.findElement(By.xpath("//input[@class='span3 ng-pristine ng-valid']"));\r
120                          loginButton = driver.findElement(By.id("loginBtn"));\r
121                 }\r
122                 \r
123                 \r
124         */\r
125                 /**\r
126                  * Sets the up.\r
127                  */\r
128                 // TODO Auto-generated method stub\r
129                 @BeforeClass\r
130                 public void setUp()\r
131                 {\r
132                         \r
133                                                 \r
134                         //WebDriver driver=new FirefoxDriver();\r
135                         \r
136                         log = Logger.getLogger(FirstClass.class.getName());\r
137                 \r
138                 \r
139                 \r
140                 // Get url\r
141                 driver.get(configProp.getProperty("baseURL"));\r
142                 driver.manage().window().maximize();\r
143                 \r
144                 \r
145                  login = driver.findElement(By.xpath(configProp.getProperty("login")));\r
146                  \r
147                  pwd = driver.findElement(By.xpath(configProp.getProperty("pwd")));\r
148                  loginButton = driver.findElement(By.id(configProp.getProperty("loginButton")));\r
149                 }\r
150                 \r
151                 \r
152                 /**\r
153                  * Empty username password.\r
154                  */\r
155                 @Test(priority=1)\r
156                 public void emptyUsernamePassword()\r
157                 {\r
158                 \r
159                         \r
160                 //User Name and Password field is empty\r
161                 log.info("-----VID-11 TC-8----Username and password empty");\r
162                 loginButton.click();\r
163                 errormessage=driver.findElement(By.xpath("//*[@id='errorInfo']/span"));\r
164                 String errmsg= errormessage.getText();\r
165                 //System.out.println("Error message is"+errmsg);\r
166                 //String expected = "Invaild username or password, Please try again";\r
167                 \r
168                 //Assert.assertEquals(errmsg,expected);\r
169 \r
170                 Boolean str = driver.getPageSource().contains("Invalid username or password, Please try again");\r
171                 System.out.println(driver.getPageSource().contains("Invalid username or password, Please try again"));\r
172                 \r
173                 if(str==true)\r
174                 {\r
175                         log.info("Error message validated");\r
176                         log.info("VID-11 TC-8 PASSED");\r
177                         \r
178                 }else\r
179                         log.error("Failed validation");\r
180                 \r
181                 }\r
182 \r
183 \r
184                 \r
185                 /**\r
186                  * Invalid user name.\r
187                  */\r
188                 @Test(priority=2)\r
189                 public void invalidUserName()\r
190                 {\r
191                 \r
192                 log.info("-----VID-11 TC-6----Invalid Username and Valid Password");\r
193                 \r
194                 \r
195                 login.sendKeys("xxx");\r
196                 pwd.sendKeys("abc123");\r
197                 loginButton.click();\r
198                 try {\r
199                         Thread.sleep(5000);\r
200                 } catch (InterruptedException e) {\r
201                         // TODO Auto-generated catch block\r
202                         e.printStackTrace();\r
203                 }\r
204                 \r
205                 String errmsg= errormessage.getText();\r
206                 String expected = "Invalid username or password, Please try again";\r
207                 Assert.assertEquals(errmsg,expected);\r
208                 //Boolean str1 = driver.getPageSource().contains("Invalid username or password, Please try again");\r
209                 //System.out.print(str1);\r
210                 \r
211                 log.info("VID-11 TC-6 PASSED");\r
212                                 \r
213                 }\r
214                 \r
215                 \r
216                 /**\r
217                  * Invalid password.\r
218                  */\r
219                 @Test(priority=3)\r
220                 public void invalidPassword()\r
221                 {\r
222                 log.info("-----VID-11 TC-7----Valid Username and Invalid Password");\r
223                 //  Valid user name and Invalid password.\r
224                                 login.clear();\r
225                                 pwd.clear();\r
226                                 login.sendKeys("testuser");\r
227                                 pwd.sendKeys("xxx");\r
228                                 loginButton.click();\r
229                                 driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r
230                 \r
231                                 \r
232                                 String errmsg= errormessage.getText();\r
233                                 String expected = "Invalid username or password, Please try again";\r
234                                 Assert.assertEquals(errmsg,expected);\r
235                                 \r
236                                 //Boolean str2 = driver.getPageSource().contains("Invaild username or password, Please try again");\r
237                                 //System.out.print(str2);\r
238                                 \r
239                                 log.info("VID-11 TC-7 PASSED");\r
240                 }\r
241                 \r
242                         \r
243                 /**\r
244                  * Login successful.\r
245                  */\r
246                 @Test(priority=4)\r
247                 public void loginSuccessful()\r
248                 {\r
249                 log.info("-----VID-11 TC-1----Valid Username and Valid Password");\r
250                 //Login with valid user name and password.\r
251                 login.clear();\r
252                 login.sendKeys("su");\r
253                 pwd.clear();\r
254                 pwd.sendKeys("fusion");\r
255                 \r
256                                 \r
257                 loginButton.click();\r
258                 driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r
259                 \r
260                 try {\r
261                         Thread.sleep(6000);\r
262                 } catch (InterruptedException e) {\r
263                         // TODO Auto-generated catch block\r
264                         e.printStackTrace();\r
265                 }\r
266                 Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));\r
267                 log.info("VID-11 TC-1 PASSED");\r
268                 \r
269                 }\r
270                 \r
271                 \r
272                 /**\r
273                  * Verify home page elements left pane.\r
274                  */\r
275                 @Test(priority=5)\r
276                 public void verifyHomePageElementsLeftPane()\r
277                 \r
278                 {\r
279                         \r
280                         \r
281                         log.info("VID-10 TC 1 ");\r
282                         //VID Home\r
283                         log.info("VID 11 TC-2");\r
284                         driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[1]/a/span")).isDisplayed();\r
285                         //Create New Service Instance\r
286                         driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[2]/a/span")).isDisplayed();\r
287                         \r
288                         //Browse Service Type\r
289                         driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[3]/a/span")).isDisplayed();\r
290                         //View Log              \r
291                         driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[4]/a/span")).isDisplayed();\r
292                         \r
293                         //Profile\r
294                         driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[5]/a/span")).isDisplayed();\r
295                         //Admin\r
296                         driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[6]/a/span")).isDisplayed();\r
297                         //Logout\r
298                         driver.findElement(By.xpath("html/body/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div/div/accordion/div/div[7]/a/span")).isDisplayed();\r
299                         \r
300                         //Infrastructure Subscriber Name\r
301                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[1]/div/label")).isDisplayed();\r
302                         //Infrastructure Subscriber Name Select Drop down\r
303                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select")).isDisplayed();\r
304                         //Infrastructure Service Type\r
305                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[1]/div/label")).isDisplayed();\r
306                         //Infrastructure Service Type Select Drop down\r
307                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select")).isDisplayed();\r
308                         //Submit button \r
309                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[3]/td/div/button")).isDisplayed();\r
310                         \r
311                         //Login Snippet Icon\r
312                         driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).isDisplayed();\r
313                         \r
314                         \r
315                         //String bodyText = driver.findElement(By.tagName("body")).getText();\r
316                         //Assert.assertTrue("Text not found!", bodyText.contains("Search Existing Service Instances"));\r
317                         //Assert.IsTrue(driver.getPageSource.Contains("Search Existing Service Instances"));\r
318                          \r
319                         log.info("VID-12 TC-1");\r
320                         Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));\r
321                         Assert.assertTrue(driver.getPageSource().contains("Please search by the Subscriber name or Service Type from below:"));\r
322                         log.info("VID-12 TC-1 PASSED");\r
323                         log.info("VID-10 TC 1 PASSED");\r
324                         log.info("VID-11 TC-2 PASSED");\r
325                 }\r
326                 \r
327                 \r
328                 /**\r
329                  * Disabled submit button.\r
330                  */\r
331                 @Test(priority=6)\r
332                 public void disabledSubmitButton()\r
333                 {\r
334                         log.info("VID-12 TC-13");\r
335                         //Assert submit button disabled.\r
336                         Assert.assertFalse(driver.findElement(By.xpath(configProp.getProperty("submitButton"))).isEnabled());\r
337                         log.info("VID-12 TC-13 PASSED");\r
338 \r
339                 } \r
340                 \r
341                 /**\r
342                  * Default list box value.\r
343                  */\r
344                 @Test(priority=7)\r
345                 public void defaultListBoxValue()\r
346                 {\r
347                         log.info("VID-12 TC-2");\r
348                         \r
349                         \r
350                         //WebElement subscribername =driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select"));\r
351                         \r
352                         Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));\r
353                         Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));\r
354                         \r
355                         \r
356                         WebElement ielement=iSelect.getFirstSelectedOption();\r
357                         WebElement oelement=oSelect.getFirstSelectedOption();\r
358                         String defaultsubscribername=oelement.getText();\r
359                         String defaultservicetype=ielement.getText();\r
360                         \r
361                         Assert.assertEquals(defaultsubscribername,"Select Subscriber Name");\r
362                         Assert.assertEquals(defaultservicetype,"Select Service Type");\r
363                         \r
364                 \r
365                         \r
366                         \r
367                 //Verify Select Subscriber Name isDisplayed.\r
368                 //driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[1]/td[2]/div/select/option[1]")).isSelected();\r
369                                 \r
370                 //Verify Select Service Type isDisplayed.       \r
371                 //driver.findElement(By.xpath(".//*[@id='mContent']/div/div/table/tbody/tr[2]/td[2]/div/select/option[1]")).isSelected();\r
372                         \r
373                         \r
374                         log.info("VID-12 TC-2 PASSED");\r
375 \r
376                 }\r
377 \r
378 \r
379                 \r
380                 /**\r
381                  * Select subscriber name drop down.\r
382                  *\r
383                  * @throws InterruptedException the interrupted exception\r
384                  */\r
385                 @Test(priority=8)\r
386                 public void selectSubscriberNameDropDown() throws InterruptedException\r
387                 {\r
388                         log.info("------------------VID-10 TC-2,VID-12 TC-11, VID-12 TC-9, VID 12 TC-10,VID-12 TC-6, VID 12 TC-5--------------------");\r
389                         \r
390                         \r
391                         driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")));\r
392                         \r
393                         driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown")));\r
394                         Thread.sleep(5000);\r
395                         \r
396                         //Infrastructure Subscriber Name\r
397                         Select oSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown"))));\r
398                         \r
399                         List <WebElement> elementCount = oSelect.getOptions();\r
400                         log.info("Select Element Count of Service Name");\r
401                         System.out.println(elementCount.size());\r
402                         \r
403                         \r
404                         //Verifying getInfrastructureSubscribersList\r
405                         log.info("VID-29 TC-1");\r
406                         Assert.assertTrue(elementCount.size()>0);\r
407                         log.info("VID-29 TC-1 PASSED");\r
408                         \r
409                         oSelect.selectByIndex(2);\r
410                         String selectedOption = new Select(driver.findElement(By.xpath(configProp.getProperty("subscriberNameDropDown")))).getFirstSelectedOption().getText();\r
411 \r
412                         System.out.println("Service Name selected is " +selectedOption);\r
413                         log.info("VID-10 TC-2 PASSED");\r
414                                         \r
415                         //Submit button is clicked\r
416                         driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();\r
417                         \r
418                         \r
419                         //Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"\r
420                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();\r
421                         //Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))\r
422                         \r
423                         \r
424                         //Verify whether the page header is displayed "Global Customer ID"\r
425                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();\r
426                         Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));\r
427                         Assert.assertTrue(driver.getPageSource().contains("Subscriber Name"));\r
428                         Assert.assertTrue(driver.getPageSource().contains("Service Type"));\r
429                         Assert.assertTrue(driver.getPageSource().contains("Service Instance ID"));\r
430                         \r
431                         log.info("VID-12 TC-5 PASSED");\r
432                         log.info("VID-12 TC-11 PASSED");\r
433                         \r
434                         WebElement serviceinstancetable =driver.findElement(By.xpath("//table[@class='tablesorter tablesorter-default ng-isolate-scope']"));\r
435                         \r
436                         List<WebElement> rows_table = serviceinstancetable.findElements(By.tagName("tr"));\r
437                           //To calculate no of rows In table.\r
438                           int rows_count = rows_table.size();\r
439                           \r
440                           //Loop will execute till the last row of table.\r
441                           for (int row=0; row<rows_count; row++){\r
442                            //To locate columns(cells) of that specific row.\r
443                            List<WebElement> Columns_row = rows_table.get(row).findElements(By.tagName("td"));\r
444                            //To calculate no of columns(cells) In that specific row.\r
445                            int columns_count = Columns_row.size();\r
446                            //System.out.println("Number of cells In Row "+row+" are "+columns_count);\r
447                            \r
448                            //Loop will execute till the last cell of that specific row.\r
449                            for (int column=0; column<columns_count; column++){\r
450                             //To retrieve text from that specific cell.\r
451                             String celtext = Columns_row.get(column).getText();\r
452                             //System.out.println("Cell Value Of row number "+row+" and column number "+column+" Is "+celtext);\r
453                            \r
454                             \r
455                             \r
456                             //log.info("Testing Get column and row value");\r
457                             List <WebElement> exx= rows_table.get(1).findElements(By.tagName("td"));\r
458                              eg=Columns_row.get(2).getText();\r
459                            // System.out.println("Cell value of row 1 and column 2 is" +eg);\r
460                            }\r
461                           }\r
462                 \r
463                           \r
464                         \r
465                         \r
466                         //Verify View/Edit isDisplayed and Click\r
467                         \r
468                         driver.findElement(By.xpath("//a[@alt='View/Edit']")).isDisplayed();\r
469                         \r
470                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/tbody/tr[1]/td[1]/div/a")).click();\r
471                         \r
472                         log.info("User clicked View/Edit");\r
473                         \r
474                         //Verify the Subscriber Name displayed. \r
475                         String header= driver.findElement(By.xpath("//h1[@class='heading1 ng-binding']")).getText();\r
476                         //System.out.println(header);\r
477                         \r
478                         \r
479                         if(header.contains(eg))\r
480                         {\r
481                                 System.out.println("Header contains the subscriber name");\r
482                         }else\r
483                                 System.out.println("Header does not contain the subscriber name");\r
484                         \r
485                         \r
486                         \r
487                         Assert.assertTrue(driver.getPageSource().contains("PerfTest Subscriber00020021"));\r
488                         log.info("VID-12 TC-6 PASSED");\r
489                         \r
490                         \r
491                                 \r
492                         driver.navigate().back();\r
493                         //Cancel button isDisplayed\r
494                         driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).isDisplayed();\r
495                         log.info("VID-12 TC-9 PASSED");\r
496                         \r
497                         //Cancel button is clicked\r
498                         driver.findElement(By.xpath("//button[@class='button button--small button--primary']")).click();\r
499                         log.info("Cancel button is clicked");\r
500                         \r
501                         //Verifying VID Home page is displayed\r
502                         Assert.assertTrue(driver.getPageSource().contains("Search Existing Service Instances"));\r
503                         log.info("VID-12 TC-10 PASSED");\r
504                         \r
505                            }\r
506                 \r
507                 \r
508                 /**\r
509                  * Refresh subscriber name.\r
510                  */\r
511                 @Test(priority=9)\r
512                 public void refreshSubscriberName()\r
513                 {\r
514                         log.info("VID-10 TC-4");\r
515                         \r
516                         \r
517                         driver.findElement(By.xpath(configProp.getProperty("refreshButtonSubscriberName"))).isDisplayed();\r
518                         \r
519                         log.info("VID-10 TC-4 PASSED");\r
520                         \r
521                         \r
522                 }\r
523 \r
524                 \r
525                 /**\r
526                  * Select subscriber type drop down.\r
527                  *\r
528                  * @throws InterruptedException the interrupted exception\r
529                  */\r
530                 @Test(priority=9)\r
531                 public void selectSubscriberTypeDropDown() throws InterruptedException\r
532                 {\r
533                         Thread.sleep(5000);\r
534                         log.info("------------------VID-10 TC-3, VID-12 TC-12,--------------------");\r
535                         //Infrastructure Subscriber Type\r
536                         Select iSelect = new Select(driver.findElement(By.xpath(configProp.getProperty("serviceTypeDropDown"))));\r
537                         \r
538                         List <WebElement> ielementCount = iSelect.getOptions();\r
539                         log.info("Select Element Count of Service type");\r
540                         System.out.println(ielementCount.size());\r
541                         iSelect.selectByIndex(1);\r
542                         \r
543                         log.info("VID-10 TC-3 PASSED");\r
544                         \r
545                                                 \r
546                         //Submit button is clicked\r
547                         driver.findElement(By.xpath(configProp.getProperty("submitButton"))).click();\r
548                         \r
549                         //Verify whether the page header is displayed "Selected Subscriber's Service Instance Details:"\r
550                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/h1")).isDisplayed();\r
551                         //Assert.assertTrue(driver.getPageSource().contains("Selected Subscriber's Service Instance Details:"))\r
552                         log.info("Page Header: Selected Subscriber's Service Instance Details");\r
553                         \r
554                         \r
555                         //Verify whether the page header is displayed "Global Customer ID"\r
556                         driver.findElement(By.xpath(".//*[@id='mContent']/div/div/div/div/table/thead/tr/th[2]/div")).isDisplayed();\r
557                         \r
558                         //Assert.assertTrue(driver.getPageSource().contains("Global Customer ID"));\r
559                         log.info("Table is displayed");\r
560                         \r
561                         log.info("VID-12 TC-12 PASSED");\r
562                         \r
563                 }\r
564                 \r
565                 \r
566                 \r
567                 /**\r
568                  * Logout under profile.\r
569                  */\r
570                 @Test(priority=10)\r
571                 public void logoutUnderProfile()\r
572                 {\r
573                         \r
574                         log.info("-----------VID-11 TC-5---------------------");\r
575                         //driver.findElement(By.partialLinkText("Click here to login")).click();\r
576                         //driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);\r
577                         \r
578                 \r
579                         driver.findElement(By.xpath(".//*[@class='icon-user-small login-snippet-icon']")).click();                      \r
580                         driver.findElement(By.xpath(".//*[@id='reg-logout-div']/a")).click();\r
581                         //Validate that the user has logged out of VID. Displays "Portal"\r
582                         Assert.assertTrue(driver.getPageSource().contains("Portal"));\r
583                         \r
584                         log.info("VID-11 TC-5 PASSED");\r
585                         \r
586                 }\r
587 \r
588                 \r
589                 \r
590                 /**\r
591                  * Tear down.\r
592                  */\r
593                 @AfterClass\r
594                 public void tearDown()\r
595                 {\r
596                         driver.close();\r
597                 \r
598                 }\r
599                 \r
600                 \r
601                 \r
602         }\r
603 \r
604 \r
605         \r
606 \r