mirror of
https://gitlab.com/news-flash/article_scraper.git
synced 2025-07-07 16:15:32 +02:00
add new test
This commit is contained in:
parent
c8bc583864
commit
23c156ab2c
3 changed files with 161 additions and 0 deletions
52
resources/tests/readability/dev418/expected.html
Normal file
52
resources/tests/readability/dev418/expected.html
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
<article><DIV id="readability-page-1">
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<h2>
|
||||||
|
Single <img>
|
||||||
|
</h2>
|
||||||
|
<p><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"></p>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<h2>
|
||||||
|
Single <figure>
|
||||||
|
</h2>
|
||||||
|
<figure><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"><figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption></figure><p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<h2>
|
||||||
|
<ul> List of <img>
|
||||||
|
</h2>
|
||||||
|
<ul>
|
||||||
|
<li><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"></li>
|
||||||
|
<li><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"></li>
|
||||||
|
<li><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"></li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr>
|
||||||
|
<h2>
|
||||||
|
<ul> List of <figure>
|
||||||
|
</h2>
|
||||||
|
<ul>
|
||||||
|
<li><figure><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"><figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption></figure></li>
|
||||||
|
<li><figure><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"><figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption></figure></li>
|
||||||
|
<li><figure><img src="http://fakehost/test/base/florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image"><figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption></figure></li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
</DIV></article>
|
104
resources/tests/readability/dev418/source.html
Normal file
104
resources/tests/readability/dev418/source.html
Normal file
|
@ -0,0 +1,104 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>
|
||||||
|
Readability Test
|
||||||
|
</title>
|
||||||
|
<style>
|
||||||
|
<![CDATA[
|
||||||
|
body {
|
||||||
|
font-family: sans-serif;
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 900px;
|
||||||
|
padding: 1em 2em;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
]]>
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>
|
||||||
|
Readability Test
|
||||||
|
</h1>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
<h2>
|
||||||
|
Single <img>
|
||||||
|
</h2>
|
||||||
|
<p>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
<h2>
|
||||||
|
Single <figure>
|
||||||
|
</h2>
|
||||||
|
<figure>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
<figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
<h2>
|
||||||
|
<ul> List of <img>
|
||||||
|
</h2>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
<hr />
|
||||||
|
<h2>
|
||||||
|
<ul> List of <figure>
|
||||||
|
</h2>
|
||||||
|
<ul>
|
||||||
|
<li>
|
||||||
|
<figure>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
<figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<figure>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
<figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<figure>
|
||||||
|
<img src="florian-giorgio-P1U7-ZgKeOM-unsplash.jpg" alt="An image" />
|
||||||
|
<figcaption>
|
||||||
|
Caption of the figure
|
||||||
|
</figcaption>
|
||||||
|
</figure>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<p>
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing 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.
|
||||||
|
</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -161,6 +161,11 @@ async fn data_url_image() {
|
||||||
run_test("data-url-image").await
|
run_test("data-url-image").await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn dev418() {
|
||||||
|
run_test("dev418").await
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn webmd_1() {
|
async fn webmd_1() {
|
||||||
run_test("webmd-1").await
|
run_test("webmd-1").await
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue