Skip to content

Instantly share code, notes, and snippets.

View dimacus's full-sized avatar

Dima Kovalenko dimacus

  • Novartis Institutes for BioMedical Research
  • Harrisonburg, VA
View GitHub Profile

📱Valet

A Decentralized Automated Testing Network

🙈 tl;dr:

Valet is a decentralized test automation network where developers run tests on real devices (iOS or Android), and device owners get paid for executing them. Using Nostr for discovery, Lightning for payments, and Raspberry Pi nodes for execution, it’s less expensive, more open, and more scalable than traditional test clouds. Built by Jason Huggins (Selenium, Appium, Sauce Labs), Valet is an experiment in P2P testing at scale. 🚀

require 'rubygems'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:4444/wd/hub", :desired_capabilities => :firefox)
driver.get "http://seleniumhq.org"
sleep 5
driver2 = Selenium::WebDriver.for(:remote, :url => "http://127.0.0.1:4444/wd/hub", :desired_capabilities => :firefox)
GET
/api/v1/hub/config #Grid Hub configuration
/api/v1/proxies #List of all connected proxies
/api/v1/proxies/id #Info on a given connected proxy (Hostname, IP, Version, etc..)
/api/v1/proxies/id/config #Proxy configuration (node.json)
/api/v1/proxies/id/capabilities #Registered capabilities, (Browsers, maxInstances, etc..)
/api/v1/proxies/id/sessions #List of current sessions (possibly previous ones also)
/api/v1/queue #List of new sessions in queue, possibly add DELETE verb to get rid of items in queue that we want removed
trs = selenium.find_elements(:css, "tr");
trs.each -> tr #Storing current loop var in tr
tds = tr.find_elements(:css, "td");
if tds[1] == "user-x"
trs[5].click
def wait_for_ajax
Selenium::WebDriver::Wait.new(:timeout => 60).until do
sleep 1
@selenium.execute_script("return jQuery.active") == 0
end
end
public void waitForAjax() {
#!/bin/bash +e
# allow change to pass-in display argument
DISPLAY=$1
: ${DISPLAY:=:1}
export DISPLAY
echo "=== network before $0 ==="
netstat -na | grep "LISTEN "
echo
#!/bin/bash -e
# allow change to pass-in display argument
DISPLAY=$1
: ${DISPLAY:=:1}
export DISPLAY
echo "Starting VNC server"
vncserver ${DISPLAY} -geometry 1280x1024
{
"capabilities": [
{
"platform": "MAC",
"seleniumProtocol": "WebDriver",
"browserName": "chrome",
"version": 31,
"maxInstances": 3
},
{
{
"theConfigMap": {
"auto_start_hub": "1",
"default_role": "hub",
"node_config_files": [
"node_5555.json"
],
"hub_config": {},
"iedriver": {
"bit": "x64",
class Disappointed
def ಠ_ಠ
puts "DISAPPOINTED!!!"
end
end