diff --git a/src/test/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserChildTest.java b/src/test/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserChildTest.java new file mode 100644 index 00000000..82352952 --- /dev/null +++ b/src/test/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserChildTest.java @@ -0,0 +1,33 @@ +package com.xceptance.neodymium.junit4.testclasses.browser.inheritance; + +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import com.xceptance.neodymium.junit4.tests.NeodymiumWebDriverTest; +import com.xceptance.neodymium.util.Neodymium; + +public class BrowserChildTest extends BrowserParent +{ + @Before + public void before() + { + Assert.assertNotNull("No browser started for @Before method", Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } + + @Test + public void test() + { + Assert.assertNotNull("No browser started for @Test method", Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } + + @After + public void after() + { + Assert.assertNotNull("No browser started for @After method", Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } +} diff --git a/src/test/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserParent.java b/src/test/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserParent.java index 612151af..778f041e 100644 --- a/src/test/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserParent.java +++ b/src/test/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserParent.java @@ -1,14 +1,23 @@ package com.xceptance.neodymium.junit4.testclasses.browser.inheritance; +import org.junit.Assert; import org.junit.runner.RunWith; import com.xceptance.neodymium.common.browser.Browser; import com.xceptance.neodymium.junit4.NeodymiumRunner; +import com.xceptance.neodymium.junit5.NeodymiumTest; +import com.xceptance.neodymium.junit5.tests.NeodymiumWebDriverTest; +import com.xceptance.neodymium.util.Neodymium; @Browser("Chrome_1024x768") @Browser("Chrome_1500x1000") @RunWith(NeodymiumRunner.class) public abstract class BrowserParent { - + @NeodymiumTest + public void testParent() + { + Assert.assertNotNull(Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } } diff --git a/src/test/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserChildTest.java b/src/test/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserChildTest.java new file mode 100644 index 00000000..6765b2e1 --- /dev/null +++ b/src/test/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserChildTest.java @@ -0,0 +1,33 @@ +package com.xceptance.neodymium.junit5.testclasses.browser.inheritance; + +import org.junit.Assert; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; + +import com.xceptance.neodymium.junit5.NeodymiumTest; +import com.xceptance.neodymium.junit5.tests.NeodymiumWebDriverTest; +import com.xceptance.neodymium.util.Neodymium; + +public class BrowserChildTest extends BrowserParent +{ + @BeforeEach + public void before() + { + Assert.assertNotNull("No browser started for @BeforeEach method", Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } + + @NeodymiumTest + public void test() + { + Assert.assertNotNull("No browser started for @NeodymiumTest method", Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } + + @AfterEach + public void after() + { + Assert.assertNotNull("No browser started for @AfterEach method", Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } +} diff --git a/src/test/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserParent.java b/src/test/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserParent.java index 56f47867..d25c0d3d 100644 --- a/src/test/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserParent.java +++ b/src/test/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserParent.java @@ -1,10 +1,20 @@ package com.xceptance.neodymium.junit5.testclasses.browser.inheritance; +import org.junit.Assert; + import com.xceptance.neodymium.common.browser.Browser; +import com.xceptance.neodymium.junit5.NeodymiumTest; +import com.xceptance.neodymium.junit5.tests.NeodymiumWebDriverTest; +import com.xceptance.neodymium.util.Neodymium; @Browser("Chrome_1024x768") @Browser("Chrome_1500x1000") public abstract class BrowserParent { - + @NeodymiumTest + public void testParent() + { + Assert.assertNotNull(Neodymium.getDriver()); + NeodymiumWebDriverTest.assertWebDriverAlive(Neodymium.getDriver()); + } }