Revision bd2b3100

b/src/gr/ebs/gss/client/FilePropertiesDialog.java
136 136
		final HorizontalPanel vPanel2 = new HorizontalPanel();
137 137

  
138 138
		versioned.setValue(file.isVersioned());
139
		versioned.getElement().setId("filePropertiesDialog.versioned");
139 140
		inner.add(generalPanel, "General");
140 141
		inner.add(permPanel, "Sharing");
141 142
		inner.add(verPanel, "Versions");
b/src/gr/ebs/gss/client/FolderContextMenu.java
76 76
		setAnimationEnabled(true);
77 77
		images = newImages;
78 78

  
79
		pasteItem = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(this));
80
		pasteItem.getElement().setId("folderContextMenu.paste");
79
		pasteItem = new MenuItem("<span id = 'folderContextMenu.paste'>" + AbstractImagePrototype.create(newImages.paste()).getHTML() + "&nbsp;Paste</span>", true, new PasteCommand(this));
81 80
		MenuBar contextMenu = new MenuBar(true);
82 81
		
83 82
		
......
87 86

  
88 87
		if(selectedItem != null)
89 88
			if(selectedItem instanceof MyFolderResource){
90
				MenuItem newFolder = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + "&nbsp;New Folder</span>", true, new NewFolderCommand(this, images));
91
				newFolder.getElement().setId("folderContextMenu.newFolder");
89
				MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + "&nbsp;New Folder</span>", true, new NewFolderCommand(this, images));
92 90
				contextMenu.addItem(newFolder);
93 91
				
94
				MenuItem upload = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
95
				upload.getElement().setId("folderContextMenu.upload");
92
				MenuItem upload = new MenuItem("<span id = 'folderContextMenu.upload'>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
96 93
				contextMenu.addItem(upload);
97 94
								
98 95
				boolean notRootFolder = !GSS.get().getTreeView().getMyFolders().equals(selectedItem);
99 96
				if (notRootFolder) {
100 97
					// do not show the copy & cut option for the user's root folder					
101
					MenuItem cut = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
102
					cut.getElement().setId("folderContextMenu.cut");
98
					MenuItem cut = new MenuItem("<span id = 'folderContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
103 99
					contextMenu.addItem(cut);
104 100
					
105
					MenuItem copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));
106
					copy.getElement().setId("folderContextMenu.copy");
101
					MenuItem copy = new MenuItem("<span id = 'folderContextMenu.copy'>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));					
107 102
					contextMenu.addItem(copy);
108 103
					
109 104
				}
110 105
				contextMenu.addItem(pasteItem);
111 106
				if (notRootFolder) {
112 107
					// do not show delete options for the user's root folder
113
					MenuItem moveToTrash = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));
114
					moveToTrash.getElement().setId("folderContextMenu.moveToTrash");
108
					MenuItem moveToTrash = new MenuItem("<span id = 'folderContextMenu.moveToTrash'>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));					
115 109
					contextMenu.addItem(moveToTrash);
116 110
					
117
					MenuItem delete = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
118
					delete.getElement().setId("folderContextMenu.delete");
111
					MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
119 112
					contextMenu.addItem(delete);					
120 113
				}
121 114
				
122
				MenuItem refresh = new MenuItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
123
				refresh.getElement().setId("folderContextMenu.refresh");
115
				MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.refresh'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
124 116
				contextMenu.addItem(refresh);
125 117
				
126
				MenuItem sharing = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
127
				sharing.getElement().setId("folderContextMenu.sharing");
118
				MenuItem sharing = new MenuItem("<span id = 'folderContextMenu.sharing'>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
128 119
				contextMenu.addItem(sharing);
129 120
				
130
				MenuItem properties = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, newImages, 0));
131
				properties.getElement().setId("folderContextMenu.properties");
121
				MenuItem properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, newImages, 0));
132 122
				contextMenu.addItem(properties);		
133 123
			}
134 124
		
135 125
			if(selectedItem instanceof SharedFolderResource){
136
				MenuItem newFolder = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + "&nbsp;New Folder</span>", true, new NewFolderCommand(this, images));
137
				newFolder.getElement().setId("folderContextMenu.newFolder");
126
				MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + "&nbsp;New Folder</span>", true, new NewFolderCommand(this, images));
138 127
				contextMenu.addItem(newFolder);
139 128
				
140
				MenuItem upload = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
141
				upload.getElement().setId("folderContextMenu.upload");
129
				MenuItem upload = new MenuItem("<span id = 'folderContextMenu.upload'>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
142 130
				contextMenu.addItem(upload);
143 131
				
144
				MenuItem cut = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
145
				cut.getElement().setId("folderContextMenu.cut");
132
				MenuItem cut = new MenuItem("<span id = 'folderContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
146 133
				contextMenu.addItem(cut);
147 134
				
148
				MenuItem copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));
149
				copy.getElement().setId("folderContextMenu.copy");
135
				MenuItem copy = new MenuItem("<span id = 'folderContextMenu.copy'>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));
150 136
				contextMenu.addItem(copy);
151 137
				
152 138
				contextMenu.addItem(pasteItem);
153 139
				
154
				MenuItem moveToTrash = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));
155
				moveToTrash.getElement().setId("folderContextMenu.moveToTrash");
