Statistics
| Branch: | Tag: | Revision:

root / test / gr / ebs / gss / client / selenium / tests / GeneralPurposeUtils.java @ bd2b3100

History | View | Annotate | Download (2.6 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.tests;
20

    
21
import org.openqa.selenium.By;
22

    
23

    
24

    
25
public class GeneralPurposeUtils extends SetUpUtils{
26
        
27
        /**
28
         * Click the top e.g file menu, edit menu etc
29
         */
30
        public void selectTopMenu(String aMenu){
31
                action.click(By.id("topMenu."+aMenu));
32
        }
33
                
34
        /**
35
         * Click on e.g File > New Folder
36
         * @param aMenu
37
         * @param anOption
38
         */
39
        public void selectAnOptionInTopMenu(String aMenu, String anOption) {
40
                action.click(By.id("topMenu." + aMenu + "."+ anOption));
41
                
42
        }
43
        
44
        public void selectConfirmation(String anOption){
45
                
46
                action.click(By.id("confirmation."+ anOption));
47
                
48
        }
49
        
50
        /**
51
         * Select the user's home folder
52
         * 
53
         * @param aUserName
54
         */
55
        public void selectHomeFolder(String aUserName){
56
                action.click(By.id(aUserName));
57
        }
58
        
59
        /**
60
         * Select any folder below the user's home folder
61
         * 
62
         * @param aUserName
63
         * @param aFolderName
64
         */
65
        public void selectFolderBelowHome(String aUserName, String aFolderName){
66
                action.click(By.id(aUserName+ "." + aFolderName));
67
        }
68
        
69
        /**
70
         * Select the Trash folder
71
         */
72
        public void selectTrash(){
73
                action.click(By.id("Trash"));                
74
        }
75

    
76
        /**
77
         * Select the My Shared folder
78
         */
79
        public void selectMyShared(){
80
                action.click(By.id("My Shared"));
81
        }
82
        
83
        /**
84
         * Select the Other's Shared folder
85
         */
86
        public void selectOthersShared(){
87
                action.click(By.id("others"));
88
        }
89
        
90
        public void selectElementFromFolderPropertiesDialog(String anElement){
91
                action.click(By.id("folderPropertiesDialog." + anElement));
92
        }
93
        
94
        public void typeInFolderPropertiesDialog(String anElement, String input){
95
                action.type(By.id("folderPropertiesDialog." + anElement), input);
96
        }
97
        
98
        /**
99
         * Emptying the trash folder using right click action
100
         * 
101
         * @throws InterruptedException
102
         */        
103
        public void emptyTrash() throws InterruptedException{
104
                
105
                selectTrash();
106
                
107
                Thread.sleep(1000);
108
                
109
                selectTopMenu("file");
110
                                
111
                Thread.sleep(1000);
112
                
113
                selectAnOptionInTopMenu("file","emptyTrash");
114
                
115

    
116
        }
117

    
118
}