Chatbot fix

Signed-off-by: Serhy <sergii@status.im>
This commit is contained in:
Anton Danchenko 2019-06-03 15:02:39 +03:00 committed by Serhy
parent eef777175e
commit adb90e35de
No known key found for this signature in database
GPG Key ID: 5D7C4B9E2B6F500B
2 changed files with 13 additions and 2 deletions

View File

@ -81,6 +81,14 @@ def pytest_addoption(parser):
action='store', action='store',
default=600, default=600,
help='Running time in seconds') 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 # running tests using appium docker instance
@ -251,7 +259,10 @@ def get_testrail_case_id(item):
def pytest_runtest_setup(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") run_testrail_ids = item.config.getoption("run_testrail_ids")
if run_testrail_ids: if run_testrail_ids:
if str(testrail_id) not in run_testrail_ids: if str(testrail_id) not in run_testrail_ids:

View File

@ -36,7 +36,7 @@ class TestChatBot(SingleDeviceTestCase):
chat.chat_message_input.send_keys(message % (counter, key)) chat.chat_message_input.send_keys(message % (counter, key))
chat.send_message_button.click() 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): def test_chatbot_public_chat(self, number):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home = sign_in.create_user() home = sign_in.create_user()