Im exploring apostrophe cms and it seems to fit my business. I have successfully created a sample widget, can someone help me with creating apostrophe instances in runtime, create pages and run my test cases. I want all the test cases for that widget to succeed before moving it to production
1 Answers
If you check out the Apostrophe Enterprise Testbed project, you can see how we do this ourselves, and even use the apostrophe-nightwatch-tools module as we do to carry out functional tests in a headless browser as part of a real Apostrophe-based site project. This is what you are trying to do. You could even fork that project as a starting point.
There is no real barrier to using any browser functional testing library by the way, so the question is not really Apostrophe specific. But, that project will help guide you to a path we have had some success with.
I should acknowledge however that since that suite is so large, we don't always get a successful result from it (especially when run via Travis rather than on our own machines), probably due to timing issues. These are less likely to come into play for a smaller suite, but we continue to revise and improve how we do this and contributions to further stabilize the suite are of course welcome as it's an open source project.

- 7,281
- 1
- 26
- 23
-
Hi Tom, thanks for the response, i have gone through the testbed. i could see a lot of test cases written in the '/tests/scenarios/' path, Is it possible for me to call the newly created widget and test all its use cases, if so can you please tell me how to achieve the same. – Leeyung Aug 12 '19 at 06:05
-
Hi Vinu, it's not so much about "calling the widget." It's much more basic than that: you must script every interaction the user has with the site, exactly as if they were a real person. If you look at the existing scenarios, steps and commands you will see this is true. So you put your widget in a page template the same as you normally would, you test that out in the project manually, and then you script the same series of steps for nightwatch to simulate. – Tom Boutell Aug 13 '19 at 12:47
-
Got it!! Thank you so much Tom – Leeyung Aug 14 '19 at 05:01