Release Vulpes OS 2.7 Preview 25 for Desktop, Android and Pixel 3a
This commit is contained in:
parent
6a44daeaaa
commit
3a1fba4efe
1 changed files with 1301 additions and 196 deletions
|
|
@ -97,11 +97,6 @@ if(!bc){done({missing:true});return;}bc.currentWindowGlobal.getActor('VulpesProb
|
|||
client.execute(
|
||||
"const w=Services.wm.getMostRecentWindow('vulpes:host');w.focus();w.document.getElementById('system').focus();return true;"
|
||||
)
|
||||
subprocess.run(
|
||||
["xdotool", "search", "--name", "^Vulpes", "windowraise", "windowfocus"],
|
||||
check=True,
|
||||
stdout=subprocess.DEVNULL,
|
||||
)
|
||||
|
||||
def tap(app, selector, path="/"):
|
||||
focus()
|
||||
|
|
@ -109,13 +104,24 @@ if(!bc){done({missing:true});return;}bc.currentWindowGlobal.getActor('VulpesProb
|
|||
app,
|
||||
"const e="
|
||||
+ selector
|
||||
+ ';e.scrollIntoView({block:"nearest"});await new Promise(r=>setTimeout(r,150));const b=e.getBoundingClientRect();return {x:mozInnerScreenX+b.x+b.width/2,y:mozInnerScreenY+b.y+b.height/2};',
|
||||
+ ';e.scrollIntoView({block:"nearest"});await new Promise(r=>setTimeout(r,150));const b=e.getBoundingClientRect();return {x:b.x+b.width/2,y:b.y+b.height/2};',
|
||||
path,
|
||||
)
|
||||
subprocess.run(
|
||||
["xdotool", "mousemove", str(round(pos["x"])), str(round(pos["y"])), "click", "1"],
|
||||
check=True,
|
||||
)
|
||||
script = """const done=arguments[arguments.length-1],w=Services.wm.getMostRecentWindow('vulpes:host');
|
||||
const root=w.document.getElementById('system').browsingContext;
|
||||
function find(b){if(b.currentWindowGlobal?.documentURI.spec.startsWith(PREFIX))return b;for(const c of b.children){const match=find(c);if(match)return match;}return null;}
|
||||
const bc=find(root);if(!bc){done({error:'APP_CONTEXT_NOT_FOUND'});return;}
|
||||
bc.currentWindowGlobal.getActor('VulpesProbe').sendQuery('MouseClick',POINT).then(done,error=>done({error:String(error)}));""".replace(
|
||||
"PREFIX", json.dumps("http://" + app + ".localhost:8765" + path)
|
||||
).replace("POINT", json.dumps(pos))
|
||||
result = client.call(
|
||||
"WebDriver:ExecuteAsyncScript",
|
||||
{"script": script, "args": [], "newSandbox": True, "sandbox": "system"},
|
||||
)["value"]
|
||||
if isinstance(result, dict) and "error" in result and not (
|
||||
"AbortError: Actor 'VulpesProbe' destroyed before query" in result["error"]
|
||||
):
|
||||
raise AssertionError(result)
|
||||
time.sleep(0.4)
|
||||
|
||||
def shot(name):
|
||||
|
|
@ -252,6 +258,35 @@ done(canvas.toDataURL());}).catch(e=>done({error:String(e)}));""",
|
|||
"return location.hash==='#alarm-edit-panel' && !!document.querySelector('#alarm-name');",
|
||||
),
|
||||
)
|
||||
for button, value in [
|
||||
("#repeat-menu", "1"),
|
||||
("#sound-menu", "ac_cycle.opus"),
|
||||
("#snooze-menu", "15"),
|
||||
]:
|
||||
tap("clock", "document.querySelector(" + json.dumps(button) + ")")
|
||||
check(
|
||||
"alarm-selector-opens-" + button[1:],
|
||||
wait("clock", "return !!document.querySelector('#vulpes-value-selector [role=option]');"),
|
||||
)
|
||||
tap(
|
||||
"clock",
|
||||
"document.querySelector('#vulpes-value-selector [role=option][data-value="
|
||||
+ json.dumps(value)
|
||||
+ "]')",
|
||||
)
|
||||
tap("clock", "document.querySelector('#vulpes-value-selector [data-action=confirm]')")
|
||||
selector = button.replace("-menu", "-select")
|
||||
check(
|
||||
"alarm-selector-commits-" + button[1:],
|
||||
wait(
|
||||
"clock",
|
||||
"const s=document.querySelector(" + json.dumps(selector) + ");return "
|
||||
+ ("s.selectedOptions.length===1 && s.value===" + json.dumps(value)
|
||||
if selector == "#repeat-select"
|
||||
else "s.value===" + json.dumps(value))
|
||||
+ ";",
|
||||
),
|
||||
)
|
||||
ev(
|
||||
"clock",
|
||||
"document.querySelector('#alarm-name').value="
|
||||
|
|
|
|||
Loading…
Reference in a new issue