Open macabeus opened 7 years ago
You're right @macabeus! We really need to write UI tests and your requirements are correct. Let me try to answer to your questions:
Let's remember the idea of our UI tests: test only the UI. We should not try to test the REST/Socket response from the server in this situation. That's why mocks are more interesting for us. The UI needs to work for all the situations.
Looks like Starscream now supports mocks to test, I'm updating the library in a few, then we can start looking into it: https://github.com/daltoniam/Starscream/pull/311.
Do we want to use Xcode's UI Tests or maybe try something like EarlGrey which allows us to test UI with unit tests?
Anyway, either way it is we will need some kind of mechanism that will allow us to open certain controller right away (skipping .auth or .chat controller at the start) otherwise tests would take way too long. Also it'll increase the PR's checking by a lot :(
Anyway looking forward for that because without UI tests it's really hard to not decrease total tests coverage.
@artrmz I know that Xcode's UI tests are very hard to be done, specially if you've network requests involved. I would say that using a tool like EarlGrey
would resolve our problems. Have you used it already?
@rafaelks Used that a little bit at work, it’s not perfect but worsk quite well. Would have to write some wrapper around EarlGray in case we decide to use something else in the future and make it easier/faster to use. Can take a look at it when I have time but would need some halp/tips how to mock communication.
@artrmz Sure thing, that would be amazing! Let me know when you want to start working on it. 👍
I started to add UI tests in pull request #743 but I noticed that we have some works to do previously. And I have a few questions:
demo.rocket.chat
to always run UI tests, right?In first and second topics, one alternative is to add the command line argument, so that the developer can choose the server and account to run the UI tests but I don't know if it's really necessary. That is, use by default
demo.rocket.chat
and a default account to run tests, and, if developer sets a parameter, use the server/account set by the developer.If anybody has suggestions or other topics to be add feel free to give any kind of feedback please.