代码之家  ›  专栏  ›  技术社区  ›  Itay Maman

Swing UI的单元测试框架[关闭]

  •  18
  • Itay Maman  · 技术社区  · 16 年前

    测试UI是困难的。你认为Swing最好的单元测试框架是什么?

    3 回复  |  直到 16 年前
        1
  •  8
  •   Peter Coulton    15 年前

    目前我认为最好的是 FEST .

        2
  •  7
  •   Alfred    16 年前

    你认为什么是最好的单位 Swing的测试框架?

    问得好。我帮不了你。我可以给你指一些我读过的关于ui测试的文章 Misko Hevery's 网站

    Misko Hevery的建议

    • 谷歌的测试大师Misko Hevery的 网站。他说了很多关于如何
    • 比如在看他精彩的幻灯片时 "How to Write Hard to Test Code" 他指出 幻灯片45/288 修复渲染错误相对比较困难 你不应该 覆盖你的用户界面。
    • 他也有一些很好的方法来测试你的大脑 UI

      重要的是要把

    ObjectMentor公司

    UI Test Automation Tools are Snake Oil

        3
  •  5
  •   tucuxi    16 年前

    我一直在用 Jemmy test-case actions 在这里:

        new ClassReference("org.netbeans.jemmy.explorer.GUIBrowser")
            .startApplication();
        JFrameOperator mainFrame = new JFrameOperator("GUI Browser");
    
        new JButtonOperator(mainFrame, "Reload In").push();
        new JLabelOperator(mainFrame, "Reloaded");
    
        JTreeOperator tree = new JTreeOperator(mainFrame);
    
        //click in the middle of the tree
        tree.clickMouse();
    
        //collapse node     
        tree.collapsePath(tree.findPath("", "|"));
    
        //expand node       
        tree.expandPath(tree.findPath("", "|"));
    
        //select node
        tree.selectPath(tree.findPath("GUI Browser", "|"));
    
        JTextFieldOperator testField = new JTextFieldOperator(mainFrame);
    
        //type new value in the text field
        testField.clearText();
        testField.typeText("3");