Homepage is reloading again and again on e2e tests in form builder

I started working on one of the end to end test case, but the test keep failing due to the page is reloading again and again when I ran the tests locally. But If I ran the tests using dev3 it works (ie: changing the BASE_URL ). A possible cause for this might be an import map issue in the form builder.

@dkigen @vasharma05 @hadijah315

1 Like

I also faced this issue changed the base url to dev3. I thought I was doing something wrong, but if its the same on your side, we need a fix

1 Like

Is it for the form builder as well?

Yes @anjisvj

1 Like

Hey @anjisvj could you please share some screenshots, maybe we can start from there.

@hadijah315 as you can see it keeps loading again again, I tried opening it another window the issue is still there. The tests are being running on chromium

Untitled (1)

@anjisvj are your changes hosted on github?

2 Likes

Here’s the draft PR,

@anjisvj could you please try temporarily configuring webkit and check whether the issue is chromium specific?

1 Like

yes it’s the same. @jayasanka

I still cannot figure out the issue here. Any idea @hadijah315 @vasharma05 @kdaud @dkigen

Can you look at this : https://issues.openmrs.org/browse/O3-2088

Appending --trace "off" to yarn test-e2e --headed gets the tests working.

Setting the trace property of the use object to 'on-first-retry' will record traces only when retrying a test for the first time. Traces that get recorded are persisted to the test-results directory in the root of the repo, and this seems to be what trumps up the webpack dev server HMR. It watches the file for changes and reloads the dev server each time a new trace asset is created. The fact that the form builder is not a monorepo probably matters too, as the dev server will likely be watching the entire root directory for file changes (including the test-results directory).

Ultimately, if we want to continue to use retain-on-failure, we’ll need a solution that gets the webpack dev server watch mode to ignore the test-results directory.

4 Likes

Great Dennis

is it poissible too to mitigate this by changing the location where the trace assets are saved??

@dkigen does this describe well the workaround you suggested to provide a potential solution?

Thank you @dkigen I’ll try to find a solution for this.

This issue is fixed with (chore) O3-2089: Disable trace recording in Playwright by anjula-sack · Pull Request #112 · openmrs/openmrs-esm-form-builder · GitHub

@jexsie take a pull

1 Like