Should be Cypress testing framework be installed separate from the testee project? - testing

I have a big web project with a separate backend and a front-end (webpack). I'm going to use Cypress to create end-to-end tests.
What is not clear is where I should add the Cypress tests and Cypress itself. The documentation says to add it right to the testee project and it shows how to run the tests on the production website (which URL is different from the local, dev project). This means that I'm not able to run the tests on the development project because Cypress testing IDE and the testee project can't be run simultaneously because they share the same terminal.
If so, the best solution is probably to organize one more project, only for testing purposes, and having only Cypress installed and tests themselves? Is it a good practice and if so, which project should it be?

We have the same setup at work. We include the Cypress folder in the front-end repo. I'd agree with keeping it right next to the project because you have access to that code easily i.e. accessing utility functions, selectors, etc. As far as the terminal issue, you should be able to run your project locally in one terminal tab and the cypress test runner in another.

Related

How to merge selenium automation code with application development code base in same repo

I have to merge my test automation code base with my application development code base in same repo, i have 2 different pom's- one for development code and other for automation testing code.
Dependencies used in development code are not there in testing code and vice-versa. Currently i have merged both the pom's and able to run automated tests on CI/CD pipeline.
But need to have separate pom's for both of them as it might take more time for dev code to build/deploy on CI/CD pipeline because of dependencies present in testing pom.
Please suggest the efficient way to do this?

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.

how to make a selenium project run on a build of another project before it's deployed using gitlab CI

So this is a question of concept more than technical,
Say I have two projects project A is the project that I'm testing, it's a website that is built with angular 8, and project B is the selenium testing framework that has all my testing scripts that will run on project A,
NOW both projects are on GitLab in separate repositories.
Question 1:
on a merge, for project A with new code, a build will happen with the new code and if successful then I want to trigger the build of project B and run the tests on project A's new build
( is it possible ?)
Question 2 :
if it is possible how do I access the build of project A when I have already defined the URLs that selenium will run the scripts on?
thank you in advance for whoever is willing to help and I'm sorry if this question is considered a dumb question
You can use a CI/CD tool to achieve this (ex: Jenkins, Bamboo, Teamcity,CircleCI, Gitlab etc)
You will need to configure a job to deploy app A, (you can provide any source and configure the deployment) then you can do the same with app B. Even if you are building the app on localhost, or you deploy it in another place, you can keep environment variables in your automation framework.

Using MS Build to deploy after tests

I have a web project structured the following way:
WebSite
WebSite.test
In the test project, I have all the unit tests (using Microsoft test framework). In the WebSite project I have a target to deploy the site using MSDeploy, the MSDeployPublish target, and DeployOnBuild=true. I then run this build using Jenkins. The problem is that using this setup, the site will get deployed before it's tested.
I could add another build step in Jenkins, so that the entire solution is built first, then the deploy projects are run. However, I would like for it all to be in one step. Is this at all possible?
This is probably a bug in Jenkins. See this bug (or this one). See comments for possible workarounds.

Fitnesse deployment practices

Is there some documentation on the best ways to organize the deployment of Fitnesse for use in projects?
I have many questions:
How should it be stored? Should the whole fitnesse root be stored in SVN? How do you deal with acceptance tests that span multiple svn repositories?
We have some code that runs only on linux (server) and other code that runs only on windows (client) that make up the complete system, how do you run these? Do you have multiple Finesse servers?
In the company that I work we are setting up a FitNesse for Functional Tests integrated with SVN and Selenium.
Here is our basic idea:
Store FitNesse in a repository on SVN (yes, the root)
Store Selenium tests in another repository on SVN (per project and both .html and .java TestNG generated)
Use Hudson to automate checkouts from SVN and put everything to run on a QA Environment. If a FitNesse acceptance test span across multiple svn repositories, Hudson is able to download and build the projects. This way, FitNesse does not need to deal with this issue.
We are still integrating the tools. We also use Jira, Testlink, Sonar and MediaWiki.