How to handle Both E2E automated Tests with pure selenium tests(Resolved)

Hello friends, Have been currently trying to implement selenium tests along a pure E2E automated workflow , However am not sure whether this is achievable especially how these two separate implementation will share the same driver.

Initially E2E test workflow run smoothly and they have their driver that gets initialized after when each any workflow tag gets triggered forexample runreports.

However when i try to introduce the old pure selenium tests into qaframework , forexample a draft here, this line throws Nullpointer exceptional probably recursive exceptions , Ideally by the fact that driverswhile running E2E gets initialized and tests run successfully it implies that either we need to setup a folder for selenium test to use their own driver which i do think am not getting well. Got some question for point of clarification

  1. How will bbe able to use same driver get initialized following the same convention of E2E without to get triggered each time a single selenium tests get run as junit test, there is a bit of designing probably

We really want to keep things simple , either to make them all pure E2E would be initial option. This class is throwing NPE public

 Page(Page parent) {
		if (this.getClass().isInstance(parent)) {
			throw new RuntimeException(
					"When returning the same page use the two arguments constructor");

Another option is convert all selenium tests into a new bdd workflow and probably leaving selenium tests in distribution would also be better option but still making the qaframework module to be the ideal qaframework to use . I tried handling it at that line and resulted into breakage of E2E tests which isn’t the direction this workflow. Looking forward for your suggestion. cc @dkayiwa @ibacher @mozzy @kdaud

This class is throwing NPE

share the logs via

1635867187918 Marionette INFO Stopped listening on port 35701JavaScript erro - , we can see the logs best via here as well

@sharif your stacktrace suggests this is a problem with driver variable not initialized. Probably its because the driver is failing to be inherited from the parent(base) class. The program tries to use the class’s variable instead of the super variable (it has the same name) but the class variable is not initialized, the constructor just calls to the super constructor and you get null pointer exception.

Thanks @kdaud for the research on this, Sure the logic is still on initializing homePage class since this is where all pages start from , Remember that homePage gets instantiated in referenceapplicationTestBase class when its null in before method Have debugged this but i seem not to pick how we can come up with same tests using same method calls and method definitions

And we cannot catch null in before hook, perhaps we might break other working test, cc @dkayiwa @ibacher , this is currently a blocker for me to move on .your help will be so much appreciated

@sharif have you asked @kdaud to help unblock you?

Sure @dkayiwa we have been trying out with different options, unless @kdaud have come up with a different approach , will be glad hearing from him :slightly_smiling_face:

@sherrif10 I guess we may need a certain dependency within the pom.xml file to handle the initialization process of the driver within the test classes so that the program uses the super variable instead of the class variable.

@sharif how far with migrating the selenium legacy tests into qaframework module?

The migration of selenium tests are still under review, Reason being is, they pass locally and fail on ci github actions , so am still investigating and still pushing why they fail and others pass.