Fix committ

This commit is contained in:
Tim 2021-05-24 16:56:24 +01:00
parent 755320cb05
commit cfa38297a7
No known key found for this signature in database
GPG Key ID: 3D454289AF831A6D
15 changed files with 25 additions and 11 deletions

View File

@ -8,6 +8,6 @@ step2:
delay: 1
name: clear_preview_controller
step3:
max: 1
min: 1
name: new_service
payload:
text: Show some text
name: trigger_alert

4
scripts/themes.yaml Normal file
View File

@ -0,0 +1,4 @@
---
process_name: themes
step1:
name: get theme list

View File

@ -187,3 +187,12 @@ def controller_item_show(rtc: object, payload: dict) -> None:
print_text('Controller_item_show')
ret = requests.post(rtc.base_url + 'controller/show', json=dict(id=int(id)))
assert ret.status_code == 204, ret.status_code
def trigger_alert(rtc: object, payload: dict) -> None:
p_text = payload['text']
print_text('Trigger_Alert')
ret = requests.post(rtc.base_url + 'plugins/alerts', json=dict(text=p_text))
assert ret.status_code == 204, ret.status_code
##Themes here

View File

@ -23,24 +23,24 @@ init(autoreset=True)
def print_text(text: str):
print(Fore.LIGHTMAGENTA_EX + '[*] = ' + text)
print(Fore.LIGHTMAGENTA_EX + f'[*] {text}')
def print_error(text: str):
print(Fore.RED + '[-] = ' + text)
print(Fore.RED + f'[-] {text}')
def print_ok(text: str):
print(Fore.GREEN + '[_] = ' + text)
print(Fore.GREEN + f'[_] {text}')
def print_warn(text: str):
print(Fore.YELLOW + '[?] = ' + text)
print(Fore.YELLOW + f'[?] {text}')
def print_info(text: str):
print(Fore.MAGENTA + '[!] = ' + text)
print(Fore.MAGENTA + f'[!] {text}')
def print_debug(text: str):
print(Fore.CYAN + '[#] = ' + text)
print(Fore.CYAN + f'[#] {text}')

View File

@ -116,7 +116,8 @@ class RunTestsController(object):
parser = argparse.ArgumentParser()
parser.add_argument('rargs', nargs='*', default=[])
a = parser.parse_args()
with open(a.rargs[0], 'r') as file:
f_open = f'scripts/{a.rargs[0]}'
with open(f_open, 'r') as file:
commands = yaml.load(file, Loader=yaml.FullLoader)
for step in commands:
if step == 'process_name':

View File

@ -27,7 +27,7 @@ def start() -> None:
Instantiate and run the tests.
:return:
"""
print_text('OpenLP - API Test Runner V0_2')
print_text('OpenLP - API Test Runner V0_3')
print_text('Check OpenLP is running')
op_address, op_http_port = check_for_openlp('http')
if not op_http_port: