|
2 | 2 |
|
3 | 3 | ### Index page |
4 | 4 | GET {{baseUrl}}/index.php |
| 5 | +?? status == 200 |
| 6 | +?? header content-type == text/html; charset=UTF-8 |
| 7 | +{{ |
| 8 | +test.hasResponseBody(); |
| 9 | +const assert = require('assert'); |
| 10 | +test('response body has expected title', () => { |
| 11 | +assert(response.body.includes("<title>Full-Text RSS Feeds | from fivefilters.org</title>")); |
| 12 | +}); |
| 13 | +}} |
5 | 14 |
|
6 | 15 |
|
7 | 16 | ### Extract feed with max 1 article |
8 | 17 | GET {{baseUrl}}/makefulltextfeed.php |
9 | 18 | ?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml |
10 | 19 | &max=1 |
11 | 20 | &links=preserve |
| 21 | +?? status == 200 |
| 22 | +?? header content-type == text/xml; charset=UTF-8 |
| 23 | +{{ |
| 24 | +test.hasResponseBody(); |
| 25 | +const assert = require('assert'); |
| 26 | +test('response body has expected content', () => { |
| 27 | + assert(response.body.includes("<link>https://www.tagesschau.de/</link>")); |
| 28 | + assert(response.body.includes('<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/">')); |
| 29 | +}); |
| 30 | + |
| 31 | +const links = []; |
| 32 | +const re = /<link\b[^>]*>([\s\S]*?)<\/link>/gi; |
| 33 | +let m; |
| 34 | +while ((m = re.exec(response.body)) !== null) { |
| 35 | + links.push(m[1].trim()); |
| 36 | +} |
| 37 | +test('response body has two links as expected', () => { |
| 38 | + assert(links.length === 2); |
| 39 | + $global.article=links[1]; |
| 40 | +}); |
| 41 | +}} |
| 42 | + |
12 | 43 |
|
13 | 44 | ### Extract article without images |
14 | 45 | GET {{baseUrl}}/extract.php |
15 | | - ?url=https://en.wikipedia.org/wiki/Vincent_van_Gogh |
| 46 | + ?url={{$global.article}} |
16 | 47 | &images=0 |
| 48 | +?? status == 200 |
| 49 | +?? header content-type == application/json; charset=UTF-8 |
| 50 | +?? body title exists |
| 51 | +?? body excerpt exists |
| 52 | +?? body date exists |
| 53 | +?? body author exists |
| 54 | +?? body language exists |
| 55 | +?? body url exists |
| 56 | +?? body effective_url exists |
| 57 | +?? body domain exists |
| 58 | +?? body word_count exists |
| 59 | +?? body og_url exists |
| 60 | +?? body og_title exists |
| 61 | +?? body og_description exists |
| 62 | +?? body og_image exists |
| 63 | +?? body og_type exists |
| 64 | +?? body twitter_card exists |
| 65 | +?? body twitter_site exists |
| 66 | +?? body twitter_creator exists |
| 67 | +?? body twitter_title exists |
| 68 | +?? body twitter_description exists |
| 69 | +?? body content exists |
| 70 | +?? js response.parsedBody.content.length > 100 |
0 commit comments