Replies: 7 comments 1 reply
-
The only reason; we haven't spent time on it yet. |
Beta Was this translation helpful? Give feedback.
-
Useful link to read get a common understanding on the possible patterns: https://applitools.com/blog/page-objects-app-actions-cypress/ https://www.cypress.io/blog/2019/01/03/stop-using-page-objects-and-start-using-app-actions/ I would imagine this repo to become a cypress library/plugin providing:
For custom projects you have 3 possible situations: From my experience, in one project you encounter all three scenarios. |
Beta Was this translation helpful? Give feedback.
-
We added a package.json and a package-lock.json to the repo recently, which makes it one step closer to making this repo an npm package. One of the thoughts I had is that you could install this suite through npm by running From there, we should be then able to start the default testing suite by running Now here's where the extensibility comes in. It would be great if we could then put tests in the same location relative from this project into the project repo, so;
You could then alter/remove tests in your local copy as you wish. There are in my opinion two ways this could work out;
To make option 2 a reality, we'd probably need some preprocessor to generate a Javascript file that combines the local and node_modules files. This would apply to all types of files - spec files, fixtures and page objects. Any thoughts on this @tmotyl @sprankhub @Vinai @lfolco @nisrineMach ? |
Beta Was this translation helpful? Give feedback.
-
Thanks for starting this, @peterjaap! So given that spec files can be quite "big" like https://github.com/elgentos/magento2-cypress-testing-suite/blob/7438e23c1201b43114693f69b6d712901f91676c/cypress/integration/hyva/catalog/product.spec.js, I would really prefer the merging approach (option 2). Because I do not want to override a 180 lines file just to adapt two lines of one specific spec from it. However, I could imagine that merging the JS files is not trivial. If it is indeed hard to do, I could imagine a combined approach: For spec files and page objects, use option 1. For fixtures, use option 2. The reason is that fixtures are JSON files and these should be fairly simple to merge. |
Beta Was this translation helpful? Give feedback.
-
Maybe someone with more JS experience can pitch in here on how hard it is to merge the specfiles. Maybe @jesse-deboer? |
Beta Was this translation helpful? Give feedback.
-
I see two approaches without having investigated anything.
|
Beta Was this translation helpful? Give feedback.
-
How would dynamically setting filters work? Do something like this and create a wrapper function that checks on existing tests in another location? |
Beta Was this translation helpful? Give feedback.
-
Can you share some information why this limitation exists? Is it a design decision, are there technical issues with it or what is the main reason? I mean, in the end, we all love Magento so much due to its extensibility, right? Inheriting core behaviour and only extending needed parts is a nice thing, so I would love to see this here as well. Currently, I do not have any concrete ideas yet as the code is not even there, but at least I wanted to get this discussion going :)
Beta Was this translation helpful? Give feedback.
All reactions