Is there a way to create different testing packages?

Enonic version: 7.6.0
OS: Ubuntu

I am using the testing library (https://developer.enonic.com/guides/writing-unit-tests#testing_a_library) to make some unit tests, but I didn’t find a way to group the test, they all end up below the “default-package”.


Do you guys know a way to group the tests so I don’t put everything I do together below the “default-package”?

This is not possible when using ScriptRunnerSupport

you may switch to ScriptTestSupport - it is pure Java JUnit and allows to group by package/class name.
But it won’t seek for exported functions in js file. You have to specify them

package com.enonic.guide;

import org.junit.Test;

import com.enonic.xp.testing.ScriptTestSupport;

public class FibonacciTest
    extends ScriptTestSupport
{
    @Test
    public void testSequence4()
    {
        runFunction( "/lib/fibonacci-test.js", "testSequence4" );;
    }
}
1 Like