[Argha, Luiza] Refactoring functional tests to make them more stable on the CI