Skip to content

Commit 05905a1

Browse files
committed
chore: remove py dependency
1 parent 7c0c8d5 commit 05905a1

File tree

3 files changed

+26
-45
lines changed

3 files changed

+26
-45
lines changed

src/pytest_selenium/drivers/crossbrowsertesting.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# License, v. 2.0. If a copy of the MPL was not distributed with this
33
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

5-
from py.xml import html
5+
import html
66
import pytest
77

88
from pytest_selenium.drivers.cloud import Provider
@@ -113,13 +113,9 @@ def driver_kwargs(request, test, capabilities, **kwargs):
113113

114114

115115
def _video_html(video):
116-
html.__tagspec__.update(dict([(x, 1) for x in ("video", "source")]))
117-
video_attrs = {
118-
"controls": "",
119-
"poster": video.get("image"),
120-
"play-pause-on-click": "",
121-
"style": "border:1px solid #e6e6e6; float:right; height:240px; "
122-
"margin-left:5px; overflow:hidden; width:320px",
123-
}
124-
source_attrs = {"src": video.get("video"), "type": "video/mp4"}
125-
return str(html.video(html.source(**source_attrs), **video_attrs))
116+
return (
117+
f'<video controls="" play-pause-on-click="" poster="{html.escape(video.get("image"))}"'
118+
'style="border:1px solid #e6e6e6; float:right; height:240px; margin-left:5px; overflow:hidden; width:320px">'
119+
f'<source src="{html.escape(video.get("video"))}" type="video/mp4"></source>'
120+
"</video>"
121+
)

src/pytest_selenium/drivers/saucelabs.py

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import os
66
import json
77

8-
from py.xml import html
98
import pytest
109

1110
from pytest_selenium.drivers.cloud import Provider
@@ -151,26 +150,18 @@ def _video_html(session):
151150
session=session
152151
)
153152

154-
return str(
155-
html.div(
156-
html.object(
157-
html.param(value="true", name="allowfullscreen"),
158-
html.param(value="always", name="allowscriptaccess"),
159-
html.param(value="high", name="quality"),
160-
html.param(value="#000000", name="bgcolor"),
161-
html.param(value=flash_vars.replace(" ", ""), name="flashvars"),
162-
width="100%",
163-
height="100%",
164-
type="application/x-shockwave-flash",
165-
data="https://cdn1.saucelabs.com/sauce_skin_deprecated/lib/"
166-
"flowplayer/flowplayer-3.2.17.swf",
167-
name="player_api",
168-
id="player_api",
169-
),
170-
id="player{session}".format(session=session),
171-
style="border:1px solid #e6e6e6; float:right; height:240px;"
172-
"margin-left:5px; overflow:hidden; width:320px",
173-
)
153+
return (
154+
f'<div id="player{session}" style="border:1px solid #e6e6e6; float:right; height:240px; margin-left:5px;'
155+
'overflow:hidden; width:320px">'
156+
'<object data="https://cdn1.saucelabs.com/sauce_skin_deprecated/lib/flowplayer/flowplayer-3.2.17.swf"'
157+
'height="100%" id="player_api" name="player_api" type="application/x-shockwave-flash" width="100%">'
158+
'<param name="allowfullscreen" value="true"/>'
159+
'<param name="allowscriptaccess" value="always"/>'
160+
'<param name="quality" value="high"/>'
161+
'<param name="bgcolor" value="#000000"/>'
162+
f'<param name="flashvars" value="{flash_vars.replace(" ", "")}"/>'
163+
"</object>"
164+
"</div>"
174165
)
175166

176167

src/pytest_selenium/drivers/testingbot.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from hashlib import md5
66

77
import pytest
8-
from py.xml import html
98

109
from pytest_selenium.drivers.cloud import Provider
1110

@@ -107,18 +106,13 @@ def driver_kwargs(request, test, capabilities, host, port, **kwargs):
107106

108107

109108
def _video_html(video_url, session):
110-
return str(
111-
html.div(
112-
html.video(
113-
html.source(src=video_url, type="video/mp4"),
114-
width="100%",
115-
height="100%",
116-
controls="controls",
117-
),
118-
id="mediaplayer{session}".format(session=session),
119-
style="border:1px solid #e6e6e6; float:right; height:240px;"
120-
"margin-left:5px; overflow:hidden; width:320px",
121-
)
109+
return (
110+
f'<div id="mediaplayer{session}" style="border:1px solid #e6e6e6; float:right;'
111+
'height:240px; margin-left:5px; overflow:hidden; width:320px">'
112+
'<video controls="controls" height="100%" width="100%">'
113+
f'<source src="{video_url}" type="video/mp4"></source>'
114+
"</video>"
115+
"</div>"
122116
)
123117

124118

0 commit comments

Comments
 (0)