-
Notifications
You must be signed in to change notification settings - Fork 0
/
steps.py
72 lines (45 loc) · 2.06 KB
/
steps.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import time
from behave import given, when, then
# Steps for scenario: Disable login while having call
@given('user is on page: {page}')
def at_the_page(context, page):
print('drive user to the page: {}'.format(page))
@given('there is popup with text: {text}')
def i_have_popup(context, text):
print('popup with text: {}'.format(text))
@when('user clicks on button: {button_name}')
def user_click_on(context, button_name):
print('user clicked on {} '.format(button_name))
@then('user should see {message}')
def user_should_see(context, message):
print('Assert there is text: {} on page'.format(message))
assert 'Error' == message
# Steps for scenario: Call number
@given("I call number {number}")
def step_impl(context, number):
print("Calling number {}...".format(number))
@given("I wait for {number_sec} seconds")
def step_impl(context, number_sec):
print('Waiting for {} seconds'.format(number_sec))
time.sleep(int(number_sec))
@given("I dial number {dialed_number}")
def step_impl(context, dialed_number):
print('I dialed {}'.format(dialed_number))
assert 0 <= int(dialed_number) < 10
@then("I should find '{log_text}' in log query '{log_query}'")
def step_impl(context, log_text, log_query):
print('Check does query of log: "{}" contains "{}"?'.format(log_query, log_text))
@then("I should hear file {audio_file}")
def step_impl(context, audio_file):
print("Check did you hear file {}".format(audio_file))
assert 'you_dialed_3.wav' == audio_file
@given('I start a call with {participants_count} participants')
def step_impl(context, participants_count):
print('create call with {} participants'.format(participants_count))
@when("I add {new_participants_count} more participants")
def step_impl(context, new_participants_count):
print('Add {} participants to call'.format(new_participants_count))
@then("I have {participants_count} participants in call")
def step_impl(context, participants_count):
print('Now i have {} participants in call'.format(participants_count))
assert 12 == int(participants_count)