private void _GenericTestUncheck(string pBrowserString, string pAppletID) { using (IJavaSelenium javaSelenium = _GetJavaSelenium(pBrowserString, URL, pAppletID)) { _OpenPage(javaSelenium); JavaAction action = new JavaAction(javaSelenium); CheckBox chin = new CheckBox("Chin"); CheckBox glasses = new CheckBox("Glasses"); CheckBox hair = new CheckBox("Hair"); CheckBox teeth = new CheckBox("Teeth"); action.ScrollBrowserWindowToBottom(); Assert.AreEqual(action, action.Check(chin).Uncheck(chin) .Check(glasses).Uncheck(glasses) .Check(hair).Uncheck(hair) .Check(teeth).Uncheck(teeth) ); } }
private void _GenericTestFocus(string pBrowserString) { using (IJavaSelenium javaSelenium = new JavaSelenium.JavaSelenium(HOST, PORT, pBrowserString, URL)) { javaSelenium.ObjectID = TEST_APPLET_ID; _OpenPage(javaSelenium); JavaAction action = new JavaAction(javaSelenium); Assert.AreEqual(action, action.Focus()); javaSelenium.ObjectID = TABLE_APPLET_ID; action = new JavaAction(javaSelenium); Assert.AreEqual(action, action.Focus()); javaSelenium.ObjectID = TREE_APPLET_ID; action = new JavaAction(javaSelenium); Assert.AreEqual(action, action.Focus()); javaSelenium.ObjectID = COMBO_APPLET_ID; action = new JavaAction(javaSelenium); Assert.AreEqual(action, action.Focus()); javaSelenium.ObjectID = TAB_APPLET_ID; action = new JavaAction(javaSelenium); Assert.AreEqual(action, action.Focus()); javaSelenium.ObjectID = SPINNER_APPLET_ID; action = new JavaAction(javaSelenium); Assert.AreEqual(action, action.Focus()); javaSelenium.ObjectID = LIST_APPLET_ID; action = new JavaAction(javaSelenium); Assert.AreEqual(action, action.ScrollBrowserWindowToBottom()); Assert.AreEqual(action, action.Focus()); Button hire = new Button("hire"); Button fire = new Button("fire"); List employees = new List("employees"); TextBox employeeName = new TextBox("employeeName"); // WARNING : An illegal state exception will be thrown when attempting to focus on a disabled component //Assert.AreEqual(action, action.Focus(hire)); Assert.AreEqual(action, action.Focus(fire)); Assert.AreEqual(action, action.Focus(employees)); // Enter something in the employeeName text field to enable the hire button Assert.AreEqual(action, action.Focus(employeeName).Click().Type<TextBox>("New Guy")); Assert.AreEqual("New Guy", action.Focus(hire).Click().GetSelectedValue(employees)); Assert.AreEqual(1, action.GetSelectedValues(employees).Count); } }
// WARNING: Broken private void _GenericTestSelectPopUp(string pBrowserString) { using (IJavaSelenium javaSelenium = new JavaSelenium.JavaSelenium(HOST, PORT, pBrowserString, URL)) { _OpenPage(javaSelenium); javaSelenium.ObjectID = POPUP_APPLET_ID; JavaAction action = new JavaAction(javaSelenium); TextBox text = new TextBox("text"); //MenuItem item1 = new MenuItem("item1"); //MenuItem item2 = new MenuItem("item2"); action.ScrollBrowserWindowToBottom(); // WARNING: Must RightClick before the SelectPopup can be called. // This functionality is broken at the moment. There currently // is no way in FEST to specify a JPopupMenu directly Assert.AreEqual(action, action.Focus(text).RightClick().SelectPopUp()); //.RightClick().Select<MenuItem>(item1).Select<MenuItem>(item2) } }
private void _GenericTestAddSelection(string pBrowserString, string pAppletID) { using (IJavaSelenium javaSelenium = _GetJavaSelenium(pBrowserString, URL, pAppletID)) { _OpenPage(javaSelenium); JavaAction action = new JavaAction(javaSelenium); // applet must be visible to be able to run tests against. action.ScrollBrowserWindowToBottom(); List list = new List("employees").AddItems("Debbie Scott", "Scott Hommel"); Assert.AreEqual(action, action.Focus(list).Click()); Assert.AreEqual(action, action.AddSelection(list)); Assert.AreEqual(2, action.GetSelectedValues(list).Count); Assert.AreEqual("Debbie Scott", action.GetSelectedValues()[0]); Assert.AreEqual("Scott Hommel", action.GetSelectedValues()[1]); } }