From e32b4d8663959375168e3d001c859d35669c9359 Mon Sep 17 00:00:00 2001 From: Pedro de Oliveira Guedes Date: Tue, 18 Jan 2022 11:30:58 -0300 Subject: [PATCH] Adding new tests. --- api/replay/features/replay.feature | 14 +++++++++++++- api/replay/features/steps/steps.py | 18 +++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/api/replay/features/replay.feature b/api/replay/features/replay.feature index 21c4bd9..7fc835f 100644 --- a/api/replay/features/replay.feature +++ b/api/replay/features/replay.feature @@ -14,4 +14,16 @@ Feature: The Replay API client # Since this is a remote repository, it is impossible to test the config getters methods. - # They have to be runned inside a local repository wich contains Replay, so, unfortunatelly, they will not be tested, at least not for now. \ No newline at end of file + # They have to be runned inside a local repository wich contains Replay, so, unfortunatelly, they will not be tested, at least not for now. + + + #It is also not possible to test the open_app method for the same reasons as above. + + + Scenario: Testing the menu_get_all_enabled method. + Given the Replay client + When the menu_get_all_enabled method is called + Then there must be a list as a return + + + # Given the fact that the methods "service_stop_all" and "exit" will break the tests chain, they cannot be tested. \ No newline at end of file diff --git a/api/replay/features/steps/steps.py b/api/replay/features/steps/steps.py index aa596b8..6d74565 100644 --- a/api/replay/features/steps/steps.py +++ b/api/replay/features/steps/steps.py @@ -37,4 +37,20 @@ def step_impl(context): # ============================= CONFIGURATION GETTERS ============================= # Since this is a remote repository, it is impossible to test the config getters methods. - # They have to be runned inside a local repository wich contains Replay, so, unfortunatelly, they will not be tested, at least not for now. \ No newline at end of file + # They have to be runned inside a local repository wich contains Replay, so, unfortunatelly, they will not be tested, at least not for now. + + + +# ============================= OPEN APP ============================= + #It is also not possible to test the open_app method for the same reasons as above. + + + +# ============================= GET ALL ENABLED MENUS ============================= +@when(u'the menu_get_all_enabled method is called') +def step_impl(context): + context.all_menus_return = context.client.menu_get_all_enabled() + +@then(u'there must be a list as a return') +def step_impl(context): + assert type(context.all_menus_return) == type([]), "Something went wrong getting the enabled menus." \ No newline at end of file