I have a GraphQL service that i'm using Karate to test. I have a feature for mutations and a couple features for queries. I'm doing a Spring Boot integration test, like so
@SpringBootTest(classes=ApplicationTest.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class RunUnitCukeTest implements InitializingBean {
@LocalServerPort
int port;
@Karate.Test
Karate runTest() {
return new Karate()//
.feature("classpath:features/TestMutationsAndDatabaseSetup.feature")
.feature("classpath:features/Queries.feature");
}
My thinking is, rather than staging a bunch of data into my H2 database in code, I could instead just test my mutations first (thus staging some data), and then test my queries/the calculations those queries need to do.
When my mutations feature runs, everything works fine. But my Queries feature isn't seeing any data. Which makes me wonder if they're running in the opposite order as I want, and if there's any way to get them to run sequentially.