List of usage examples for org.openqa.selenium Keys ENTER
Keys ENTER
To view the source code for org.openqa.selenium Keys ENTER.
Click Source Link
From source file:com.pentaho.ctools.cdf.require.TextInputComponent.java
License:Apache License
/** * ############################### Test Case 4 ############################### * * Test Case Name:/*w w w . ja v a 2 s . c om*/ * Insert a long text * Description: * We pretend validate when we insert a long text an alert is raised. * Steps: * 1. Insert text * 2. Check for alert * 3. Check the input text inserted */ @Test public void tc4_InputLongPhrase_AlertDispayed() { this.log.info("tc4_InputLongPhrase_AlertDispayed"); /* * ## Step 1 */ String strInputString = "Hello World! Hello World! Hello World! Hello World! Hello World! Hello World!"; strInputString += strInputString; strInputString += strInputString; strInputString += strInputString; strInputString += strInputString; this.elemHelper.FindElement(driver, By.id("myInput")).clear(); //After clean text, we need to trait the pop-up wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); alert.accept(); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(strInputString); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(Keys.ENTER); /* * ## Step 2 */ wait.until(ExpectedConditions.alertIsPresent()); alert = driver.switchTo().alert(); String confirmationMsg = alert.getText(); String expectedCnfText = "you typed: " + strInputString; alert.accept(); assertEquals(expectedCnfText, confirmationMsg); }
From source file:com.pentaho.ctools.cdf.require.TextInputComponent.java
License:Apache License
/** * ############################### Test Case 5 ############################### * * Test Case Name:// w w w . ja v a 2s .c o m * Insert special characters * Description: * We pretend validate when we insert a special characters an alert is * raised. * Steps: * 1. Insert text * 2. Check for alert * 3. Check the input text inserted */ @Test public void tc5_InputSpecialPhrase_AlertDispayed() { this.log.info("tc5_InputSpecialPhrase_AlertDispayed"); /* * ## Step 1 */ String strInputString = "`|!\"1#$%&/()=?*:_<>/*-+"; this.elemHelper.FindElement(driver, By.id("myInput")).clear(); //After clean text, we need to trait the pop-up wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); alert.accept(); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(strInputString); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(Keys.ENTER); /* * ## Step 2 */ wait.until(ExpectedConditions.alertIsPresent()); alert = driver.switchTo().alert(); String confirmationMsg = alert.getText(); String expectedCnfText = "you typed: " + strInputString; alert.accept(); assertEquals(expectedCnfText, confirmationMsg); }
From source file:com.pentaho.ctools.cdf.TableComponent.java
License:Apache License
/** * ############################### Test Case 3 ############################### * * Test Case Name://from w w w . j a va2 s. c om * Check Paging * Description: * User has the possibility to navigate between pages, and new date shall * be displayed. * Steps: * 1. Check the data in first page is correct. * 2. Go to the next page and check the data. * 3. Go to the end page and check the data. * 4. Go to the first page and check the data. */ @Test public void tc3_Paging_NavigateBetweenPages() { this.log.info("tc3_Paging_NavigateBetweenPages"); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("sampleObjectTable_length"))); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("sampleObjectTable_filter"))); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("sampleObjectTable"))); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("sampleObjectTable_info"))); wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("sampleObjectTable_paginate"))); //## Step 1 assertEquals("Showing 1 to 10 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Amica Models & Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("94,117", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("200,995", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Baane Mini Imports", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Cruz & Sons Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("94,016", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 2 //Where we press NEXT WebElement page2 = this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_next']")); assertNotNull(page2); page2.sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2][@class='paginate_button current']"))); assertEquals("Showing 11 to 20 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Danish Wholesale Imports", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("145,042", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("174,140", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Extreme Desk Decorations, Ltd", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Handji Gifts& Co", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("115,499", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 3 //Where we press 5 WebElement page5 = this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[5]")); assertNotNull(page5); page5.sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[5][@class='paginate_button current']"))); assertEquals("Showing 41 to 50 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Suominen Souveniers", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("113,961", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("160,010", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Toys of Finland, Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Vitachrome Inc.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("88,041", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 4 this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_previous']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[4][@class='paginate_button current']"))); this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_previous']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[3][@class='paginate_button current']"))); this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_previous']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2][@class='paginate_button current']"))); this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_previous']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[@class='paginate_button current']"))); assertEquals("Showing 1 to 10 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Amica Models & Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("94,117", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("200,995", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Baane Mini Imports", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Cruz & Sons Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("94,016", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); }
From source file:com.pentaho.ctools.cdf.TableComponent.java
License:Apache License
/** * ############################### Test Case 4 ############################### * * Test Case Name:/* w ww .j a va2 s . co m*/ * Sort * Description: * Testing the sort on Customer and Sales, and when user is not in the * first page. * Steps: * 1. Sort in Customer (Desc) * 2. Sort in Sales (Asc) * 3. Page to the third page * 4. Sort in Sales (Desc) * 5. Go to the next page and check the data. * 6. Go to the end page and check the data. * 7. Go to the first page and check the data. */ @Test public void tc4_Sort_ElementsAreSort() { this.log.info("tc4_Sort_ElementsAreSort"); //## Step 1 wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//table[@id='sampleObjectTable']/thead/tr/th[@class='column0 string sorting_asc']"))); this.elemHelper.FindElement(driver, By.xpath("//table[@id='sampleObjectTable']/thead/tr/th")).click(); //Set to DESC wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//table[@id='sampleObjectTable']/thead/tr/th[@class='column0 string sorting_desc']"))); //Check Data assertNotNull(this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1][@class='paginate_button current']"))); assertEquals("Showing 1 to 10 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Vitachrome Inc.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("88,041", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("118,008", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertTrue(this.elemHelper .WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td")) .contains("Toms")); assertEquals("Suominen Souveniers", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("113,961", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 2 this.elemHelper.FindElement(driver, By.xpath("//table[@id='sampleObjectTable']/thead/tr/th[2]")).click(); //Sort Sales to ASC wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//table[@id='sampleObjectTable']/thead/tr/th[2][@class='column1 numeric sorting_asc']"))); //Check Data assertNotNull(this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1][@class='paginate_button current']"))); assertEquals("Showing 1 to 10 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Collectable Mini Designs Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("87,489", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("88,805", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Amica Models & Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertTrue(this.elemHelper .WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td")) .contains("Toms")); assertEquals("100,307", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 3 WebElement page3 = this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[3]")); assertNotNull(page3); page3.sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[3][@class='paginate_button current']"))); //Check Data assertNotNull(this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[3][@class='paginate_button current']"))); assertEquals("Showing 21 to 30 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Handji Gifts& Co", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("115,499", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("117,714", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Corrida Auto Replicas, Ltd", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Scandinavian Gift Ideas", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("134,259", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 4 this.elemHelper.FindElement(driver, By.xpath("//table[@id='sampleObjectTable']/thead/tr/th[2]")).click(); //Sort Sales to DESC wait.until(ExpectedConditions.visibilityOfElementLocated(By .xpath("//table[@id='sampleObjectTable']/thead/tr/th[2][@class='column1 numeric sorting_desc']"))); //Check Data assertNotNull(this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1][@class='paginate_button current']"))); assertEquals("Showing 1 to 10 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Euro+ Shopping Channel", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("912,294", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("200,995", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Down Under Souveniers, Inc", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Kelly's Gift Shop", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("158,345", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 5 WebElement page2 = this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_next']")); assertNotNull(page2); page2.sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2][@class='paginate_button current']"))); assertNotNull(this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2][@class='paginate_button current']"))); assertEquals("Showing 11 to 20 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("AV Stores, Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("157,808", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("151,571", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Danish Wholesale Imports", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Reims Collectables", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("135,043", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 6 this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_next']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[3][@class='paginate_button current']"))); this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_next']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[4][@class='paginate_button current']"))); this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_next']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[5][@class='paginate_button current']"))); assertNotNull(this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[5][@class='paginate_button current']"))); assertEquals("Showing 41 to 50 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertTrue(this.elemHelper .WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td")) .contains("Toms")); assertEquals("100,307", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("98,496", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Cruz & Sons Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Collectable Mini Designs Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("87,489", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //## Step 7 WebElement page1 = this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1]")); assertNotNull(page1); page1.sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1][@class='paginate_button current']"))); //Check Data assertNotNull(this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1][@class='paginate_button current']"))); assertEquals("Showing 1 to 10 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Euro+ Shopping Channel", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("912,294", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("200,995", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Down Under Souveniers, Inc", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Kelly's Gift Shop", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("158,345", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //reset to initial state this.elemHelper.FindElement(driver, By.xpath("//table[@id='sampleObjectTable']/thead/tr/th")).click(); //Set Customers to ASC wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//table[@id='sampleObjectTable']/thead/tr/th[@class='column0 string sorting_asc']"))); assertEquals("Showing 1 to 10 of 50 entries", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Amica Models & Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("94,117", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("200,995", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Baane Mini Imports", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Cruz & Sons Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("94,016", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); }
From source file:com.pentaho.ctools.cdf.TableComponent.java
License:Apache License
/** * ############################### Test Case 6 ############################### * * Test Case Name://from w w w .j a va 2 s.c om * Search Engine * Description: * When search for something the table is refresh with the contents * searched. * Steps: * 1. Search for 'Co.' (Check paging, display entries, sort) * 2. Search for 'Euro' (Check paging, display entries, sort) * 3. Search for 'TODO' (no result) */ @Test public void tc6_SearchEngine_TableDisplayedContentSearch() { this.log.info("tc6_SearchEngine_TableDisplayedContentSearch"); //## Step 1 this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_filter']/label/input")) .sendKeys("Co."); assertEquals("Showing 1 to 10 of 13 entries (filtered from 50 total entries)", this.elemHelper .WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_previous")).isDisplayed()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_previous")).isEnabled()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_next")).isDisplayed()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_next")).isEnabled()); //check paging 1 and 2 assertTrue(this.elemHelper .FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1]")).isEnabled()); assertTrue(this.elemHelper .FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1]")).isDisplayed()); assertTrue(this.elemHelper .FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2]")).isEnabled()); assertTrue(this.elemHelper .FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2]")).isDisplayed()); assertEquals("Amica Models & Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("94,117", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); assertEquals("157,808", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); assertEquals("Cruz & Sons Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[6]/td"))); assertEquals("Saveley & Henriot, Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td"))); assertEquals("142,874", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[10]/td[2]"))); //Click Next this.elemHelper.FindElement(driver, By.xpath("//a[@id='sampleObjectTable_next']")).sendKeys(Keys.ENTER); wait.until(ExpectedConditions.visibilityOfElementLocated( By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2][@class='paginate_button current']"))); assertEquals("Souveniers And Things Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[1]/td"))); assertEquals("Toys of Finland, Co.", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td"))); assertEquals("111,250", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr[3]/td[2]"))); //## Step 2 this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_filter']/label/input")).clear(); this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_filter']/label/input")) .sendKeys("Euro"); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_previous")).isDisplayed()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_previous")).isEnabled()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_next")).isDisplayed()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_next")).isEnabled()); assertTrue(this.elemHelper .FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1]")).isEnabled()); assertTrue(this.elemHelper .FindElement(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1]")).isDisplayed()); assertTrue(this.elemHelper.WaitForElementNotPresent(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[2]"), 2)); assertEquals("Showing 1 to 1 of 1 entries (filtered from 50 total entries)", this.elemHelper .WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("Euro+ Shopping Channel", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); assertEquals("912,294", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td[2]"))); //## Step 3 this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_filter']/label/input")).clear(); this.elemHelper.FindElement(driver, By.xpath("//div[@id='sampleObjectTable_filter']/label/input")) .sendKeys("TODO"); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_previous")).isDisplayed()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_previous")).isEnabled()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_next")).isDisplayed()); assertTrue(this.elemHelper.FindElement(driver, By.id("sampleObjectTable_next")).isEnabled()); assertTrue(this.elemHelper.WaitForElementNotPresent(driver, By.xpath("//div[@id='sampleObjectTable_paginate']/span/a[1]"), 2)); assertEquals("Showing 0 to 0 of 0 entries (filtered from 50 total entries)", this.elemHelper .WaitForElementPresentGetText(driver, By.xpath("//div[@id='sampleObjectTable_info']"))); assertEquals("No matching records found", this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//table[@id='sampleObjectTable']/tbody/tr/td"))); }
From source file:com.pentaho.ctools.cdf.TextInputComponent.java
License:Apache License
/** * ############################### Test Case 3 ############################### * * Test Case Name:/*from w ww . j a v a 2 s .co m*/ * Insert a small text * Description: * We pretend validate when we insert a small text an alert is raised. * Steps: * 1. Insert text * 2. Check for alert * 3. Check the input text inserted */ @Test public void tc3_InputSmallPhrase_AlertDispayed() { // ## Step 1 String strInputString = "Hello World!"; this.elemHelper.FindElement(driver, By.id("myInput")).clear(); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(strInputString); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(Keys.ENTER); // ## Step 2 wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); String confirmationMsg = alert.getText(); String expectedCnfText = "you typed: " + strInputString; alert.accept(); assertEquals(expectedCnfText, confirmationMsg); }
From source file:com.pentaho.ctools.cdf.TextInputComponent.java
License:Apache License
/** * ############################### Test Case 4 ############################### * * Test Case Name://from w w w. j a v a2s . c om * Insert a long text * Description: * We pretend validate when we insert a long text an alert is raised. * Steps: * 1. Insert text * 2. Check for alert * 3. Check the input text inserted */ @Test public void tc4_InputLongPhrase_AlertDispayed() { // ## Step 1 String strInputString = "Hello World! Hello World! Hello World! Hello World! Hello World! Hello World!"; strInputString += strInputString; strInputString += strInputString; strInputString += strInputString; strInputString += strInputString; this.elemHelper.FindElement(driver, By.id("myInput")).clear(); //After clean text, we need to trait the pop-up wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); alert.accept(); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(strInputString); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(Keys.ENTER); // ## Step 2 wait.until(ExpectedConditions.alertIsPresent()); alert = driver.switchTo().alert(); String confirmationMsg = alert.getText(); String expectedCnfText = "you typed: " + strInputString; alert.accept(); assertEquals(expectedCnfText, confirmationMsg); }
From source file:com.pentaho.ctools.cdf.TextInputComponent.java
License:Apache License
/** * ############################### Test Case 5 ############################### * * Test Case Name:/*from w w w. j a v a 2s .c o m*/ * Insert special characters * Description: * We pretend validate when we insert a special characters an alert is * raised. * Steps: * 1. Insert text * 2. Check for alert * 3. Check the input text inserted */ @Test public void tc5_InputSpecialPhrase_AlertDispayed() { // ## Step 1 String strInputString = "`|!\"1#$%&/()=?*:_<>/*-+"; this.elemHelper.FindElement(driver, By.id("myInput")).clear(); //After clean text, we need to trait the pop-up wait.until(ExpectedConditions.alertIsPresent()); Alert alert = driver.switchTo().alert(); alert.accept(); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(strInputString); this.elemHelper.FindElement(driver, By.id("myInput")).sendKeys(Keys.ENTER); // ## Step 2 wait.until(ExpectedConditions.alertIsPresent()); alert = driver.switchTo().alert(); String confirmationMsg = alert.getText(); String expectedCnfText = "you typed: " + strInputString; alert.accept(); assertEquals(expectedCnfText, confirmationMsg); }
From source file:com.pentaho.ctools.issues.cde.CDE430.java
License:Apache License
/** * ############################### Test Case 1 ############################### * * Test Case Name: /* w w w .ja v a2 s .com*/ * Assert Popup Export Component properties show list with type options * * Description: * The test pretends validate the CDE-430 issue, so when user clicks the down arron when Chart Exprt or Data Export Types are * selected, a drop down list is shown with valid type options * * Steps: * 1. Open new CDE dashboard and go to Components Panel * 2. Add Export Popup Component and go to Advanced Properties * 3. Assert list is shown for Chart Export Type * 4. Assert list is shown for Data Export Type */ @Test public void tc01_PopupExportComponent_TypeListShown() { this.log.info("tc01_PopupExportComponent_TypeListShown"); /* * ## Step 1 */ //New CDE dashboard driver.get(PageUrl.CDE_DASHBOARD); this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay")); //Go to components Panel WebElement componentsButton = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@class='componentsPanelButton']")); assertNotNull(componentsButton); componentsButton.click(); WebElement componentsPanel = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.id("panel-componentens_panel")); assertNotNull(componentsPanel); /* * ## Step 2 */ //Add Export Popup Component WebElement expandOthers = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath( "//div[@id='cdfdd-components-pallete']/div[@id='cdfdd-components-palletePallete']/div[2]/h3/a")); assertNotNull(expandOthers); expandOthers.click(); WebElement exportPopup = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']//a[@title='Export Popup Component']")); assertNotNull(exportPopup); exportPopup.click(); //Click Advanced Properties WebElement advancedProperties = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath( "//div[@id='cdfdd-components-properties']/div/div/div[@class='advancedProperties propertiesUnSelected']")); assertNotNull(advancedProperties); advancedProperties.click(); this.elemHelper.WaitForAttributeValueEqualsTo(driver, By.xpath("//div[@id='cdfdd-components-properties']/div/div/div[3]"), "class", "advancedProperties propertiesSelected"); /* * ## Step 3 */ //Assert list appears for Chart Types to Export WebElement chartType = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//td[@title='Type for Chart Image to Export']/../td[2]")); assertNotNull(chartType); chartType.click(); WebElement inputChart = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//td[@title='Type for Chart Image to Export']/../td[2]/form/input")); assertNotNull(inputChart); inputChart.clear(); /* Robot robot1; try { robot1 = new Robot(); robot1.keyPress( KeyEvent.VK_ENTER ); robot1.keyRelease( KeyEvent.VK_ENTER ); robot1.keyPress( KeyEvent.VK_ENTER ); robot1.keyRelease( KeyEvent.VK_ENTER ); robot1.keyPress( KeyEvent.VK_DOWN ); robot1.keyRelease( KeyEvent.VK_DOWN ); } catch ( AWTException e ) { e.printStackTrace(); }*/ Actions a = new Actions(driver); a.sendKeys(Keys.ENTER).sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).build().perform(); WebElement listOption1 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li/a")); assertNotNull(listOption1); String textOption1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li/a")); assertEquals("png", textOption1); WebElement listOption2 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li[2]/a")); assertNotNull(listOption2); String textOption2 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[2]/a")); assertEquals("svg", textOption2); a.sendKeys(Keys.ENTER).sendKeys(Keys.ENTER).build().perform(); this.elemHelper.WaitForElementNotPresent(driver, By.xpath("//body/ul/li/a")); /* * ## Step 4 */ //Assert list appears for Data Types to Export WebElement dataType = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//td[@title='Type for Data File to Export']/../td[2]")); assertNotNull(dataType); dataType.click(); WebElement inputData = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//td[@title='Type for Data File to Export']/../td[2]/form/input")); assertNotNull(inputData); inputData.clear(); /*try { robot1 = new Robot(); robot1.keyPress( KeyEvent.VK_ENTER ); robot1.keyRelease( KeyEvent.VK_ENTER ); robot1.keyPress( KeyEvent.VK_ENTER ); robot1.keyRelease( KeyEvent.VK_ENTER ); robot1.keyPress( KeyEvent.VK_DOWN ); robot1.keyRelease( KeyEvent.VK_DOWN ); } catch ( AWTException e ) { e.printStackTrace(); }*/ a.sendKeys(Keys.ENTER).sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).build().perform(); listOption1 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li/a")); assertNotNull(listOption1); textOption1 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li/a")); assertEquals("xls", textOption1); listOption2 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li[2]/a")); assertNotNull(listOption2); textOption2 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[2]/a")); assertEquals("csv", textOption2); WebElement listOption3 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li[3]/a")); assertNotNull(listOption3); String textOption3 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[3]/a")); assertEquals("xml", textOption3); WebElement listOption4 = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//body/ul/li[4]/a")); assertNotNull(listOption4); String textOption4 = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//body/ul/li[4]/a")); assertEquals("json", textOption4); }
From source file:com.pentaho.ctools.issues.cde.editor.CDEComponentPanel.java
License:Apache License
/** * ############################### Test Case 1 ############################### * * Test Case Name:// w ww. ja v a2 s . c o m * This test validates all issues related to CDE's Component Panel * * Description: * 399: Accordion works as expected * 410: Shortcuts work * 529: Opening a popup blocks the use of the shortcuts to navigate * CDF-504: baseAxisFont is exposed in Advanced Properties of CCC chart components * * Steps: * 1. Open CDE sample in edit mode, go to components panel and add some components * 2. Assert down, up, left and right shortcuts work on components panel * 3. Assert tab and enter shortcuts work on components panel * 4. Assert opening parameter popup blocks navigation by arrows * 5. Go to chart Advanced Properties and assert baseAxisFont is there */ @Test public void tc01_CDEDashboardEdit_ComponentPanel() { this.log.info("tc01_CDEDashboardEdit_ComponentPanel"); /* * ## Step 1 */ //Open CDE sample in edit mode this.elemHelper.Get(driver, PageUrl.CDE_DASHBOARD); this.elemHelper.WaitForElementInvisibility(driver, By.cssSelector("div.blockUI.blockOverlay")); //Go to Components Panel this.elemHelper.Click(driver, By.xpath("//div[@title='Components Panel']/a")); //Assert behavior of accordion WebElement otherExpander = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/a")); assertNotNull(otherExpander); String otherText = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/a")); assertEquals("Others", otherText); this.elemHelper.Click(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/a")); WebElement tableComponent = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//a[@title='table Component']")); assertNotNull(tableComponent); WebElement genericExpander = this.elemHelper.WaitForElementPresenceAndVisible(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[3]/h3/a")); assertNotNull(genericExpander); String genericText = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[3]/h3/a")); assertEquals("Generic", genericText); this.elemHelper.Click(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[3]/h3/a")); this.elemHelper.WaitForElementInvisibility(driver, By.xpath("//a[@title='table Component']")); //Add some Components WebElement chartExpander = this.elemHelper.FindElement(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div/h3/span")); assertNotNull(chartExpander); chartExpander.click(); WebElement addAreaChart = this.elemHelper.FindElement(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div//a[@title='CCC Area Chart']")); assertNotNull(addAreaChart); addAreaChart.click(); WebElement addBulletChart = this.elemHelper.FindElement(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div//a[@title='CCC Bullet Chart']")); assertNotNull(addBulletChart); addBulletChart.click(); otherExpander = this.elemHelper.FindElement(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]/h3/span")); assertNotNull(otherExpander); otherExpander.click(); WebElement addTable = this.elemHelper.FindElement(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]//a[@title='table Component']")); assertNotNull(addTable); addTable.click(); WebElement addButton = this.elemHelper.FindElement(driver, By.xpath("//div[@id='cdfdd-components-palletePallete']/div[2]//a[@title='Button Component']")); assertNotNull(addButton); addButton.click(); /* * ## Step 2 */ //Select first chart group this.elemHelper.Click(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr/td")); this.elemHelper.WaitForAttributeValue(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr"), "class", "expanded initialized parent ui-state-active"); String chartGroup = this.elemHelper .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr")) .getAttribute("class"); assertEquals(chartGroup, "expanded initialized parent ui-state-active"); //Assert groups are expanded and clicking left will collapse them, also assert down arrow moves between showing elements WebElement areaChart = this.elemHelper.FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]")); assertNotNull(areaChart); tableComponent = this.elemHelper.FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]")); assertNotNull(tableComponent); Actions a = new Actions(driver); a.sendKeys(Keys.LEFT).sendKeys(Keys.DOWN).sendKeys(Keys.LEFT).build().perform(); this.elemHelper.WaitForAttributeValue(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[4]"), "class", "initialized parent ui-state-active collapsed"); String otherGroup = this.elemHelper .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[4]")) .getAttribute("class"); assertEquals(otherGroup, "initialized parent ui-state-active collapsed"); this.elemHelper.WaitForElementInvisibility(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]")); this.elemHelper.WaitForElementInvisibility(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]")); //Assert clicking right arrow expands groups a.sendKeys(Keys.RIGHT).sendKeys(Keys.UP).sendKeys(Keys.RIGHT).build().perform(); areaChart = this.elemHelper.FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[2]")); assertNotNull(areaChart); tableComponent = this.elemHelper.FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]")); assertNotNull(tableComponent); //Go to to table component and assert it's selected a.sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).build().perform(); this.elemHelper.WaitForAttributeValue(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]"), "class", "child-of-OTHERCOMPONENTS initialized collapsed ui-state-active"); String tableClass = this.elemHelper .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-components']/tbody/tr[5]")) .getAttribute("class"); assertEquals(tableClass, "child-of-OTHERCOMPONENTS initialized collapsed ui-state-active"); /* * ## Step 3 */ //Click tab key and assert focus has changed to properties table a.sendKeys(Keys.TAB).build().perform(); this.elemHelper.WaitForAttributeValue(driver, By.xpath("//table[@id='table-cdfdd-components-properties']/tbody/tr"), "class", "initialized ui-state-active"); String nameProperty = this.elemHelper .FindElement(driver, By.xpath("//table[@id='table-cdfdd-components-properties']/tbody/tr")) .getAttribute("class"); assertEquals(nameProperty, "initialized ui-state-active"); //Click enter to change following properties "Name" and "Parameters" a.sendKeys(Keys.ENTER).sendKeys("a").sendKeys(Keys.ENTER).sendKeys(Keys.DOWN).sendKeys(Keys.DOWN) .sendKeys(Keys.DOWN).sendKeys(Keys.DOWN).build().perform(); /* * ## Step 4 */ //Change "Parameter" and assert using down arrow to navigate is blocked //Focus to the top this.elemHelper.MoveToElement(driver, By.cssSelector( "#cdfdd-components-properties > div > div.tableCaption.ui-state-default > div.simpleProperties.propertiesSelected")); this.elemHelper.WaitForAttributeValue(driver, By.xpath("//td[contains(text(),'Parameter')]/.."), "class", "initialized ui-state-active"); String parameterProperty = this.elemHelper .FindElement(driver, By.xpath("//td[contains(text(),'Parameter')]/..")).getAttribute("class"); assertEquals(parameterProperty, "initialized ui-state-active"); a.sendKeys(Keys.ENTER).build().perform(); WebElement popupParameter = this.elemHelper.FindElement(driver, By.id("popupstates")); assertNotNull(popupParameter); String popupTitle = this.elemHelper.WaitForTextDifferentEmpty(driver, By .cssSelector("#popup_state_state0 > div > div.popup-header-container > div.popup-title-container")); assertEquals(popupTitle, "Parameters"); a.sendKeys(Keys.DOWN).build().perform(); this.elemHelper.ClickJS(driver, By.id("popup_state0_buttonCancel")); assertTrue(this.elemHelper.WaitForElementNotPresent(driver, By.id("popupstates"))); this.elemHelper.WaitForAttributeValue(driver, By.xpath("//td[contains(text(),'Parameter')]/.."), "class", "initialized ui-state-active"); parameterProperty = this.elemHelper.FindElement(driver, By.xpath("//td[contains(text(),'Parameter')]/..")) .getAttribute("class"); assertEquals(parameterProperty, "initialized ui-state-active"); //assert values are changed String nameValue = this.elemHelper.WaitForElementPresentGetText(driver, By.xpath("//td[contains(text(),'Name')]/../td[2]")); assertEquals(nameValue, "a"); /* * ## Step 5 */ areaChart = this.elemHelper.FindElement(driver, By .xpath("//table[@id='table-cdfdd-components-components']//td[contains(text(),'CCC Area Chart')]")); assertNotNull(areaChart); areaChart.click(); WebElement advancedProperties = this.elemHelper.FindElement(driver, By.xpath( "//div[@id='cdfdd-components-properties']//div[@class='advancedProperties propertiesUnSelected']")); assertNotNull(advancedProperties); advancedProperties.click(); WebElement baseAxisFont = this.elemHelper.FindElement(driver, By.xpath( "//table[@id='table-cdfdd-components-properties']//td[@title='The font used by the panel.']")); assertNotNull(baseAxisFont); }