Skip to content

Commit

Permalink
[#322] add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oomelianchuk committed Dec 13, 2024
1 parent e2f55be commit 1d97081
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 2 deletions.
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());
}
}
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());
}
}
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());
}
}
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());
}
}

0 comments on commit 1d97081

Please sign in to comment.