diff --git a/test/appium/tests/conftest.py b/test/appium/tests/conftest.py index c585ea425e..93045e5228 100644 --- a/test/appium/tests/conftest.py +++ b/test/appium/tests/conftest.py @@ -81,6 +81,14 @@ def pytest_addoption(parser): action='store', default=600, help='Running time in seconds') + parser.addoption('--chat_name', + action='store', + default='test_chat', + help='Public chat name') + parser.addoption('--device_number', + action='store', + default=2, + help='Public chat name') # running tests using appium docker instance @@ -251,7 +259,10 @@ def get_testrail_case_id(item): def pytest_runtest_setup(item): - testrail_id = [mark.args[0] for mark in item.iter_markers(name='testrail_id')][0] + try: + testrail_id = [mark.args[0] for mark in item.iter_markers(name='testrail_id')][0] + except IndexError: + pass run_testrail_ids = item.config.getoption("run_testrail_ids") if run_testrail_ids: if str(testrail_id) not in run_testrail_ids: diff --git a/test/appium/tests/test_chatbot.py b/test/appium/tests/test_chatbot.py index f2e00f680b..998dc0e40f 100644 --- a/test/appium/tests/test_chatbot.py +++ b/test/appium/tests/test_chatbot.py @@ -36,7 +36,7 @@ class TestChatBot(SingleDeviceTestCase): chat.chat_message_input.send_keys(message % (counter, key)) chat.send_message_button.click() - @pytest.mark.parametrize('number', list(range(24))) + @pytest.mark.parametrize('number', list(range(int(pytest.config.getoption('device_number'))))) def test_chatbot_public_chat(self, number): sign_in = SignInView(self.driver) home = sign_in.create_user()