The short answer was given by MikDiet. For a long answer, check the documentation for system tests and integration.
System tests allow you to run tests in a real browser or headless driver to test interaction with your user.
A quick rule of thumb is that all tests that interact with Javascript must run as system tests. But you can also use them to test your flexible layout, as you can specify the browser screen size.
Integration tests are used to test the interaction of various parts of your application. They are commonly used to test important workflows in our application.
Integration testing is different from the fact that they do not run through the browser. They still allow you to interact with the HTML results page, but remember that this is the static output you're working with.
In integration tests, you mainly look at the behavior of controller actions, and not at what the user sees and interacts with. This piece of documentation can help you understand what integration tests are: Functional tests for your controllers .
source share