1
|
/**
|
2
|
*
|
3
|
*/
|
4
|
package eu.etaxonomy.taxeditor.test;
|
5
|
|
6
|
import org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot;
|
7
|
import org.eclipse.swtbot.eclipse.finder.waits.Conditions;
|
8
|
import org.eclipse.swtbot.swt.finder.utils.SWTBotPreferences;
|
9
|
import org.junit.Before;
|
10
|
|
11
|
|
12
|
/**
|
13
|
* @author n.hoffmann
|
14
|
*
|
15
|
*/
|
16
|
//@RunWith(SWTBotJunit4ClassRunner.class)
|
17
|
public abstract class AbstractEditorTest {
|
18
|
|
19
|
protected SWTWorkbenchBot bot;
|
20
|
|
21
|
public SwtBotUtils utils;
|
22
|
|
23
|
@Before
|
24
|
public void setup() {
|
25
|
bot = new SWTWorkbenchBot();
|
26
|
SWTBotPreferences.TIMEOUT = 300000;
|
27
|
utils = new SwtBotUtils(bot);
|
28
|
|
29
|
// unfortunately swt bot is not available at the time this is set up
|
30
|
// if("Choose a nomenclatural code".equals(getActiveShellHeadline())){
|
31
|
// ok();
|
32
|
// bot.waitUntil(Conditions.shellIsActive("Nomenclatural code set"));
|
33
|
// ok();
|
34
|
// }
|
35
|
|
36
|
if("Connecting to datasource: cdm".equals(utils.getActiveShellHeadline())){
|
37
|
performLogin();
|
38
|
}
|
39
|
}
|
40
|
|
41
|
private void performLogin(){
|
42
|
bot.waitUntil(Conditions.shellIsActive("Login"));
|
43
|
bot.textWithLabel("Username").setText("admin");
|
44
|
bot.textWithLabel("Password").setText("00000");
|
45
|
bot.button("OK").click();
|
46
|
}
|
47
|
|
48
|
|
49
|
|
50
|
|
51
|
}
|