-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer-firefox.py
49 lines (39 loc) · 1.45 KB
/
player-firefox.py
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
39
40
41
42
43
44
45
46
47
48
# 01 test simple get of site pages
import sys, getopt
from getpass import getpass
import wait
from time import sleep
from selenium import webdriver
from selenium.webdriver.common.by import By
from webdriver_manager.firefox import GeckoDriverManager
from selenium.webdriver.firefox.service import Service
opts, args = getopt.getopt(sys.argv[1:], "d", ["debug"])
print("Running test " + sys.argv[0])
print("the embedded player requires login")
username = input("username: ")
password = getpass()
# launch
driver = webdriver.Firefox(service=Service(executable_path=GeckoDriverManager().install()))
# login
driver.get('https://zed.dev.reelradio.com/user/main.php')
driver.find_element(by=By.NAME, value='username').send_keys(username)
driver.find_element(by=By.NAME, value='password').send_keys(password)
wait.pause(opts)
driver.find_element(by=By.NAME, value='sublogin').click()
sleep(1)
# load the embedded player
driver.get('https://zed.dev.reelradio.com/ram/embedded_player.html')
sleep(1)
# switch to iframe
iframe = driver.find_element(by=By.ID, value='reel-content')
driver.switch_to.frame(iframe)
wait.pause(opts)
# navigate to a collection and start an exhibit
driver.find_element(by=By.PARTIAL_LINK_TEXT, value='COLLECTIONS').click()
wait.pause(opts)
driver.find_element(by=By.PARTIAL_LINK_TEXT, value='David Adams').click()
wait.pause(opts)
driver.find_element(by=By.PARTIAL_LINK_TEXT, value='Tom Shannon, WKBW Buffalo').click()
wait.pause(opts)
# done
driver.quit()