source: java/main/src/test/java/com/framsticks/gui/BrowserTest.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 2.1 KB
Line 
1package com.framsticks.gui;
2
3import static org.fest.assertions.Assertions.assertThat;
4import static org.fest.swing.edt.GuiActionRunner.execute;
5
6import java.awt.event.KeyEvent;
7
8
9import org.apache.logging.log4j.Logger;
10import org.apache.logging.log4j.LogManager;
11import org.fest.swing.edt.GuiTask;
12import org.testng.annotations.Test;
13
14import com.framsticks.model.ModelPackage;
15import com.framsticks.remote.RemoteTree;
16import com.framsticks.util.dispatching.Dispatching;
17
18public class BrowserTest extends BrowserBaseTest {
19
20        private static final Logger log = LogManager.getLogger(BrowserTest.class);
21
22        RemoteTree localhost;
23
24        @Override
25        protected void configureBrowser() {
26                browser = new Browser();
27
28                localhost = new RemoteTree();
29                localhost.setName("localhost");
30                localhost.setAddress("localhost:9009");
31                localhost.usePackage(new ModelPackage());
32
33                browser.addTree(localhost);
34
35        }
36
37        @Test(timeOut = 60000)
38        public void testShow() {
39                Dispatching.synchronize(localhost, 1.0);
40                Dispatching.sleep(2.0);
41                log.info("testing");
42                clickAndExpandPath("localhost");
43                // tree.clickRow(0).expandRow(0);
44                // robot.waitForIdle();
45
46                clickAndExpandPath("localhost/simulator");
47                // tree.clickRow(1).expandRow(1);
48                // robot.waitForIdle();
49                assertThat(tree.valueAt(1)).isEqualTo("simulator");
50                robot.waitForIdle();
51                execute(new GuiTask() {
52                        @Override
53                        protected void executeInEDT() throws Throwable {
54                                assertThat(frame.panel("Simulator").component().isVisible()).isTrue();
55                        }
56                });
57
58
59                clickAndExpandPath("localhost/simulator/genepools");
60                clickAndExpandPath("localhost/simulator/genepools/groups");
61                clickAndExpandPath("localhost/simulator/genepools/groups/Genotypes");
62                clickAndExpandPath("localhost/simulator/genepools/groups/Genotypes/genotypes");
63                // Dispatching.sleep(2.0);
64                // clickAndExpandPath("localhost/simulator/genepools/groups/Genotypes/genotypes");
65                robot.pressAndReleaseKey(KeyEvent.VK_J);
66                waitForIdle();
67                Dispatching.sleep(2.0);
68
69                frame.panel("Genotype").panel("name").textBox("value").enterText("-Żółw");
70                clickButton(frame.panel("Genotype").button("apply"));
71
72                Dispatching.sleep(1.0);
73        }
74
75
76
77}
Note: See TracBrowser for help on using the repository browser.