Issue
I am working on an application which has 2 modules.
- server module which is SpringBoot.
- ui which is in Angular
I am unable to run any E2E tests for my application as it is not starting before the tests run. I have below defined in the test class which should bring up the application context but it seems it does not.
@ContextConfiguration(classes=Application.class, loader = SpringBootContextLoader.class)
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
The application does start fine and run proper on localhost:8080 when I start the application normally using the run button in my IDE. I am not sure why does the application not come up when I try to run the tests.
Is it because of the different modules?
Solution
The issue was not with the modules. There were 2 issues,
- I was using an older version of Chrome driver for running the tests.
- The E2E tests were trying to access the application using https but the certificates I was using were self signed certificates. To overcome this, I added the below argument to my chromeoptions.
chromeOptions.addArguments("allow-insecure-localhost");
Answered By - Dhiren Dash
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.