140
				MenuItem moveToTrash = new MenuItem("<span id = 'folderContextMenu.moveToTrash'>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));
156 141
				contextMenu.addItem(moveToTrash);
157 142
				
158
				MenuItem delete = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
159
				delete.getElement().setId("folderContextMenu.delete");
143
				MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
160 144
				contextMenu.addItem(delete);
161 145

  
162
				MenuItem refresh = new MenuItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
163
				refresh.getElement().setId("folderContextMenu.refresh");
146
				MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.refresh'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
164 147
				contextMenu.addItem(refresh);
165 148
				
166
				MenuItem sharing = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
167
				sharing.getElement().setId("folderContextMenu.sharing");
149
				MenuItem sharing = new MenuItem("<span id = 'folderContextMenu.sharing'>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
168 150
				contextMenu.addItem(sharing);
169 151
				
170
				MenuItem properties = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, newImages, 0));
171
				properties.getElement().setId("folderContextMenu.properties");
152
				MenuItem properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, newImages, 0));
172 153
				contextMenu.addItem(properties);
173 154
				
174 155
			}
175 156
			if(selectedItem instanceof TrashFolderResource){
176
				MenuItem restore = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Restore folder and contents</span>", true, new RestoreTrashCommand(this));
177
				restore.getElement().setId("folderContextMenu.restore");
157
				MenuItem restore = new MenuItem("<span id = 'folderContextMenu.restore'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Restore folder and contents</span>", true, new RestoreTrashCommand(this));
178 158
				contextMenu.addItem(restore);
179 159
				
180
				MenuItem delete = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
181
				delete.getElement().setId("folderContextMenu.delete");
160
				MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
182 161
				contextMenu.addItem(delete);
183 162
				
184
				MenuItem refresh = new MenuItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
185
				refresh.getElement().setId("folderContextMenu.refresh");
163
				MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.refresh'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
186 164
				contextMenu.addItem(refresh);
187 165
				
188 166
			}
189 167
			if(selectedItem instanceof OthersFolderResource){				
190
				MenuItem newFolder = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + "&nbsp;New Folder</span>", true, new NewFolderCommand(this, images));
191
				newFolder.getElement().setId("folderContextMenu.newFolder");
168
				MenuItem newFolder = new MenuItem("<span id = 'folderContextMenu.newFolder'>" + AbstractImagePrototype.create(newImages.folderNew()).getHTML() + "&nbsp;New Folder</span>", true, new NewFolderCommand(this, images));
192 169
				contextMenu.addItem(newFolder);
193 170

  
194
				MenuItem upload = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
195
				upload.getElement().setId("folderContextMenu.upload");
171
				MenuItem upload = new MenuItem("<span id ='folderContextMenu.upload'>" + AbstractImagePrototype.create(newImages.fileUpdate()).getHTML() + "&nbsp;Upload</span>", true, new UploadFileCommand(this));
196 172
				contextMenu.addItem(upload);
197 173
				
198
				MenuItem cut = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
199
				cut.getElement().setId("folderContextMenu.cut");
174
				MenuItem cut = new MenuItem("<span id = 'folderContextMenu.cut'>" + AbstractImagePrototype.create(newImages.cut()).getHTML() + "&nbsp;Cut</span>", true, new CutCommand(this));
200 175
				contextMenu.addItem(cut);
201 176
				
202
				MenuItem copy = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));
203
				copy.getElement().setId("folderContextMenu.copy");
177
				MenuItem copy = new MenuItem("<span id = 'folderContextMenu.copy'>" + AbstractImagePrototype.create(newImages.copy()).getHTML() + "&nbsp;Copy</span>", true, new CopyCommand(this));
204 178
				contextMenu.addItem(copy);
205 179
				
206 180
				contextMenu.addItem(pasteItem);
207 181
				
208
				MenuItem moveToTrash = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));
209
				moveToTrash.getElement().setId("folderContextMenu.moveToTrash");
182
				MenuItem moveToTrash = new MenuItem("<span id = 'folderContextMenu.moveToTrash'>" + AbstractImagePrototype.create(newImages.emptyTrash()).getHTML() + "&nbsp;Move to Trash</span>", true, new ToTrashCommand(this));
210 183
				contextMenu.addItem(moveToTrash);
211 184
				
212
				MenuItem delete = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
213
				delete.getElement().setId("folderContextMenu.delete");
185
				MenuItem delete = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Delete</span>", true, new DeleteCommand(this, newImages));
214 186
				contextMenu.addItem(delete);
215 187

  
216
				MenuItem refresh = new MenuItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
217
				refresh.getElement().setId("folderContextMenu.delete");
188
				MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.delete'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
218 189
				contextMenu.addItem(refresh);
219 190
				
220
				MenuItem sharing = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
221
				sharing.getElement().setId("folderContextMenu.sharing");
191
				MenuItem sharing = new MenuItem("<span id = 'folderContextMenu.sharing'>" + AbstractImagePrototype.create(newImages.sharing()).getHTML() + "&nbsp;Sharing</span>", true, new PropertiesCommand(this, newImages, 1));
222 192
				contextMenu.addItem(sharing);
223 193
				
224
				MenuItem properties = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, newImages, 0));
225
				properties.getElement().setId("folderContextMenu.properties");
194
				MenuItem properties = new MenuItem("<span id = 'folderContextMenu.properties'>" + AbstractImagePrototype.create(newImages.viewText()).getHTML() + "&nbsp;Properties</span>", true, new PropertiesCommand(this, newImages, 0));
226 195
				contextMenu.addItem(properties);
227 196
				
228 197
			}
