Exemplo n.º 1
0
        private void _GenericTestClick(string pBrowserString)
        {
            using (IJavaSelenium javaSelenium = new JavaSelenium.JavaSelenium(HOST, PORT, pBrowserString, URL))
            {
                javaSelenium.ObjectID = TEST_APPLET_ID;
                _OpenPage(javaSelenium);

                JavaAction action = new JavaAction(javaSelenium);
                Button button = new Button("clickme");

                Assert.AreEqual(action, action.Click(button));

                javaSelenium.ObjectID = TREE_APPLET_ID;
                Tree tree = new Tree("tree");
                action = new JavaAction(javaSelenium);

                Assert.AreEqual(action, action.Focus(tree).Select<Tree>("root").Click()
                                            .Select<Tree>("root/attribute1").Click()
                                            .Select<Tree>("root/attribute1/attribute1.1").Click()
                                            .Select<Tree>("root/attribute1/attribute1.3/leaf1.3.1").Click()
                                            .Select<Tree>("root/attribute1/attribute1.3/leaf1.3.2").Click()
                                            .Select<Tree>("root/attribute1/attribute1.3/leaf1.3.3").Click()
                                            .Select<Tree>("root/attribute2").Click()
                                            .Select<Tree>("root/attribute3").Click()
                    );

                javaSelenium.ObjectID = COMBO_APPLET_ID;
                ComboBox pattern = new ComboBox("pattern");
                action = new JavaAction(javaSelenium);

                Assert.AreEqual(action, action.Focus(pattern)
                                            .Select<ComboBox>("yyyy.MMMMM.dd GGG hh:mm aaa")
                                            .Select<ComboBox>("K:mm a,z")
                                            .Select<ComboBox>("H:mm:ss:SSS")
                                            .Select<ComboBox>("h:mm a")
                                            .Select<ComboBox>("EEE, MMM d, ''yy")
                                            .Select<ComboBox>("yyy.MM.dd G 'at' hh:mm:ss z")
                                            .Select<ComboBox>("MM/dd/yy")
                    );

                javaSelenium.ObjectID = TAB_APPLET_ID;
                TabbedPane pane = new TabbedPane("pane");
                action = new JavaAction(javaSelenium);

                Assert.AreEqual(action, action.Focus(pane)
                                            .Select<TabbedPane>("Tab 1").Click()
                                            .Select<TabbedPane>("Tab 2").Click()
                                            .Select<TabbedPane>("Tab 3").Click()
                                            .Select<TabbedPane>("Tab 4").Click()
                    );

                javaSelenium.ObjectID = SPINNER_APPLET_ID;
                Spinner month = new Spinner("month");
                Spinner year = new Spinner("year");
                Spinner date = new Spinner("date");

                Assert.AreEqual(action, action
                                            .Focus(month).Click()
                                            .Focus(year).Click()
                                            .Focus(date).Click()
                    );
            }
        }