polis icon indicating copy to clipboard operation
polis copied to clipboard

Fix failing e2e test for embeds: convo description selector

Open patcon opened this issue 5 years ago โ€ข 9 comments

Re-ticketed from https://github.com/compdemocracy/polis/pull/872#issuecomment-786933155

Need to investigate, as realizing this is different from iframe issue. Seems to be just a too-short timeout, but maybe something else to it, with the data-test-id=description selector we're using (it's always that selector that's been failing)

https://github.com/compdemocracy/polis/pull/872/checks?check_run_id=1991111795#step:10:405

  1) Embedded Conversations
       "before each" hook for "hides description when user-can-see-description (ucsd) is OFF":
     AssertionError: Timed out retrying after 4000ms: Expected to find element: `[data-test-id="description"]`, but never found it.

patcon avatar Feb 26 '21 22:02 patcon

Should we disable this flaky test until it is fixed? I just tried to run the tests locally and noticed that it is failing still.

Steps to reproduce, for me:

cd polis
docker-compose up --build --detach

cd e2e
npm install
npm test

micahstubbs avatar May 24 '21 01:05 micahstubbs

Skipping it is def fair game if no time to troubleshoot, although embeds are something that might be worth the time to salvage the test for, as embeds breaking is non-obvious and a pain to test manually. (if not now, i guess not sure when else the fix will happen ๐Ÿคท )

Screen Shot 2021-05-23 at 11 44 32 PM

Fwiw, from looking at the video artifact attached to the failing test run: it seems unrelated to any sort of timeout (as guessed before), as the test is trying to access an admin page and not having access in that moment. Needs some interactive debugging locally, I'd say -- likely something to do with how the test is logging and and out. A wait step somewhere in the test might help, though not figuring out the true root of the login/logout issue

Happy to chime in if there are any specific questions, but also you're welcome to skip it at your discretion! ๐Ÿ™‚

patcon avatar May 24 '21 03:05 patcon

Important note:

โณ This message appears when we are loading (and in that case is inaccurate, and should be a spinner).

https://github.com/compdemocracy/polis/blob/dev/client-admin/src/components/conversation-admin/conversation-config.js#L50

and

https://github.com/compdemocracy/polis/blob/dev/client-admin/src/util/component-helpers.js

need to be updated to reflect whether or not the app has received the data and the user is not authed, or whether we are waiting.

colinmegill avatar May 24 '21 03:05 colinmegill

Ah good call! It may be related, but I think the test waits for awhile here before concluding it's not going to find what it's looking for -- it doesn't just fail immediately when "loading" (aka "no access") component flashes for a moment. So I think this is a legit "this cookie doesn't have access to dashboard" moment. (i.e. an issue with login/logout in test)

EDIT: yay long weekend :)

patcon avatar May 24 '21 04:05 patcon

Loading, logged in, parent state / child props

https://github.com/compdemocracy/polis/blob/dev/client-admin/src/app.js#L106

colinmegill avatar May 24 '21 04:05 colinmegill

Good to see some movement on this one โ˜บ

I would suggest trying to fix forward in some reasonable amount of time, say one more day or one more week.

If we aren't able to fix forward in that amount of time then I think we should disable the test until we can fix it or fix the underlying Behavior.

While every bug fix is important, reliably green tests are more important than any individual bug fix.

micahstubbs avatar May 25 '21 05:05 micahstubbs

Sounds good, but sorry, to clarify, I was offering context on how it could be fixed, but won't be spending time on it myself. So it sounds like best to just add skip and merge

patcon avatar May 25 '21 07:05 patcon

@patcon ack, thanks for clarifying.

@colinmegill I think we should disable this flaky test and add a TODO Issue #873 comment in the codebase where we disable it.

I think that eventually we should try to fix this test and include it in the test Suite that runs all the time in CI.

micahstubbs avatar May 27 '21 01:05 micahstubbs

I'm on board

colinmegill avatar May 27 '21 02:05 colinmegill

This is complete

ballPointPenguin avatar Jun 12 '23 22:06 ballPointPenguin