-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '322-bug-browser-is-not-started-for-after-method-if-its-…
…declared-in-different-class-than-the-test-itself' into #330-improvement-stabilize-unit-tests
- Loading branch information
Showing
7 changed files
with
97 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserChildTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |
11 changes: 10 additions & 1 deletion
11
...st/java/com/xceptance/neodymium/junit4/testclasses/browser/inheritance/BrowserParent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserChildTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |
12 changes: 11 additions & 1 deletion
12
...st/java/com/xceptance/neodymium/junit5/testclasses/browser/inheritance/BrowserParent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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()); | ||
} | ||
} |