mirror of
https://github.com/status-im/status-mobile.git
synced 2025-02-25 23:06:43 +00:00
Added public chat bot
Signed-off-by: yevh-berdnyk <ie.berdnyk@gmail.com>
This commit is contained in:
parent
ac27625410
commit
1c9a3e38b3
@ -83,7 +83,7 @@ def pytest_addoption(parser):
|
|||||||
|
|
||||||
parser.addoption('--public_keys',
|
parser.addoption('--public_keys',
|
||||||
action='store',
|
action='store',
|
||||||
default=None,
|
default='',
|
||||||
help='List of public keys for one-to-one chats')
|
help='List of public keys for one-to-one chats')
|
||||||
parser.addoption('--running_time',
|
parser.addoption('--running_time',
|
||||||
action='store',
|
action='store',
|
||||||
|
@ -5,7 +5,11 @@ from tests.base_test_case import SingleDeviceTestCase
|
|||||||
from random import randint
|
from random import randint
|
||||||
from views.sign_in_view import SignInView
|
from views.sign_in_view import SignInView
|
||||||
|
|
||||||
stop = int(time.time()) + int(pytest.config.getoption('running_time'))
|
running_time = int(pytest.config.getoption('running_time'))
|
||||||
|
messages_number = int(pytest.config.getoption('messages_number'))
|
||||||
|
stop = int(time.time()) + running_time
|
||||||
|
public_keys = pytest.config.getoption('public_keys').split()
|
||||||
|
repeats = 24 / len(public_keys) if public_keys else 0
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.chatbot
|
@pytest.mark.chatbot
|
||||||
@ -14,11 +18,6 @@ class TestChatBot(SingleDeviceTestCase):
|
|||||||
def setup_method(self, method, max_duration=10800):
|
def setup_method(self, method, max_duration=10800):
|
||||||
super(TestChatBot, self).setup_method(method, max_duration=10800)
|
super(TestChatBot, self).setup_method(method, max_duration=10800)
|
||||||
|
|
||||||
if pytest.config.getoption('public_keys'):
|
|
||||||
public_keys = pytest.config.getoption('public_keys').split()
|
|
||||||
repeats = 24 / len(public_keys)
|
|
||||||
|
|
||||||
@pytest.mark.chatbot
|
|
||||||
@pytest.mark.parametrize('key', numpy.repeat(public_keys, repeats))
|
@pytest.mark.parametrize('key', numpy.repeat(public_keys, repeats))
|
||||||
def test_one_to_one_chatbot(self, key):
|
def test_one_to_one_chatbot(self, key):
|
||||||
sign_in = SignInView(self.driver)
|
sign_in = SignInView(self.driver)
|
||||||
@ -36,3 +35,15 @@ class TestChatBot(SingleDeviceTestCase):
|
|||||||
time.sleep(randint(60, 120))
|
time.sleep(randint(60, 120))
|
||||||
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)))
|
||||||
|
def test_chatbot_public_chat(self, number):
|
||||||
|
sign_in = SignInView(self.driver)
|
||||||
|
home = sign_in.create_user()
|
||||||
|
chat_name = pytest.config.getoption('chat_name')
|
||||||
|
chat = home.join_public_chat(chat_name)
|
||||||
|
counter = 0
|
||||||
|
while counter <= messages_number / 24:
|
||||||
|
counter += 1
|
||||||
|
chat.chat_message_input.send_keys('Test message #%s from sender %s' % (counter, number))
|
||||||
|
chat.send_message_button.click()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user