root / test / gr / ebs / gss / web / client / selenium / tests / TestFolderBasics.java @ af6aa461
History | View | Annotate | Download (4.3 kB)
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.web.client.selenium.tests; |
20 |
|
21 |
|
22 |
import junit.framework.Assert; |
23 |
|
24 |
import org.junit.Test; |
25 |
import org.openqa.selenium.By; |
26 |
|
27 |
|
28 |
public class TestFolderBasics extends FolderUtils{ |
29 |
|
30 |
/**
|
31 |
* ---------------------------------------Tests ------------------------------------------------
|
32 |
*
|
33 |
*/
|
34 |
|
35 |
// @Test
|
36 |
public void testMakeNewFolder() throws InterruptedException{ |
37 |
|
38 |
//Create the folder with the given folderName
|
39 |
makeNewFolder(userName, folderName); |
40 |
// makeNewFolder(userName, folderDestination);
|
41 |
|
42 |
//Necessary delay
|
43 |
Thread.sleep(2000); |
44 |
|
45 |
Assert.assertEquals(folderName, action.getText(By.id(userName + "." + folderName)));
|
46 |
|
47 |
} |
48 |
|
49 |
// @Test (expected=org.openqa.selenium.NoSuchElementException.class)
|
50 |
public void deleteFolder() throws InterruptedException{ |
51 |
|
52 |
//Delete the folder
|
53 |
deleteFolder(userName, folderName); |
54 |
|
55 |
//the test is successful if that condition fails
|
56 |
Assert.assertEquals(folderName, action.getText(By.id(userName + "." + folderName)));
|
57 |
|
58 |
} |
59 |
|
60 |
// @Test
|
61 |
public void testMoveToTrash(){ |
62 |
//Select the desired folder
|
63 |
selectFolderBelowHome(userName,folderName); |
64 |
|
65 |
//Move to Trash
|
66 |
moveToTrash(userName, folderName); |
67 |
|
68 |
/**
|
69 |
* TODO: In order to confirm that
|
70 |
* the new folder exists in Trash folder
|
71 |
* trash folder should be expanded first
|
72 |
* and then select the element
|
73 |
*/
|
74 |
|
75 |
} |
76 |
|
77 |
// @Test
|
78 |
public void testEmptyTrash() throws InterruptedException{ |
79 |
|
80 |
emptyTrash(); |
81 |
|
82 |
/**
|
83 |
* TODO: Confirm that the trash folder is empty
|
84 |
*/
|
85 |
|
86 |
} |
87 |
|
88 |
/**
|
89 |
* Method that tries to expand the '+' symbol
|
90 |
* in order to reveal folder's containing folders
|
91 |
* @throws InterruptedException
|
92 |
*/
|
93 |
@Test
|
94 |
public void testExpand() throws InterruptedException{ |
95 |
expandFolder(); |
96 |
System.out.println("ssss"); |
97 |
Thread.sleep(5000); |
98 |
selectSubFolder("hasta luego", "abburido"); |
99 |
Thread.sleep(1000); |
100 |
selectTopMenu("file");
|
101 |
Thread.sleep(1000); |
102 |
selectAnOptionInTopMenu("file", "newFolder"); |
103 |
|
104 |
Thread.sleep(1000); |
105 |
|
106 |
typeInFolderPropertiesDialog("textBox.name", "feliz"); |
107 |
Thread.sleep(1000); |
108 |
//Submit
|
109 |
selectElementFromFolderPropertiesDialog("button.ok");
|
110 |
|
111 |
Thread.sleep(4000); |
112 |
|
113 |
} |
114 |
|
115 |
// @Test
|
116 |
public void testCutFolder(){ |
117 |
cutFolder(userName, folderName); |
118 |
|
119 |
paste(userName, folderDestination); |
120 |
|
121 |
/**TODO: In order to confirm successful paste of the folderName to folderDestination
|
122 |
* we should expand folderDestination and see if the folder name is in it's sub folders
|
123 |
*/
|
124 |
|
125 |
} |
126 |
|
127 |
// @Test
|
128 |
public void testCopyNPasteFolder(){ |
129 |
copy(userName, folderName); |
130 |
|
131 |
paste(userName, folderDestination); |
132 |
|
133 |
/**TODO: In order to confirm successful paste of the folderName to folderDestination
|
134 |
* we should expand folderDestination and see if the folder name is in it's sub folders
|
135 |
*/
|
136 |
|
137 |
} |
138 |
|
139 |
// @Test
|
140 |
public void testRenameFolder() throws InterruptedException{ |
141 |
//select the folder you want to rename and click Properties
|
142 |
//clickFolderProperties(userName, folderName);
|
143 |
clickFolderProperties(userName, newFolderName); |
144 |
|
145 |
//in the input box add the new folderName
|
146 |
action.type(By.id("folderPropertiesDialog.textBox.name"), newFolderName);
|
147 |
|
148 |
//click OK
|
149 |
action.click(By.id("folderPropertiesDialog.button.ok"));
|
150 |
|
151 |
Thread.sleep(2000); |
152 |
|
153 |
Assert.assertEquals(newFolderName, action.getText(By.id(userName + "." + newFolderName)));
|
154 |
|
155 |
} |
156 |
/**
|
157 |
* TODO: Make it run!!!!
|
158 |
* @throws InterruptedException
|
159 |
*/
|
160 |
// @Test
|
161 |
public void testRightClickOnFolder() throws InterruptedException{ |
162 |
|
163 |
|
164 |
selectFolderBelowHome(userName, folderName); |
165 |
Thread.sleep(1000); |
166 |
rightClickOnFolder(userName, folderName); |
167 |
Thread.sleep(1000); |
168 |
selectFolderContextMenuOption("refresh");
|
169 |
Thread.sleep(1000); |
170 |
} |
171 |
|
172 |
|
173 |
} |