0

I'm using webdriver and JUnit to write tests for a website. The website has 4 levels of users. The tests I'm writing are mainly to confirm they can or cannot use a particular feature on the site, and that the feature works.

Currently I have my test project setup so that it runs in Chrome, FF and IE. First logging in as a user and then running a set of test cases. Some of these test cases are repeated for multiple types of users so my wish is to be able to user the same test case twice over multiple suites but when I try this running all the suites together JUnit never gives me a pass, fail or error the second time it's suppose to run the shared test cases.

Is what I'm trying to do possible with JUnit? How should I go about doing this?

I have my test suites layed out as follows:

AllTests

User1
    Test something shared
    Test something unique
User2
    Test something shared
    Test something unique
User3
    Test something unique
User4
    Test something unique

This is what my results looks like when the tests complete. As you can see it should have failed the suite on the first user on the Edit test(I coded it to fail purposely) but doesn't show an icon at all, and the suite comes back saying it worked fine.

Results

4

1 回答 1

1

一种方法是使用类层次结构而不是测试套件。您可以为每个用户类型创建一个类,每个类都从包含共享测试的基类扩展而来。

于 2013-01-08T22:45:08.357 回答