aws-samples / aws-device-farm-appium-tests-for-sample-app

AWS Device Farm Appium tests
Apache License 2.0
91 stars 77 forks source link

Farm has a different behavior than Junit #24

Open atigm opened 1 year ago

atigm commented 1 year ago

Hello,

I use Junit/Appium For this test class :

@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class Class1 {
    @Test
    public void method1() {....}
       @Test
    public void method2() {....}

       @BeforeClass
        public static void setUp() {
            driver = new AndroidDriver(new URL(URL), getCapsAndroidEmulAut2());
       }
       @AfterClass
       public static void tearDown() {
            driver.quit();
    }
}

AWS Device Farm considers Class1 as a suite, each method as a class. According to the results: Farm executes setUp() -> method1() -> tearDown() (this is the first suite) Then a new suite is executed : setUp() -> method2() -> tearDown().

While the standard behavior of JUnit is Class1 is a test class, it execute : setUp() -> method1() -> method2() -> tearDown().

I want that AWS run tests as standard Junit.

Any help ?