public class IDERightClick extends SeleneseTestCase{
+ /**
+ * TIP: Start the Selenium RC serve using
+ * in the dependencies directory
+ * java -jar selenium-server-standalone-2.0b1.jar
+ */
@Before
public void setUp() throws Exception {
- selenium = new DefaultSelenium("localhost", 4444, "*firefox", "http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/");
- setUp("http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/", "*firefox");
+ selenium = new DefaultSelenium("localhost", 4444, "*chrome", "http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/");
+// setUp("http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/", "*firefox");
selenium.start();
}
@Test
public void testRestoreTrash() throws Exception {
- selenium.open("/pithos/#Files");
- selenium.click("lakis@ebs.gr");
- selenium.contextMenuAt("Trash", "");
+// selenium.open("/pithos/#Files");
+ selenium.open("http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/");
+ selenium.waitForPageToLoad("300000");
+ selenium.click("lakis@ebs.gr");
+ selenium.contextMenuAt("Trash", "");
selenium.click("folderContextMenu.restore");
}
public class FolderUtils extends GeneralPurposeUtils{
- public void expandTree(){
-// ERROR: Compound class names are not supported. Consider searching for one class name and filtering the results.
-// action.click(By.className("GK31MSKBDF GK31MSKBLF"));
-// action.click(By.xpath("//span[@id='Trash']/../../.."));
-// action.click(By.xpath("//div[@id='']/img"));
-// action.click(By.xpath("//span[@id='Trash']/.."));
-// action.click(By.xpath("ancestor:://span[@id='Trash']"));// Error not legal expression
-// action.click(By.xpath("//div[@class='GK31MSKBCF GK31MSKBKF gwtQuery-draggable gwtQuery-droppable']"));
- action.click(By.xpath("/html/body/table/tbody/tr[4]/td/div/div/div/div/div/div/div/div[2]/div/div"));
- //selenium.click("//*/img[contains(@src,'telpfeil.gif')]");
-// return action.clickAndSendText(By.xpath("//span[@id='Trash']/.."));
+ public String expandTree(){
+ WebElement element = driver.findElement(By.xpath("//span[@id='lakis@ebs.gr.hasta luego']/../../div[1]"));
+ String res = element.getAttribute("style");
+ return res;
+ }
+
+ public void expandFolder(){
+ driver.findElement(By.xpath("//span[@id='lakis@ebs.gr.hasta luego']/../../div[1]")).click();
}
*/
package gr.ebs.gss.client.selenium.tests;
+import java.util.Set;
+
+import org.junit.After;
+import org.junit.Before;
import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.firefox.FirefoxDriver;
+
+public class GeneralPurposeUtils {
+
+ public ActionUtils action;
+
+ public WebDriver driver;
+
+ public String url = "http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/";
+
+ public String fileName = "darth_vader.jpg";
+
+ public String groupName = "Wookiees";
+
+ public String userName = "lakis@ebs.gr";
+
+ public String addUserName = "past@ebs.gr";
+
+ public String folderName = "Alderaan";
+
+ public String folderDestination = "Naboo";
+
+ public String newFolderName = "Mustafar";
+
+ /**
+ * FirefoxProfile profile = new FirefoxProfile();
+ *
+ */
+
+ @Before
+ public void setUp() throws Exception {
+
+ /**
+ * set up for using firefox add on in WebDriver
+ * driver = new FirefoxDriver(profile);
+ * profile.addExtension("","");
+ */
+
+ driver = new FirefoxDriver();
+
+ action = new ActionUtils(driver);
+
+ action.getUrl(url);
+
+ // Necessary delay in order all dom elements to be created
+ Thread.sleep(3000);
+ }
-public class GeneralPurposeUtils extends SetUpUtils{
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ action.quit();
+ }
+
+ public Set<String> getWindowHandles(){
+ return driver.getWindowHandles();
+ }
/**
* Click the top e.g file menu, edit menu etc
action.click(By.id(aUserName+ "." + aFolderName));
}
+ public void selectSubFolder(String aFolderName, String aSubFolderName){
+ action.click(By.id(aFolderName+ "." + aSubFolderName));
+ }
+
/**
* Select the Trash folder
*/
+++ /dev/null
-/*
- * Copyright 2011 Electronic Business Systems Ltd.
- *
- * This file is part of GSS.
- *
- * GSS is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * GSS is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with GSS. If not, see <http://www.gnu.org/licenses/>.
- */
-package gr.ebs.gss.client.selenium.tests;
-
-
-import java.util.Set;
-
-import org.junit.After;
-import org.junit.Before;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.firefox.FirefoxDriver;
-
-
-
-public class SetUpUtils {
-
- public ActionUtils action;
-
- public WebDriver driver;
-
- public String url = "http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/";
-
- public String fileName = "darth_vader.jpg";
-
- public String groupName = "Wookiees";
-
- public String userName = "lakis@ebs.gr";
-
- public String addUserName = "past@ebs.gr";
-
- public String folderName = "Alderaan";
-
- public String folderDestination = "Naboo";
-
- public String newFolderName = "Mustafar";
-
- /**
- * FirefoxProfile profile = new FirefoxProfile();
- *
- */
-
- @Before
- public void setUp() throws Exception {
-
- /**
- * set up for using firefox add on in WebDriver
- * driver = new FirefoxDriver(profile);
- * profile.addExtension("","");
- */
-
- driver = new FirefoxDriver();
-
- action = new ActionUtils(driver);
-
- action.getUrl(url);
-
- // Necessary delay in order all dom elements to be created
- Thread.sleep(3000);
- }
-
- /**
- * @throws java.lang.Exception
- */
- @After
- public void tearDown() throws Exception {
- action.quit();
- }
-
- public Set<String> getWindowHandles(){
- return driver.getWindowHandles();
- }
-
-}
}
-// /**
-// * Method that tries to expand the '+' symbol
-// * in order to reveal folder's containing folders
-// * @throws InterruptedException
-// */
-// @Test
-// public void testExpand() throws InterruptedException{
-//// selectTrash();
-// expandTree();
-// Thread.sleep(3000);
-//
-// }
+ /**
+ * Method that tries to expand the '+' symbol
+ * in order to reveal folder's containing folders
+ * @throws InterruptedException
+ */
+ @Test
+ public void testExpand() throws InterruptedException{
+ expandFolder();
+ System.out.println("ssss");
+ Thread.sleep(2000);
+ selectSubFolder("hasta luego", "abburido");
+ Thread.sleep(1000);
+ selectTopMenu("file");
+ Thread.sleep(1000);
+ selectAnOptionInTopMenu("file", "newFolder");
+
+ Thread.sleep(1000);
+
+ typeInFolderPropertiesDialog("textBox.name", "feliz");
+ Thread.sleep(1000);
+ //Submit
+ selectElementFromFolderPropertiesDialog("button.ok");
+
+ Thread.sleep(4000);
+
+ }
// @Test
public void testCutFolder(){