kiali icon indicating copy to clipboard operation
kiali copied to clipboard

[Cypress] Mismatched node type graph fix testing

Open matejnesuta opened this issue 2 years ago • 9 comments

This is a little test case related to this issue fix from 1.48.

It toggles the node graph on the services// page and then checks that the graph type dropdown on the top of the page is disabled.

matejnesuta avatar Sep 05 '22 12:09 matejnesuta

@matejnesuta there's a CI failure for the newly added test if you wouldn't mind looking into it: https://github.com/kiali/kiali/runs/8243955353?check_suite_focus=true

nrfox avatar Sep 08 '22 14:09 nrfox

Looking at the screenshot right now. The page seems fine. My first guess is that the 'exist' should be replaced with 'be.visible'. @nrfox

matejnesuta avatar Sep 08 '22 15:09 matejnesuta

And it failed again. I will investigate it tomorrow I think.

matejnesuta avatar Sep 08 '22 16:09 matejnesuta

If you see the image from the failing test: https://github.com/kiali/kiali/suites/8198803432/artifacts/357005649

The node link is disabled because there is no service selected (No namespace is selected). When I run this test locally I don't have that error.

josunect avatar Sep 09 '22 14:09 josunect

You are right. Didn't see that yesterday. The namespace is selected, but it takes time to load the graph. That's why it failed probably. The thing is, the tests are passing locally for me as well, so it's hard for me to predict what's gonna flake.

matejnesuta avatar Sep 09 '22 14:09 matejnesuta

Added a codition that the mini-graph should be visible before the click happens. I hope everything will be good now.

matejnesuta avatar Sep 09 '22 15:09 matejnesuta

Added a codition that the mini-graph should be visible before the click happens. I hope everything will be good now.

I think this is more related to the order in which the steps are performed. If you notice, the file is expecting to have an ordered list of steps (Given, when, then, and, ...). But when is breaking the sequence.

josunect avatar Sep 09 '22 16:09 josunect

I think this is more related to the order in which the steps are performed. If you notice, the file is expecting to have an ordered list of steps (Given, when, then, and, ...). But when is breaking the sequence.

I don't think so. The preproccessor doesn't care about the gherkin keywords. For example, this gherkin line ( But user sees a minigraph) can be translated with this typescript Then('user sees a minigraph', () => { ... });, even though the keywords are different and it doesn't make much sense visually.

matejnesuta avatar Sep 09 '22 16:09 matejnesuta

So, looking at the code, the "Show Node Graph" link action is using data from the xhr call to create the url params. It looks like it haven't finished (From the screenshot). So, I will add a condition to wait for the xhr call before perform the click action in that link. That could explain why this test is working in my environment (Is pretty quick), but not in CI.

josunect avatar Sep 12 '22 09:09 josunect

I think I fixed the test and it looks like it's passing in the CI.

matejnesuta avatar Oct 26 '22 15:10 matejnesuta