Skip to content

Commit 134d676

Browse files
committed
chore: remove py dependency
1 parent d16cda7 commit 134d676

File tree

3 files changed

+25
-45
lines changed

3 files changed

+25
-45
lines changed

src/pytest_selenium/drivers/crossbrowsertesting.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
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
65
import pytest
76

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

114113

115114
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))
115+
return (
116+
f'<video controls="" play-pause-on-click="" poster="{video.get("image")}" style="border:1px solid #e6e6e6;'
117+
'float:right; height:240px; margin-left:5px; overflow:hidden; width:320px">'
118+
f'<source src="{video.get("video")}" type="video/mp4"></source>'
119+
'</video>'
120+
)

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)