Commit f6647cc7 authored by Dom Walden's avatar Dom Walden
Browse files

Tool to generate random scenarios for state-based testing of Realtime Preview reload

parent b97a1204
import random
n = 5
modes = ["regular", "manual"]
responses = ["success", "timeout", "no connection"]
methods = ["open", "already opened"]
weights = [50, 50]
mode = "regular"
for i in list(range(n)):
if i >= 3:
mode = random.choice(modes)
if mode == "manual":
modes = ["manual"]
if i > 0:
if mode != "manual":
methods = ["automatic", "button", "shortcut", "close-reopen", "close-reopen with shortcut"]
weights = [50, 10, 10, 10, 10]
else:
methods = ["button", "shortcut", "close-reopen", "close-reopen with shortcut"]
weights = [25, 25, 25, 25]
print("{} {} {}".format(mode, random.choice(responses), random.choices(methods, weights=weights, k=1)[0]))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment