【问题标题】:Controlling the order tests are run in Selenium控制顺序测试在 Selenium 中运行
【发布时间】:2012-06-19 04:38:08
【问题描述】:

这是我的代码:

class MyTestCase(Base):
    def setUp(self):
        #some code here

    def test_B(self):
        #some code here

    def test_C(self):
        #some code here

    def test_A(self):
        #some code here

    def tearDown(self):
        #some code here

if __name__ == "__main__":
    unittest.main()

我的问题是我所有的测试都是按字母顺序执行的,即首先执行 test_A,然后是 test_B,然后是 test_C。我希望它按照我写的顺序执行,即 test_B -> test_C -> test_A。

如何更改测试的执行顺序?

【问题讨论】:

    标签: python testing selenium


    【解决方案1】:

    如果您的测试需要按特定顺序进行,我认为它们应该使用相同的功能,但这只是我的意见,请查看 changing order of unit tests in Python

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-01-08
      • 2010-12-18
      • 2022-06-13
      • 1970-01-01
      • 2018-06-26
      • 1970-01-01
      • 2020-11-06
      相关资源
      最近更新 更多