229 198
			if(selectedItem instanceof TrashResource){
230
				MenuItem restore = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Restore Trash</span>", true, new RestoreTrashCommand(this));
231
				restore.getElement().setId("folderContextMenu.restore");
199
				MenuItem restore = new MenuItem("<span id ='folderContextMenu.restore'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Restore Trash</span>", true, new RestoreTrashCommand(this));
232 200
				contextMenu.addItem(restore);
233 201
				
234
				MenuItem emptyTrash = new MenuItem("<span>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Empty Trash</span>", true, new EmptyTrashCommand(this));
235
				emptyTrash.getElement().setId("folderContextMenu.emptyTrash");
202
				MenuItem emptyTrash = new MenuItem("<span id = 'folderContextMenu.emptyTrash'>" + AbstractImagePrototype.create(newImages.delete()).getHTML() + "&nbsp;Empty Trash</span>", true, new EmptyTrashCommand(this));
236 203
				contextMenu.addItem(emptyTrash);
237 204
				
238
				MenuItem refresh = new MenuItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
239
				refresh.getElement().setId("folderContextMenu.refresh");
205
				MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.refresh'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
240 206
				contextMenu.addItem(refresh);
241 207
				
242 208
			}
243 209
			if(selectedItem instanceof SharedResource || selectedItem instanceof OthersResource || selectedItem instanceof OtherUserResource){
244
				MenuItem refresh = new MenuItem("<span>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
245
				refresh.getElement().setId("folderContextMenu.refresh");
210
				MenuItem refresh = new MenuItem("<span id = 'folderContextMenu.refresh'>" + AbstractImagePrototype.create(images.refresh()).getHTML() + "&nbsp;Refresh</span>", true, new RefreshCommand(this, images));
246 211
				contextMenu.addItem(refresh);
247 212
				
248 213
			}
b/src/gr/ebs/gss/client/Groups.java
124 124
		tree.addOpenHandler(this);
125 125
		tree.setAnimationEnabled(true);
126 126
		initWidget(tree);
127
		this.getElement().setAttribute("id", "CreativeFilesPanel");
127 128
		setStylePrimaryName("gss-Groups");
128 129
		sinkEvents(Event.ONCONTEXTMENU);
129 130
		sinkEvents(Event.ONMOUSEUP);
......
151 152
						for (int i = 0; i < groupList.size(); i++) {
152 153
							final TreeItem item = new TreeItem();
153 154
							item.setWidget(imageItemHTML(images.groupImage(), groupList.get(i).getName(),item));
154
							item.setUserObject(groupList.get(i));
155
							item.setUserObject(groupList.get(i));							
155 156
							tree.addItem(item);
156 157
							updateUsers(item);
157 158
						}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.file;
20

  
21
import gr.ebs.gss.client.selenium.folder.ActionUtils;
22
import gr.ebs.gss.client.selenium.folder.FolderUtils;
23

  
24
import org.junit.After;
25
import org.junit.Before;
26
import org.openqa.selenium.By;
27
import org.openqa.selenium.WebDriver;
28
import org.openqa.selenium.firefox.FirefoxDriver;
29

  
30

  
31
public class FileUtils {
32
	
33
	protected ActionUtils action;
34
	
35
	protected WebDriver driver;
36
	
37
	protected String url = "http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/";
38
	
39
	protected String fileName = "darth_vader.jpg";
40
	
41
	protected String groupName = "Wookiees";
42
	
43
	protected String userName = "lakis@ebs.gr";
44
	
45
	protected String addUserName = "past@ebs.gr";
46
		
47
	
48
	protected String folderName = "Alderaan";
49

  
50
	/**
51
	 * @throws java.lang.Exception
52
	 */
53
	@Before
54
	public void setUp() throws Exception {
55
		
56
		driver = new FirefoxDriver();
57
		
58
		action = new ActionUtils(driver);
59
		
60
		action.getUrl(url);
61
		
62
		// Necessary delay in order all dom elements to be created
63
		Thread.sleep(3000);
64
	}
65

  
66
	
67
	@After
68
	public void tearDown() throws Exception {
69
		action.quit();
70
	}
71
	
72
	protected void clickAFile(String aFileName){		
73
		action.click(By.id("fileList."+ aFileName));
74
	}
75
	
76
	protected void selectFileMenu() {
77
		//Click the top file menu
78
		action.click(By.id("topMenu.file"));		
79
				
80
	}
81
	
82
	protected void selectAnOptionFromFileMenu(String anOption) {
83
		
84
		//Click the New Folder option from the file menu
85
		action.click(By.id("topMenu.file."+ anOption));
86
		
87
	}
88
	
89
	protected void selectAnOptionFromEditMenu(String anOption) {
90
		
91
		//Click the New Folder option from the file menu
92
		action.click(By.id("topMenu.edit."+ anOption));
93
		
94
	}
95
	
96
	protected void selectConfirmation(String anOption){
97
		
98
		action.click(By.id("confirmation."+ anOption));
99
		
100
	}
101
	
102
	/**
103
	 * TODO: Check what's going on with the method scope in the FolderUtils 
104
	 * 
105
	 * @param aUserName
106
	 * @param aFolderName
107
	 */
108
	public void selectFolderBelowHome(String aUserName, String aFolderName){
109
		action.click(By.id(aUserName+ "." + aFolderName));
110
	}
111
	
112
	protected void rightClickOnFile(String aFileName){
113
		action.sendRightClick(By.id("fileList." + aFileName));
114
		
115
	}
116
	
117
	protected void selectFileContextMenuOption(String anOption){
118
		action.click(By.id("fileContextMenu." + anOption));
119
	}
120
	
121
	
122
	/**
123
	 * TODO: Download a file below in a folder
124
	 * > select a file
125
	 * > select File > 'Download'
126
	 * > save file from the popup window to your hdd
127
	 * 	
128
	 */
129
	
130
	protected void download() throws InterruptedException{
131
		selectFileMenu();
132
		
133
		Thread.sleep(1000);
134
		
135
		selectAnOptionFromFileMenu("download");
136
		
137
		selectConfirmation("ok");
138
	}
139

  
140
	
141
	/** TODO: Save As
142
	 * **** This action performs the same results to the above 'Download' option
143
	 */
144
	 
145
	/** TODO:Empty Trash
146
	 * > select a file
147
	 * > select File > 'Empty Trash' 
148
	 * *** Notice: There is no confirmation before performing this action
149
	 */
150
	   
151

  
152
	/** TODO:. Refresh
153
	 * > select a file
154
	 * > select File > 'Refresh'
155
	 */
156
	
157
	/**
158
	 * TODO: . Cut file
159
	 * > select a file
160
	 * > select Edit > 'Cut'
161
	 * > select a destination folder
162
	 * > click Edit > Paste on the destination folder 
163
	 */
164
	
165
	/** TODO: . Copy file
166
	 * > select a file
167
	 * > select Edit > 'Copy'
168
	 * > select a destination folder
169
	 * > click Edit > 'Paste' on the destination folder
170
	 * 
171
	 */
172
	   
173
	/** TODO: . Move to Trash
174
	 * > select a file
175
	 * > select Edit > 'Move to Trash'
176
	 * > select Trash folder and your file is in the Trash
177
	 */
178
	/**. Delete
179
	 * > select a file
180
	 * > select Edit > 'Move to Trash'
181
	 * > click Delete to confirm
182
	 * */
183

  
184
	/** TODO:. Select All
185
	 * > select a file
186
	 * > select Edit > 'Select All' this action results to select all files that are inside home folder
187
	 */
188
	   
189
	/** TODO:. Unselect All
190
	 * > select a file
191
	 * > select Edit > 'Unselect All'     this action results to unselect all files that are inside home folder
192
	 */
193

  
194
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.file;
20

  
21
import org.junit.Test;
22

  
23

  
24

  
25

  
26
public class TestFileBasics extends FileUtils{
27
	
28
	@Test
29
	public void testClickAFile(){
30
		selectFolderBelowHome(userName, folderName);
31
		clickAFile(fileName);
32
		
33
		rightClickOnFile(fileName);
34
		
35
		selectFileContextMenuOption("refresh");
36
	}
37
	
38
	
39
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.file;
20

  
21

  
22

  
23
/**
24
 * @author natasa
25
 *
26
 */
27
public class TestFileProperties extends TestFileBasics{
28
	
29
	/** TODO:. Rename a file
30
	 * > select a file
31
	 * > select File > 'Properties'
32
	 * > type a new file name in the Name input box
33
	 * > click 'Ok'
34
	 */
35
	   
36
	/** TODO:. Add a Tag to a file
37
	 * > select a file
38
	 * > select File > 'Properties'
39
	 * > type a word that represents a tag to the tag input box
40
	 * > click 'Ok'
41
	 */	        
42
	   
43
	/** TODO:. Add a Version to a file
44
	 * > select a file
45
	 * > select File > 'Properties'
46
	 * > select the 'Versions' tab
47
	 * > click on the Versioned check box
48
	 * > click 'Ok'
49
	 */
50
	
51
	/** TODO: 
52
	 * . Add a new version in an already versioned file
53
	 */
54
	
55
	/** TODO:. Remove a Version from a file
56
	 * 
57
	 */
58
	
59
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.file;
20

  
21

  
22

  
23
/**
24
 * @author natasa
25
 *
26
 */
27
public class TestFileSharing extends TestFileBasics {
28

  
29
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.folder;
20

  
21
import org.openqa.selenium.By;
22
import org.openqa.selenium.Keys;
23
import org.openqa.selenium.WebDriver;
24
import org.openqa.selenium.WebElement;
25

  
26

  
27
public class ActionUtils {
28
	
29
	private final WebDriver driver;
30

  
31
	public ActionUtils(WebDriver aDriver) {
32
		this.driver = aDriver;
33
		
34
	}
35
	
36
	/**
37
	 * Opens the application url and wait some secs
38
	 * @param aUrl
39
	 */
40
	
41
	public void getUrl(String aUrl){
42
		driver.get(aUrl);		
43
				
44
	}
45
	
46
	public void click(By locator) {
47
		driver.findElement(locator).click();		
48
		
49
	}
50
	
51
	public String clickAndSendText(By locator) {
52
		WebElement elem = driver.findElement(locator);
53
		elem.click();		
54
		return elem.getAttribute("style");
55
		
56
	}
57
	public void submit(By locator) {
58
		driver.findElement(locator).submit();		
59
				
60
	}
61
	/**
62
	 * Type something into an input field. WebDriver doesn't normally clear these
63
	 * before typing, so this method does that first. It also sends a return key
64
	 * to move the focus out of the element.
65
	 */
66
	public void type(By locator, String text) {
67
		WebElement element = driver.findElement(locator);
68
		element.clear();
69
		//element.sendKeys(text + "\n");
70
		element.sendKeys(text);
71
		
72
	}
73
	
74
	public void sendRightClick(By locator) {
75
		WebElement element = driver.findElement(locator);
76
		element.sendKeys(Keys.chord(Keys.SHIFT,Keys.F10));			
77

  
78
	}
79
	
80
	public String getText(By locator){
81
		WebElement element = driver.findElement(locator);
82
		return element.getText();
83
		
84
	}
85
	
86
	public void quit() throws InterruptedException{
87
		Thread.sleep(2000);
88
		driver.quit();			
89
				
90
	}
91
	
92
	public void toggle(By locator){
93
		WebElement element = driver.findElement(locator);
94
		element.toggle();
95
	}
96

  
97
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.folder;
20

  
21
import org.junit.After;
22
import org.junit.Before;
23
import org.openqa.selenium.By;
24
import org.openqa.selenium.WebDriver;
25
import org.openqa.selenium.firefox.FirefoxDriver;
26

  
27

  
28

  
29
/**
30
 * @author natasa
31
 *
32
 */
33
public class FolderUtils {
34
	
35
	public ActionUtils action;
36
	
37
	public WebDriver driver;
38
	
39
	protected String url = "http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/";
40
	
41
	public String folderName = "Alderaan";
42
	
43
	public String userName = "lakis@ebs.gr";
44
		//"past@ebs.gr";
45
	
46
	protected String folderDestination = "Naboo";
47
	
48
	protected String newFolderName = "Mustafar";
49

  
50
	/**
51
	 * Initialize the driver, the actionUtils, the application's url
52
	 * @throws java.lang.Exception
53
	 */
54
	@Before
55
	public void setUp() throws Exception {
56
		
57
		driver = new FirefoxDriver();
58
		
59
		action = new ActionUtils(driver);
60
		
61
		action.getUrl(url);
62
		
63
		// Necessary delay in order all dom elements to be created
64
		Thread.sleep(3000);
65
	}
66

  
67
	/**
68
	 * Quit the driver
69
	 * @throws java.lang.Exception
70
	 */
71
	@After
72
	public void tearDown() throws Exception {
73
		action.quit();
74
	}
75
	
76
	/**
77
	 * Select the user's home folder
78
	 * 
79
	 * @param aUserName
80
	 */
81
	protected void selectHomeFolder(String aUserName){
82
		action.click(By.id(aUserName));
83
	}
84
	
85
	/**
86
	 * Select any folder below the user's home folder
87
	 * 
88
	 * @param aUserName
89
	 * @param aFolderName
90
	 */
91
	public void selectFolderBelowHome(String aUserName, String aFolderName){
92
		action.click(By.id(aUserName+ "." + aFolderName));
93
	}
94
	
95
	/**
96
	 * Select the Trash folder
97
	 */
98
	protected void selectTrash(){
99
		action.click(By.id("Trash"));		
100
	}
101
	
102
	/**
103
	 * Select the My Shared folder
104
	 */
105
	protected void selectMyShared(){
106
		action.click(By.id("My Shared"));
107
	}
108
	
109
	/**
110
	 * Select the Other's Shared folder
111
	 */
112
	protected void selectOthersShared(){
113
		action.click(By.id("others"));
114
	}
115
	
116
	protected void expandTree(){
117
//		ERROR: Compound class names are not supported. Consider searching for one class name and filtering the results.
118
//		action.click(By.className("GK31MSKBDF GK31MSKBLF"));
119
//		action.click(By.xpath("//span[@id='Trash']/../../.."));
120
//		action.click(By.xpath("//div[@id='']/img"));
121
//		action.click(By.xpath("//span[@id='Trash']/.."));
122
//		action.click(By.xpath("ancestor:://span[@id='Trash']"));// Error not legal expression
123
//		action.click(By.xpath("//div[@class='GK31MSKBCF GK31MSKBKF gwtQuery-draggable gwtQuery-droppable']"));
124
		action.click(By.xpath("/html/body/table/tbody/tr[4]/td/div/div/div/div/div/div/div/div[2]/div/div"));
125
		//selenium.click("//*/img[contains(@src,'telpfeil.gif')]");
126
//		return action.clickAndSendText(By.xpath("//span[@id='Trash']/.."));
127
		
128
	}
129
	
130
	
131
	/**
132
	 * Create a new folder under the root folder
133
	 * @param aFolderName
134
	 * @throws InterruptedException 
135
	 */	
136
	protected void makeNewFolder(String aUserName, String aFolderName) throws InterruptedException{		
137
		//Click the home folder
138
		selectHomeFolder(aUserName);
139
				
140
		//Click the top file menu
141
		action.click(By.id("topMenu.file"));		
142
		
143
		Thread.sleep(1000);
144
		
145
		//Click the New Folder option from the file menu
146
		action.click(By.id("topMenu.file.newFolder"));
147
		
148
		Thread.sleep(1000);
149
		
150
		//In the popup dialog click on the Name textBox and type the folder name		
151
		action.type(By.id("folderPropertiesDialog.textBox.name"), aFolderName);
152
			
153
		//Submit 
154
		action.click(By.id("folderPropertiesDialog.button.ok"));			
155
		
156
	}
157
	
158
	/**
159
	 * Delete a folder with the given folderName 
160
	 * that lies below the root folder 
161
	 * 
162
	 * @param aFolderName
163
	 * @throws InterruptedException 
164
	 */	
165
	protected void deleteFolder(String aUserName, String aFolderName) throws InterruptedException{
166
		//Click the home folder		
167
		selectFolderBelowHome(aUserName, aFolderName);
168
		
169
		//Click top edit menu
170
		action.click(By.id("topMenu.edit"));
171
		
172
					
173
		//Click move to trash option
174
		action.click(By.id("topMenu.edit.delete"));
175
		Thread.sleep(1000);
176
		
177
		//Click ok button in the confirmation dialog box
178
		action.click(By.id("confirmation.ok"));
179
	
180
	}
181
	/**
182
	 * Moving a folder which lies under the root folder to trash folder
183
	 * 
184
	 * @param aFolderName
185
	 */	
186
	protected void moveToTrash(String aUserName, String aFolderName){
187
		//Click the home folder
188
		selectFolderBelowHome(aUserName, aFolderName);
189
		
190
		//Click top edit menu
191
		action.click(By.id("topMenu.edit"));
192
		
193
		//Click move to trash option
194
		action.click(By.id("topMenu.edit.moveToTrash"));
195
		
196
	}
197
	
198
	/**
199
	 * Emptying the trash folder using right click action
200
	 * 
201
	 * @throws InterruptedException
202
	 */	
203
	protected void emptyTrash() throws InterruptedException{
204
		
205
		selectTrash();
206
		
207
		Thread.sleep(1000);
208
		
209
		action.click(By.id("topMenu.file"));
210
		
211
		Thread.sleep(1000);
212
		
213
		action.click(By.id("topMenu.file.emptyTrash"));
214

  
215
		/**
216
		 * TODO: Examine right click on a folder
217
		 */
218
		
219
//		action.sendRightClick(By.id("Trash"));
220
		
221
		//Select emptyTrash from context menu
222
//		action.click(By.id("folderContextMenu.emptyTrash"));
223

  
224
	}
225
	
226
	protected void refresh(String aUserName, String aFolderName){		
227
		//Click a folder
228
		selectFolderBelowHome(aUserName, aFolderName);
229
		
230
		//Click top edit menu
231
		action.click(By.id("topMenu.file"));
232
		
233
		//Click move to trash option
234
		action.click(By.id("topMenu.file.refresh"));
235
		
236
	}
237
	
238
	//TODO: upload file to a folder
239
	protected void upload(){
240
		
241
	}
242
	
243
	/**
244
	 * Method that cuts a folder below home folder
245
	 * using the top Edit menu
246
	 * @param aUserName
247
	 */
248
	protected void cutFolder(String aUserName, String aFolderName){
249
		
250
		//Click a folder
251
		selectFolderBelowHome(aUserName, aFolderName);
252
				
253
		//Click the top file menu
254
		action.click(By.id("topMenu.edit"));		
255
		
256
		//Click the New Folder option from the file menu
257
		action.click(By.id("topMenu.edit.cut"));
258
		
259
	}
260
	
261
	/**
262
	 * Method that copies a folder name 
263
	 * @param aUserName
264
	 * @param aFolderName
265
	 */
266
	protected void copy(String aUserName, String aFolderName){
267
		//Click a folder
268
		selectFolderBelowHome(aUserName, aFolderName);
269
				
270
		//Click the top file menu
271
		action.click(By.id("topMenu.edit"));		
272
		
273
		//Click the New Folder option from the file menu
274
		action.click(By.id("topMenu.edit.copy"));
275
		
276
	}
277
	
278
	/**
279
	 * Method that pastes a folder of a user using @param aUserName
280
	 * to a	@param aFolderDestination
281
	 */
282
	protected void paste(String aUserName, String aFolderDestination){
283
		//Click on the folder destination which is below home folder
284
		selectFolderBelowHome(aUserName, aFolderDestination);
285
		
286
		//Click the top file menu
287
		action.click(By.id("topMenu.edit"));		
288
		
289
		//Click the New Folder option from the file menu
290
		action.click(By.id("topMenu.edit.paste"));
291
	}
292
	
293
	/**
294
	 * Method that clicks on the folder and the from the top menu File > Properties
295
	 * 
296
	 * @param aUserName
297
	 * @param aFolderName
298
	 * @throws InterruptedException
299
	 */
300
	protected void clickFolderProperties(String aUserName, String aFolderName) throws InterruptedException{
301
		//Click on a folder 
302
		selectFolderBelowHome(aUserName, aFolderName);
303
				
304
		action.click(By.id("topMenu.file"));
305
		Thread.sleep(1000);
306
		action.click(By.id("topMenu.file.properties"));
307
		Thread.sleep(1000);
308
	}
309
	
310
	/**
311
	 * Methods thats sends right click to the selected folder
312
	 * @param aUserName
313
	 * @param aFolderName
314
	 */
315
	
316
	protected void rightClickOnFolder(String aUserName, String aFolderName){
317
		//Click on a folder 
318
		selectFolderBelowHome(aUserName, aFolderName);
319
		
320
		action.sendRightClick(By.id(aUserName+ "." + aFolderName));
321
		
322
	}
323
	
324
	protected void selectFolderContextMenuOption(String anOption){
325
		action.click(By.id("folderContextMenu." + anOption));
326
	}
327
	
328

  
329

  
330
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.folder;
20

  
21

  
22
import junit.framework.Assert;
23

  
24
import org.junit.After;
25
import org.junit.Before;
26
import org.junit.Test;
27
import org.openqa.selenium.By;
28
import org.openqa.selenium.WebDriver;
29
import org.openqa.selenium.firefox.FirefoxDriver;
30

  
31

  
32
public class TestFolderBasics extends FolderUtils{
33
	
34
/**
35
 *  ---------------------------------------Tests ------------------------------------------------
36
 * 
37
 */
38
	
39
	@Test
40
	public void testMakeNewFolder() throws InterruptedException{
41
		
42
		//Create the folder with the given folderName
43
		makeNewFolder(userName, folderName);
44
//		makeNewFolder(userName, folderDestination);
45
		
46
		//Necessary delay 
47
		Thread.sleep(2000);
48
				
49
		Assert.assertEquals(folderName, action.getText(By.id(userName + "." + folderName)));	
50
						
51
	}
52
	
53
	@Test (expected=org.openqa.selenium.NoSuchElementException.class)
54
	public void deleteFolder() throws InterruptedException{
55
	
56
		//Delete the folder
57
		deleteFolder(userName, folderName);
58
		
59
		//the test is successful if that condition fails
60
		Assert.assertEquals(folderName, action.getText(By.id(userName + "." + folderName)));	
61
						
62
	}
63
    
64
//	@Test
65
	public void testMoveToTrash(){
66
		//Select the desired folder
67
		selectFolderBelowHome(userName,folderName);
68

  
69
		//Move to Trash 
70
		moveToTrash(userName, folderName);
71
		
72
		/**
73
		 * TODO: In order to confirm that 
74
		 * the new folder exists in Trash folder
75
		 * trash folder should be expanded first 
76
		 * and then select the element
77
		 */
78
		
79
	}
80
	
81
//	@Test
82
	public void testEmptyTrash() throws InterruptedException{
83
			
84
		emptyTrash();
85
		
86
		/**
87
		 * TODO: Confirm that the trash folder is empty 
88
		 */
89
		
90
	}
91
	
92
//	/**
93
//	 * Method that tries to expand the '+' symbol 
94
//	 * in order to reveal folder's containing folders 
95
//	 * @throws InterruptedException 
96
//	 */	
97
//	@Test
98
//	public void testExpand() throws InterruptedException{
99
////		selectTrash();
100
//		expandTree();		
101
//		Thread.sleep(3000);
102
//				
103
//	}
104
	
105
//	@Test
106
	public void testCutFolder(){
107
		cutFolder(userName, folderName);
108
		
109
		paste(userName, folderDestination);
110
		
111
		/**TODO: In order to confirm successful paste of the folderName to folderDestination
112
		 * we should expand folderDestination and see if the folder name is in it's sub folders
113
		 */
114
		
115
	}
116
	
117
//	@Test
118
	public void testCopyNPasteFolder(){
119
		copy(userName, folderName);
120
		
121
		paste(userName, folderDestination);
122
		
123
		/**TODO: In order to confirm successful paste of the folderName to folderDestination
124
		 * we should expand folderDestination and see if the folder name is in it's sub folders
125
		 */
126
		
127
	}
128
	
129
//	@Test
130
	public void testRenameFolder() throws InterruptedException{
131
		//select the folder you want to rename and click Properties
132
		//clickFolderProperties(userName, folderName);
133
		clickFolderProperties(userName, newFolderName);
134
		
135
		//in the input box add the new folderName		
136
		action.type(By.id("folderPropertiesDialog.textBox.name"), newFolderName);
137
		
138
		//click OK
139
		action.click(By.id("folderPropertiesDialog.button.ok"));
140
		
141
		Thread.sleep(2000);
142
		
143
		Assert.assertEquals(newFolderName, action.getText(By.id(userName + "." + newFolderName)));
144
		
145
	}
146
	/**
147
	 * TODO: Make it run!!!!
148
	 * @throws InterruptedException
149
	 */
150
//	@Test
151
	public void testRightClickOnFolder() throws InterruptedException{
152
		rightClickOnFolder(userName, folderName);
153
		
154
		Thread.sleep(500);
155
		
156
		selectFolderContextMenuOption("refresh");
157
		Thread.sleep(1000);
158
	}
159
	
160

  
161
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.folder;
20

  
21

  
22
import org.junit.Test;
23
import org.openqa.selenium.By;
24

  
25

  
26

  
27
public class TestFolderSharing extends TestFolderBasics {
28
	
29
	protected String addUserName = "lakis@ebs.gr";
30

  
31
	protected void clickFolderSharing(String aUserName, String aFolderName) throws InterruptedException{
32
		//Click on a folder 
33
		selectFolderBelowHome(aUserName, aFolderName);
34
				
35
		action.click(By.id("topMenu.file"));
36
		Thread.sleep(1000);
37
		action.click(By.id("topMenu.file.sharing"));
38
		Thread.sleep(1000);
39
	}
40
	
41
	@Test
42
	protected void testAddGroupToPermissionFolder() throws InterruptedException{
43
		
44
		//Click sharing option for the folder @folderName
45
		clickFolderSharing(userName, folderName);
46
		
47
		//Click the "Add Group" option in the FolderProperties dialog box
48
		action.click(By.id("folderPropertiesDialog.button.addGroup"));
49
		
50
		//Select from drop down menu the preferred group
51
		//TODO: add an id in the elements in the dropDown menu in order this click in the droppDown to work
52
//		action.click(By.id("addPermission.dropDown"));
53
		
54
		//Add a read permission to the group
55
		action.click(By.id("addPermission.read"));
56
		
57
		//Press OK
58
		action.click(By.id("addPermission.button.ok"));
59
		
60
		//Press ok to close the dialog box
61
		
62
		//Assert that the group name you added permission to is displayed to the permissions table
63
		action.click(By.id("permissionsList.Wookiees"));
64
		
65
	}
66
	/**
67
	 * TODO: Share a folder to a user
68
	 * > select a folder
69
	 * > select File > 'Sharing'
70
	 * > click Add User
71
	 * > Type a valid username (a full version e.g john@doe.com)
72
	 * > Add permissions to the selected user
73
	 * > click OK
74
	 * > click Update
75
	 */
76
//	@Test
77
	protected void testAddUserToPermissionFolder() throws InterruptedException{
78
		
79
		//Click sharing option for the folder @folderName
80
		clickFolderSharing(userName, folderName);
81
		
82
		//Click the "Add User" option in the FolderProperties dialog box
83
		action.click(By.id("folderPropertiesDialog.button.addUser"));
84
		
85
		//type the username in the input textBox
86
		action.type(By.id("addPermission.textBox"), addUserName);
87
		
88
		//Add a read permission to the group
89
		//TODO: this should be toggle :(
90
		action.click(By.id("addPermission.read"));
91
		
92
		//Press OK
93
		action.click(By.id("addPermission.button.ok"));
94
		
95
		//Press ok to close the dialog box
96
		
97
		//Assert that the group name you added permission to is displayed to the permissions table
98
		action.click(By.id("permissionsList." + addUserName));
99
		
100
		//folderPropertiesDialog.button.ok
101
		
102
	}
103
	
104
	/**
105
	 * TODO: . Make a folder public for all
106
	 * > select a folder
107
	 * > select File > 'Sharing'
108
	 * > check 'Public' check box
109
	 * > click OK
110
	 * > click Update
111
	 */
112
		
113
//	@Test
114
	protected void testMakePublicFolder() throws InterruptedException{
115
		
116
		//Click sharing option for the folder @folderName
117
		clickFolderSharing(userName, folderName);
118
		
119
		//Click the "Public" checkBox
120
		//TODO: this should be toggle :(
121
		action.click(By.id("folderPropertiesDialog.checkBox.public"));
122
		
123
		//Press OK
124
		action.click(By.id("folderPropertiesDialog.button.ok"));
125
				
126
		/**
127
		 * TODO: Check public link validity
128
		 * > select a folder
129
		 * > select File > 'Sharing'
130
		 * > Select pubic link
131
		 * > click Cancel
132
		 * > Open a new browser with the above copied link
133
		 */
134
		
135
	}
136
	
137

  
138
}
/dev/null
1
/*
2
 * Copyright 2011 Electronic Business Systems Ltd.
3
 *
4
 * This file is part of GSS.
5
 *
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.
10
 *
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.
15
 *
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/>.
18
 */
19
package gr.ebs.gss.client.selenium.group;
20

  
21

  
22
import gr.ebs.gss.client.selenium.folder.ActionUtils;
23

  
24
import org.junit.After;
25
import org.junit.Assert;
26
import org.junit.Before;
27
import org.junit.Test;
28
import org.openqa.selenium.By;
29
import org.openqa.selenium.WebDriver;
30
import org.openqa.selenium.firefox.FirefoxDriver;
31

  
32
import com.google.gwt.user.client.ui.AbstractImagePrototype;
33
import com.google.gwt.user.client.ui.HTML;
34
import com.google.gwt.user.client.ui.TreeItem;
35
import com.google.gwt.user.client.ui.Widget;
36

  
37
public class TestGroup {
38
	
39
	ActionUtils action;
40
	
41
	WebDriver driver;
42
	
43
	String url = "http://127.0.0.1:8080/pithos/login?next=http://127.0.0.1:8080/pithos/";
44
	
45
	String groupName = "Wookiees";
46
	
47
	String userName = "lakis@ebs.gr";
48
	
49
	String addUserName = "past@ebs.gr";
50
		
51
	
52

  
53
	/**
54
	 * @throws java.lang.Exception
55
	 */
56
	@Before
57
	public void setUp() throws Exception {
58
		driver = new FirefoxDriver();
59
		
60
		action = new ActionUtils(driver);
61
		
62
		action.getUrl(url);
63
		
64
		// Necessary delay in order all dom elements to be created
65
		Thread.sleep(4000);
66
	}
67

  
68
	/**
69
	 * @throws java.lang.Exception
70
	 */
71
	@After
72
	public void tearDown() throws Exception {
73
		action.quit();
74
	}
75
	
76
//	@Test
77
	public void createNewGroup() throws InterruptedException{
78
		
79
		action.click(By.id(userName));
80
		
81
		Thread.sleep(1000);
82
		
83
		//Select Group option from top menu
84
		action.click(By.id("topMenu.group"));
85
		
86
		Thread.sleep(1000);
87
		
88
		//Select New Group option
89
		action.click(By.id("topMenu.group.newGroup"));
90
		
91
		Thread.sleep(1000);
92

  
93
		//type the group name in the input box of the group dialog
94
		action.type(By.id("groupDialog.textBox.name"), groupName);
95
		
96
		//click ok button
97
		action.click(By.id("groupDialog.button.ok"));
98
		
99
		Thread.sleep(2000);
100
		
101
		//assert that the newly created group has been created		
102
		Assert.assertEquals(groupName, action.getText(By.id("groupsList."+groupName)));
103
//		 action.click(By.id("permissionsList."+groupName));
104
		
105
	}
106
	
107
	public void selectGroupsTab(){
108
		//select the Group tab
109
		action.click(By.id("Groups"));
110
	}
111
	
112
	public void selectOneGroup(String aGroupName){
113
		selectGroupsTab();
114
		
115
		action.click(By.id("groupsList." + aGroupName));
116
	}
117
	
118
	public void deleteGroup(String aGroupName) throws InterruptedException{		
119
		
120
		selectOneGroup(aGroupName);
121
		
122
		//right click on the groupName		
123
		//TODO: Problem on displaying the context menu 
124
		/**
125
		 * NOTES: Context menu denies to be displayed
126
		 * Unsuccessful scenarios:
127
		 * id placed in: 
128
		 * 
129
		 * 1.addImageItem() method
130
		 * TreeItem item = new TreeItem();
131
		 * Widget aWidget = imageItemHTML(imageProto, title,item);
132
		 * aWidget.getElement().setId("groupsList."+title);
133
		 * item.setWidget(aWidget);
134
		 * 
135
		 * 2.imageItemHTML either in <a id =""></a> or in <span id=""></span>
136
		 * 
137
		 * 3. changed the HTML link to
138
		 * final HTML link = new HTML("<span id='groupsList."+title+"'>"+AbstractImagePrototype.create(imageProto).getHTML() + "&nbsp;" + title + "</span>"){
139
		 * or to
140
		 * final HTML link = new HTML(AbstractImagePrototype.create(imageProto).getHTML() +"<span id='groupsList."+title+"'>" + "&nbsp;" + title + "</span>"){
141
		 * 
142
		 * 4. TODO: addKeyDown/keyUpHandler or catch the events the webDriver creates in the imageItemHTML
143
		
144
		 */
145
		
146
		action.sendRightClick(By.id("groupsList.tree"));
147
		 
148
		//select 'Delete' option from right click context menu
149
		action.click(By.id("groupContextMenu.delete"));
150
		
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff