root / test / gr / ebs / gss / client / selenium / folder / TestFolderBasics.java @ 67a0315c
History | View | Annotate | Download (4 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.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 |
} |