Call Cypress Test from TestCafe - testing

One of the projects has automated several test cases in Cypress.
We are using TestCafe to Automate our test cases. We want to call some of the test written in Cypress from TestCafe.
These Cypress test create precondition data that we can use in TestCafe. These cypress test cases are complicated and perform bunch of actions. Also, it is not responsibility of our project to maintain those scenarios. So, there is no sense to automate these test again in Test Café. It will help us in reusing test cases. We tried various approaches
Schedule specific Pipeline in Cypress with those test cases. Trigger this Pipeline from TestCafe
Is there a better way to call specific Cypress test from TestCafe ?

To me, calling Cypress tests from TestCafe tests seems like less clean a way to do it.
I'd do it with pipelines as you hinted at in your question:
Run Cypress tests that set up what you need
If 1. succeeds, trigger TestCafe tests
This looks pretty straigforward to me, and it's perhaps what other people would expect as well, so you make lives of your colleagues easier :)

Related

Running all Tests in Production Template in Shopware 6.3.5.2

We are building a shop for a customer on Shopware 6.3.5.2 and want to use tests to
ensure that core functionality is not broken by our customizations (static plugins)
write new tests for new functionality
There is Running End-to-End Tests but this seems to be for core development and uses psh.phar which is not available in the production template.
How should this be done?
edit
This question is meant a bit broader and concerns also Unit Tests.
Actually, you can use the E2E tests of the platform project - as Cypress itself doesn't care where to run the test against. However, as you already noticed you cannot use psh commands to run them. You may run the tests though the basic Cypress commands, setting your shop's url as baseUrl of the tests, for example via this command:
./node_modules/.bin/cypress run --config baseUrl="<your-url>"
It works with cypress open as well.
The only thing what may become troublesome is the setToInitialState command in most of the tests which takes care about the clean up of shopware's database using psh scripts, unfortunately. You may need to adjust it by overriding the command in order to reset the database of the Production template.
I hope I was able to help a bit. 🙏
There are actually two parts here:
ensure that core functionality is not broken by our customizations (static plugins)
write new tests for new functionality
re 1: For regression tests like this I would suggest end-to-end tests. Either test through the UI with tools like selenium or through the HTTP API (I don't know if the shopware API is sufficient for extensive regression tests).
re 2: Since plugins do not run on their own I would extract all relevant functionality into plain old PHP classes that are independent of shopware and test those in isolation. Explore if some of that functionality can be made visible through an API and test the plugin integration through this. Depending on the actual plugin you might have to resort to UI tests again.

Automated Testing for testers with no coding required

I'm trying to improve the testing process where I work, but without adjusting the structure.
What we have: VSTS, Selenium IDE, Testers who write test cases, but not code.
What I'd like to do is manage a way to marry our TFS continuous integration with the Selenium tests we write. These are NOT the code-driven selenium tests, but rather the IDE version where users click through, and set assertions using the IDE (All are just UI tests). I know we can export those tests plans as a .SIDE file, but what I can't figure out, is how to have our TFS server execute those as part of a deployment or build pipeline.
Ideally, developers/devops would setup projects in TFS from the onset with whatever solution makes sense to execute these Selenium .SIDE files, but afterwards, the testers would manage adding/modifying those tests cases elsewhere.
The real goal here is to not have testers writing code, or checking in code. Only writing these UI Selenium tests, but having TFS execute those as part of CI.
Researching this on the internet drives me basically always to something that requires testers to write code.
I don't think it can automate testing without code, at lease, you need a test project containing your automated tests.
Generally, in Azure DevOps, we use Visual Studio Test task to run tests. This task supports using the following tests:
Test assembly: Use this option to specify one or more test assemblies that contain your tests. You can optionally specify a
filter criteria to select only specific tests.
Test plan: Use this option to run tests from your test plan that have an automated test method associated with it. To learn more about
how to associate tests with a test case work item, see Associate
automated tests with test cases.
Test run: Use this option when you are setting up an environment to run tests from test plans. This option should not be used when
running tests in a continuous integration/continuous deployment
(CI/CD) pipeline.
This was a question that I had as well, and I think I found an imperfect but better solution.
I wasn't able to get my Selenium IDE tests running with Jenkins, but I was able to get them to run with TeamCity, another CI.
I created a build step like the following :
Runner type: Command Line
Working Directory: where the selenium IDE .side file is located
Run: Custom Script
With the build script content that I usually use to run my Selenium IDE Tests, such as selenium-side-runner sidefile.side
I also added the following so I could output the results in Junitor another form: --output-directory=results --output-format=junit
You can also add the following so the tests are run headlessly, this only works in Chrome : -c "goog:chromeOptions.args=[--headless,--nogpu] browserName=chrome"
Finally, I also use --filter to run one test suite at a time, but that is optional too.
I then used another build step to export the results to our test manger, xray, but I think that is beyond the scope of this question.
The problem with this solution is that it runs directly from a users individual machine still, but this can be work around.

What is the procedure to test cypress-cucumber tests to run on multiple browsers

I am new to Cypress, I have tests ready running on cypress gui, but now want to automate these tests running on multiple browsers. Can I get help running my tests in multiple browsers.
I have my tests written in feature files and step definitions
Have you checked docs? You can prepare cli commands with desired browsers and run them all. Or as separate processes.
https://docs.cypress.io/guides/guides/launching-browsers.html#Browsers

Automation Unit Test Cases in SPFX Extensions using Jest

I want to automate unit test cases for SPFX using Jest Framework. I am able to write the test cases but do not know how to get SharePoint context in jest text cases to get properties from SharePoint. Any pointer will be of great help. TIA

e2e end to end, integration tests in ReactJS

While ReactJS homepage mentions clearly that Jest is the way to go about unit tests, it says nothing about higher level integration tests (or e2e, as they are called in Angular world).
I'm quite unfamiliar with testing actually. So what kind of tools can I use for this? I've heard about selenium, but it's a blurry picture for me.
You can use cypress. Cypress is most often compared to Selenium; however, Cypress is both fundamentally and architecturally different. Cypress is not constrained by the same restrictions as Selenium.
This enables you to write faster, easier and more reliable tests.