2 * Copyright 2011 Electronic Business Systems Ltd.
4 * This file is part of GSS.
6 * GSS is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * GSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with GSS. If not, see <http://www.gnu.org/licenses/>.
19 package gr.ebs.gss.client.selenium.webDriver;
23 import org.apache.commons.logging.Log;
24 import org.apache.commons.logging.LogFactory;
25 import org.openqa.selenium.By;
26 import org.openqa.selenium.WebDriver;
30 public class NewFolder {
32 private static Log logger = LogFactory.getLog(NewFolder.class);
34 private ActionFactory action;
41 public NewFolder(ActionFactory anAction, WebDriver aDriver){
43 action = new ActionFactory(aDriver);
46 public void makeNewFolder(String aFolderName){
49 //Click the home folder
50 action.click(By.id("past@ebs.gr"));
52 //Click the top file menu
53 action.click(By.id("topMenu.file"));
55 //Click the New Folder option from the file menu
56 action.click(By.id("topMenu.file.newFolder"));
58 //In the popup dialog click on the Name textBox and type the folder name
59 action.type(By.id("folderPropertiesDialog.textBox.name"), aFolderName);
62 action.click(By.id("folderPropertiesDialog.button.ok"));
65 logger.debug("The creation of a new folder didn't succeeded");
70 public String checkNewFolder(String aFolderName){
71 String res = action.getText(By.id("past@ebs.gr." + aFolderName));
73 return ("Creation of the folder " + aFolderName + "FAILED!!");
75 return ("SUCCESSful creation of " + res);