I have a weird situation going on with one of the react applications at my company. We have a suite of E2E tests written in testcafe that check our pull requests before we can merge. One portion of the application has about 15 tests associated with it.
When I pull down the changes to my latest branch and run the tests with Testcafe locally via yarn, while my application is pointed at the same exact backend services that we use for all testing, all 15 tests pass.
When the tests are run via github actions, using a docker image of our application as well as testcafe's docker container, 1/15 of the tests fails. The one that fails claims that it can't find certain elements within the dom.
I have spent days debugging this and I'm completely out of ideas. I've tried attempting to select different elements, using selectors from testing library instead of testcafe, implementing various waiting mechanisms to try to give the page additional time to load, none of it seems to matter just for this one single test.
I can't for the life of me figure out why the tests would pass when run locally, and the actual new feature works when tested manually, but only 1/15 tests would consistently fail when run via the docker process.
Does anyone have any ideas why this discrepancy could exist?