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.tests;
22 import org.junit.Test;
23 import org.openqa.selenium.By;
27 public class TestFolderSharing extends TestFolderBasics {
32 protected void testAddGroupToPermissionFolder() throws InterruptedException{
34 //Click sharing option for the folder @folderName
35 clickFolderSharing(userName, folderName);
37 //Click the "Add Group" option in the FolderProperties dialog box
38 action.click(By.id("folderPropertiesDialog.button.addGroup"));
40 //Select from drop down menu the preferred group
41 //TODO: add an id in the elements in the dropDown menu in order this click in the droppDown to work
42 // action.click(By.id("addPermission.dropDown"));
44 //Add a read permission to the group
45 action.click(By.id("addPermission.read"));
48 action.click(By.id("addPermission.button.ok"));
50 //Press ok to close the dialog box
52 //Assert that the group name you added permission to is displayed to the permissions table
53 action.click(By.id("permissionsList.Wookiees"));
57 * TODO: Share a folder to a user
59 * > select File > 'Sharing'
61 * > Type a valid username (a full version e.g john@doe.com)
62 * > Add permissions to the selected user
67 protected void testAddUserToPermissionFolder() throws InterruptedException{
69 //Click sharing option for the folder @folderName
70 clickFolderSharing(userName, folderName);
72 //Click the "Add User" option in the FolderProperties dialog box
73 action.click(By.id("folderPropertiesDialog.button.addUser"));
75 //type the username in the input textBox
76 action.type(By.id("addPermission.textBox"), addUserName);
78 //Add a read permission to the group
79 //TODO: this should be toggle :(
80 action.click(By.id("addPermission.read"));
83 action.click(By.id("addPermission.button.ok"));
85 //Press ok to close the dialog box
87 //Assert that the group name you added permission to is displayed to the permissions table
88 action.click(By.id("permissionsList." + addUserName));
90 //folderPropertiesDialog.button.ok
95 * TODO: . Make a folder public for all
97 * > select File > 'Sharing'
98 * > check 'Public' check box
104 protected void testMakePublicFolder() throws InterruptedException{
106 //Click sharing option for the folder @folderName
107 clickFolderSharing(userName, folderName);
109 //Click the "Public" checkBox
110 //TODO: this should be toggle :(
111 action.click(By.id("folderPropertiesDialog.checkBox.public"));
114 action.click(By.id("folderPropertiesDialog.button.ok"));
117 * TODO: Check public link validity
119 * > select File > 'Sharing'
120 * > Select pubic link
122 * > Open a new browser with the above copied link