mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-07 16:15:32 +02:00
add embedded videos test
This commit is contained in:
parent
8309e227eb
commit
32dd074b6d
3 changed files with 69 additions and 0 deletions
21
resources/tests/readability/embedded-videos/expected.html
Normal file
21
resources/tests/readability/embedded-videos/expected.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<article><DIV id="readability-page-1"><article><h2>Lorem</h2>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
||||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
||||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
<h2>Videos</h2>
|
||||
<p>At root</p>
|
||||
<iframe width="100%" height="100%" src="https://www.youtube.com/embed/LtOGa5M8AuU" frameborder="0" allowfullscreen=""></iframe><iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/LtOGa5M8AuU" frameborder="0" allowfullscreen=""></iframe><iframe src="https://player.vimeo.com/video/32246206?color=ffffff+title=0+byline=0+portrait=0" width="500" height="281" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe><p>In a paragraph</p>
|
||||
<p><iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/LtOGa5M8AuU" frameborder="0" allowfullscreen=""></iframe></p>
|
||||
<p>In a div</p>
|
||||
<div><iframe width="100%" height="100%" src="https://www.youtube.com/embed/LtOGa5M8AuU" frameborder="0" allowfullscreen=""></iframe></div>
|
||||
<h2>Foo</h2>
|
||||
<p>
|
||||
Tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
||||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</p></article></DIV></article>
|
43
resources/tests/readability/embedded-videos/source.html
Normal file
43
resources/tests/readability/embedded-videos/source.html
Normal file
|
@ -0,0 +1,43 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>Embedded videos test</title>
|
||||
</head>
|
||||
<body>
|
||||
<article>
|
||||
<h1>Lorem</h1>
|
||||
<div>
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
|
||||
tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
||||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
|
||||
</div>
|
||||
<h2>Videos</h2>
|
||||
<p>At root</p>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/LtOGa5M8AuU"
|
||||
frameborder="0" allowfullscreen=""></iframe>
|
||||
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/LtOGa5M8AuU"
|
||||
frameborder="0" allowfullscreen=""></iframe>
|
||||
<iframe src="https://player.vimeo.com/video/32246206?color=ffffff+title=0+byline=0+portrait=0"
|
||||
width="500" height="281" frameborder="0"
|
||||
webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
|
||||
<p>In a paragraph</p>
|
||||
<p><iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/LtOGa5M8AuU"
|
||||
frameborder="0" allowfullscreen=""></iframe></p>
|
||||
<p>In a div</p>
|
||||
<div><iframe width="560" height="315" src="https://www.youtube.com/embed/LtOGa5M8AuU"
|
||||
frameborder="0" allowfullscreen=""></iframe></div>
|
||||
<h2>Foo</h2>
|
||||
<div>
|
||||
Tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
|
||||
quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
|
||||
consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
|
||||
cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
|
||||
proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
||||
</div>
|
||||
</article>
|
||||
</body>
|
||||
</html>
|
|
@ -186,6 +186,11 @@ async fn ehow_2() {
|
|||
run_test("ehow-2").await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn embedded_videos() {
|
||||
run_test("embedded-videos").await
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn webmd_1() {
|
||||
run_test("webmd-1").await
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue