This repository was archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathenvironment.py
More file actions
38 lines (29 loc) · 1.31 KB
/
environment.py
File metadata and controls
38 lines (29 loc) · 1.31 KB
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
from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
import requests
import subprocess
username = "you@yourdomain.com"
authkey = "yourauthkey"
def before_feature(context, feature):
caps = {}
caps['name'] = 'Behave Example'
caps['build'] = '1.0'
caps['browserName'] = "Chrome" # pulls the latest version of Chrome by default
caps['platform'] = "Windows 10" # to specify a version, add caps['version'] = "desired version"
caps['screen_resolution'] = '1366x768'
caps['record_video'] = 'true'
caps['record_network'] = 'false'
caps['take_snapshot'] = 'true'
context.api_session = requests.Session()
context.api_session.auth = (username, authkey)
# cmd = "cbt_tunnels --username " + username + " --authkey " + authkey + " --ready tunnel_ready asadmin"
# context.tunnel_proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)
context.driver = webdriver.Remote(
desired_capabilities=caps,
command_executor="http://%s:%s@hub.crossbrowsertesting.com:80/wd/hub"%(username, authkey)
)
def after_feature(context, feature):
context.driver.quit()
# subprocess.Popen.terminate(context.tunnel_proc)