-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create most complex test cases for e2e #21
Comments
We are working mostly with playwright and cypress, so I would prefer to see those |
The demos are meant to be instructive and show how to do things conceptually. Do you see any conceptual problem with the current demo code? Is there a yFiles specific concept missing that we should cover? |
@bharathmuppa While I agree with Sebastian, I would like to add that both Playwright and Cypress offer the possibility to execute almost arbitrary JavaScript code within the context of the page that is being tested. In Playwright, you can use Page.evaluate towards this end. E.g. the following example shows how you can create an edge in a test case (see line 28):
The above example assumes the setup of yFiles' Playwright testing demo, i.e. the test is run against yFiles' application-under-test sample application (which starts with two initial nodes). For Cypress testing this should be even easier, as yFiles' Cypress testing demo already runs JavaScript inside the context of the page being tested. E.g. the following example shows how you can create a node label in a test case (see line 19):
The above example assumes the setup of yFiles' Cypress testing demo. Hope this helps. |
I know it make lots of sense for developers especially for component testing, but e2e intended mostly for testers within our team and they don't know much about yfiles internals, what they try to do is simulate user flow like below Use case : create 2 nodes and draw a relation
I can be in your shoes and see this should be done by teams, but it would be great for them to have a reference guide for complex scenario and then they can build more complex interactions on there own. |
That's a weird mix of an e2e test, IMHO where the test is ultimately interpreting the SVG DOM to check whether a business logic was performed correctly. I would recommend checking the data instead or if you don't want this, use screenshot testing, rather than interpreting SVG values, where you will probably end up having to change and augment the SVG just to make it "testable". We've seen this before and there are typically more errors introduced in the code-base just because of this "make the DOM fully inspectable from outside and self-explanatory" than are avoided by the tests. It also slows down the user agent and increased DOM and code size. So, I don't really buy the argument about testers not having to know any details with the proposed approach. With that approach they would need to understand the low-level details of the SVG DOM that not even the devs are typically aware of. The SVG DOM is an implementation detail for many of the default styles. So why not use image-based testing, instead and avoid all these problems? That being said, we do have some UI automation and testing examples that show how to do this super-low-level UI testing programmatically. |
Current e2e has basic tests like checking size of nodes and edges and so on, but it would be really nice to cover more test's like
The text was updated successfully, but these errors were encountered: