1 package com.atlassian.selenium;
2
3 import com.atlassian.performance.TimeRecorder;
4 import junit.framework.TestCase;
5
6 import java.util.List;
7
8 public abstract class SeleniumMultiTest extends TestCase
9 {
10
11 protected SeleniumAssertions assertThat;
12 protected SeleniumClient client;
13 protected boolean parallel;
14
15 public abstract List<SeleniumConfiguration> getSeleniumConfigurations();
16
17
18
19
20
21
22 public final void setUp() throws Exception
23 {
24 super.setUp();
25 client = SeleniumStarter.getInstance().getSeleniumClient(getSeleniumConfigurations(), parallel);
26
27 if (SeleniumStarter.getInstance().isManual())
28 {
29 SeleniumStarter.getInstance().start(getSeleniumConfigurations().get(0));
30 }
31
32 assertThat = new SeleniumAssertions(client, getSeleniumConfigurations().get(0), new TimeRecorder(this.getClass().getName()));
33 onSetUp();
34 }
35
36
37
38
39 protected void onSetUp() throws Exception
40 {
41 }
42
43
44
45
46
47 public final void tearDown() throws Exception
48 {
49 super.tearDown();
50 onTearDown();
51
52 if (SeleniumStarter.getInstance().isManual())
53 {
54 SeleniumStarter.getInstance().stop();
55 }
56 }
57
58
59
60
61 protected void onTearDown() throws Exception
62 {
63 }
64
65 }