29 |
30 |
--------------------------------------------------------------------------------
/docs/layouts/shortcodes/resource.html:
--------------------------------------------------------------------------------
1 | {{ .Get "title" }}
2 |
3 | {{ with .Get "date" }}{{.}} • {{ end }}
4 | {{ .Get "site" }}
5 | {{ with .Get "archive_url" }}• archive{{ end }}
6 | {{ with .Get "translated_url" }}• translated{{ end }}
7 |
--------------------------------------------------------------------------------
/docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "docs",
3 | "private": true,
4 | "dependencies": {
5 | "alpinejs": "^3.13.0"
6 | }
7 | }
--------------------------------------------------------------------------------
/docs/static/bell.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/static/github.svg:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/docs/static/meta/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/meta/android-chrome-192x192.png
--------------------------------------------------------------------------------
/docs/static/meta/android-chrome-256x256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/meta/android-chrome-256x256.png
--------------------------------------------------------------------------------
/docs/static/meta/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/meta/apple-touch-icon.png
--------------------------------------------------------------------------------
/docs/static/meta/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #da532c
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/static/meta/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/meta/favicon-16x16.png
--------------------------------------------------------------------------------
/docs/static/meta/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/meta/favicon-32x32.png
--------------------------------------------------------------------------------
/docs/static/meta/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/meta/favicon.ico
--------------------------------------------------------------------------------
/docs/static/meta/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/meta/mstile-150x150.png
--------------------------------------------------------------------------------
/docs/static/meta/site.webmanifest:
--------------------------------------------------------------------------------
1 | {
2 | "name": "",
3 | "short_name": "",
4 | "icons": [
5 | {
6 | "src": "/meta/android-chrome-192x192.png",
7 | "sizes": "192x192",
8 | "type": "image/png"
9 | },
10 | {
11 | "src": "/meta/android-chrome-256x256.png",
12 | "sizes": "256x256",
13 | "type": "image/png"
14 | }
15 | ],
16 | "theme_color": "#ffffff",
17 | "background_color": "#ffffff",
18 | "display": "standalone"
19 | }
20 |
--------------------------------------------------------------------------------
/docs/static/og.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/og.png
--------------------------------------------------------------------------------
/docs/static/xkcd.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/CloudCannon/pagefind/d7d0b3a0f0eb12661cd2eb894ad02f10687a4ca0/docs/static/xkcd.png
--------------------------------------------------------------------------------
/pagefind/integration_tests/_macros/node.toolproof.macro.yml:
--------------------------------------------------------------------------------
1 | macro: I run Pagefind Node as {file} in {dir}
2 | steps:
3 | - I run "cd %dir% && npm i && PAGEFIND_BINARY_PATH=%toolproof_process_directory%/target/%pagefind_mode%/pagefind node %file%"
4 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/_macros/python.toolproof.macro.yml:
--------------------------------------------------------------------------------
1 | macro: I run Pagefind Python as {file} in {dir}
2 | steps:
3 | - I run "cd %dir% && PAGEFIND_BINARY_PATH=%toolproof_process_directory%/target/%pagefind_mode%/pagefind python3 %file%"
4 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/_macros/run.toolproof.macro.yml:
--------------------------------------------------------------------------------
1 | macro: I run Pagefind
2 | steps:
3 | - I run "%toolproof_process_directory%/target/%pagefind_mode%/pagefind"
4 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/_macros/run_failing.toolproof.macro.yml:
--------------------------------------------------------------------------------
1 | macro: I run a failing Pagefind
2 | steps:
3 | - I run "%toolproof_process_directory%/target/%pagefind_mode%/pagefind" and expect it to fail
4 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/_macros/run_failing_with_flags.toolproof.macro.yml:
--------------------------------------------------------------------------------
1 | macro: I run a failing Pagefind with {flags}
2 | steps:
3 | - I run "%toolproof_process_directory%/target/%pagefind_mode%/pagefind %flags%" and expect it to fail
4 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/_macros/run_with_flags.toolproof.macro.yml:
--------------------------------------------------------------------------------
1 | macro: I run Pagefind with {flags}
2 | steps:
3 | - I run "%toolproof_process_directory%/target/%pagefind_mode%/pagefind %flags%"
4 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/anchors/pagefind-respects-data-pagefind-ignore-inside-anchors.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Anchors > Pagefind respects data-pagefind-ignore inside anchors
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 | let search = await pagefind.search("symbiosis");
9 | let searchdata = await search.results[0].data();
10 | document.querySelector('[data-search]').innerHTML = `
11 |
12 | ${searchdata.sub_results.map(r => `
${r.url}: ${r.title} / '${r.excerpt}'
`).join('')}
13 |
14 | `;
15 | - step: In my browser, the console should be empty
16 | - step: In my browser, I evaluate {js}
17 | js: >-
18 | let val = await
19 | toolproof.querySelector("[data-search]>ul>li:nth-of-type(1)");
20 |
21 | toolproof.assert_eq(val.innerHTML, `/repr/#repr-heading: My Heading about
22 | Symbiosis / 'My Heading about Symbiosis.'`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/anchors/pagefind-returns-all-page-anchors-in-the-fragment.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Anchors > Pagefind returns all page anchors in the fragment
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("pageone");
10 |
11 | let searchdata = await search.results[0].data();
12 |
13 | document.querySelector('[data-search]').innerText =
14 | searchdata.anchors.map(a => `${a.element}#${a.id}: ${a.location}`).join(',
15 | ');
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: >-
19 | let val = await toolproof.querySelector("[data-search]");
20 |
21 | toolproof.assert_eq(val.innerHTML, `h2#cats: 3, ul#list: 4, li#ali: 5,
22 | h2#pagefind: 8`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/anchors/pagefind-returns-all-word-locations-in-the-fragment.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Anchors > Pagefind returns all word locations in the fragment
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("pageone");
10 |
11 | let searchdata = await search.results[0].data();
12 |
13 | document.querySelector('[data-search]').innerText =
14 | searchdata.locations.join(', ');
15 | - step: In my browser, the console should be empty
16 | - step: In my browser, I evaluate {js}
17 | js: |-
18 | let val = await toolproof.querySelector("[data-search]");
19 | toolproof.assert_eq(val.innerHTML, `0, 9`);
20 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/anchors/pagefind-returns-full-content-without-anchors.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Anchors > Pagefind returns full content without anchors
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 | let search = await pagefind.search("pageone");
9 | let searchdata = await search.results[0].data();
10 | document.querySelector('[data-search]').innerText = searchdata.content;
11 | - step: In my browser, the console should be empty
12 | - step: In my browser, I evaluate {js}
13 | js: >-
14 | let val = await toolproof.querySelector("[data-search]");
15 |
16 | toolproof.assert_eq(val.innerHTML, `PageOne, from Pagefind. Cats. Cheeka.
17 | Ali. Theodore. Smudge. Pagefind. PageOne, again, from Pagefind.`);
18 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/anchors/pagefind-returns-page-anchor-content-in-the-fragment.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Anchors > Pagefind returns page anchor content in the fragment
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("pageone");
10 |
11 | let searchdata = await search.results[0].data();
12 |
13 | document.querySelector('[data-search]').innerText =
14 | searchdata.anchors.map(a => `#${a.id}: '${a.text}'`).join(', ');
15 | - step: In my browser, the console should be empty
16 | - step: In my browser, I evaluate {js}
17 | js: >-
18 | let val = await toolproof.querySelector("[data-search]");
19 |
20 | toolproof.assert_eq(val.innerHTML, `#cats: 'Cats', #list: '', #ali: 'Ali',
21 | #pagefind: 'Pagefind'`);
22 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: base > Base Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/base/preload-indexes-then-search-for-a-word.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Tests > Preload indexes then search for a word
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: |-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 | await pagefind.preload("wo");
18 | let search = await pagefind.search("world");
19 |
20 | let data = await search.results[0].data();
21 | document.querySelector('[data-url]').innerText = data.url;
22 | - step: In my browser, the console should be empty
23 | - step: In my browser, I evaluate {js}
24 | js: |-
25 | let val = await toolproof.querySelector("[data-url]");
26 | toolproof.assert_eq(val.innerHTML, `/cat/`);
27 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/base/return-all-results.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Tests > Return all results
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 |
18 | let search = await pagefind.search(null);
19 |
20 |
21 | let pages = await Promise.all(search.results.map(r => r.data()));
22 |
23 | document.querySelector('[data-url]').innerText = pages.map(p =>
24 | p.url).sort().join(", ");
25 | - step: In my browser, the console should be empty
26 | - step: In my browser, I evaluate {js}
27 | js: |-
28 | let val = await toolproof.querySelector("[data-url]");
29 | toolproof.assert_eq(val.innerHTML, `/, /cat/`);
30 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/base/search-for-a-word.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Tests > Search for a word
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: |-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 | let search = await pagefind.search("world");
18 |
19 | let data = await search.results[0].data();
20 | document.querySelector('[data-url]').innerText = data.url;
21 | - step: In my browser, the console should be empty
22 | - step: In my browser, I evaluate {js}
23 | js: |-
24 | let val = await toolproof.querySelector("[data-url]");
25 | toolproof.assert_eq(val.innerHTML, `/cat/`);
26 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/build_options/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: build_options > Build Options > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/characters/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: characters > Character Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/characters/pagefind-can-search-for-a-hyphenated-phrase.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Character Tests > Pagefind can search for a hyphenated phrase
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/ds/index.html" file with the content {html}
5 | html: >-
6 |
The
7 | beet-root
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 |
18 | let search = await pagefind.search("beet-root");
19 |
20 |
21 | let pages = await Promise.all(search.results.map(r => r.data()));
22 |
23 | document.querySelector('[data-result]').innerText = pages.map(p =>
24 | p.url).join(", ");
25 | - step: In my browser, the console should be empty
26 | - step: In my browser, I evaluate {js}
27 | js: |-
28 | let val = await toolproof.querySelector("[data-result]");
29 | toolproof.assert_eq(val.innerHTML, `/ds/`);
30 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/characters/pagefind-doesn-t-match-html-entities-as-their-text.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Character Tests > Pagefind doesn't match HTML entities as their text
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/apiary/index.html" file with the content {html}
5 | html: >-
6 |
The
7 | "bees"
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 |
18 | let search = await pagefind.search("bees");
19 |
20 |
21 | let pages = await Promise.all(search.results.map(r => r.data()));
22 |
23 | document.querySelector('[data-result]').innerText = pages.map(p =>
24 | p.content).join(", ");
25 | - step: In my browser, the console should be empty
26 | - step: In my browser, I evaluate {js}
27 | js: |-
28 | let val = await toolproof.querySelector("[data-result]");
29 | toolproof.assert_eq(val.innerHTML, `The "bees"`);
30 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/characters/pagefind-matches-special-characters.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Character Tests > Pagefind matches special characters
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/apiary/index.html" file with the content {html}
5 | html: >-
6 |
Béës
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 |
18 | let search = await pagefind.search("Béës");
19 |
20 |
21 | let pages = await Promise.all(search.results.map(r => r.data()));
22 |
23 | document.querySelector('[data-result]').innerText = pages.map(p =>
24 | p.url).join(", ");
25 | - step: In my browser, the console should be empty
26 | - step: In my browser, I evaluate {js}
27 | js: |-
28 | let val = await toolproof.querySelector("[data-result]");
29 | toolproof.assert_eq(val.innerHTML, `/apiary/`);
30 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/compound_filtering/filtering-to-a-complex-nested-filter.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering to a complex nested filter
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | await test(pagefind.search("Cat", {
7 | filters: {
8 | any: [{
9 | color: {
10 | any: [{
11 | any: ["Tabby"]
12 | }, {
13 | all: ["Black", "White", "Orange"]
14 | }]
15 | }
16 | }, {
17 | mood: {
18 | all: ["Nervous", "Pining"]
19 | }
20 | }]
21 | }
22 | }));
23 | - step: In my browser, the console should be empty
24 | - step: In my browser, I evaluate {js}
25 | js: |-
26 | let val = await toolproof.querySelector("[data-results]");
27 | toolproof.assert_eq(val.innerHTML, `/ali/, /grey/, /treacle/`);
28 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/compound_filtering/filtering-to-any-of-a-set-of-values-or-another-filter.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering to any of a set of values or another filter
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | await test(pagefind.search("Cat", {
7 | filters: {
8 | any: {
9 | color: {
10 | any: ["Black", "Orange"]
11 | },
12 | mood: "Angry"
13 | }
14 | }
15 | }));
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: >-
19 | let val = await toolproof.querySelector("[data-results]");
20 |
21 | toolproof.assert_eq(val.innerHTML, `/ali/, /cheeka/, /smudge/, /theodore/,
22 | /treacle/`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/compound_filtering/filtering-to-any-of-a-single-filter.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering to any of a single filter
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | await test(pagefind.search("Cat", {
7 | filters: {
8 | color: {
9 | any: ["Black", "Orange"]
10 | }
11 | }
12 | }));
13 | - step: In my browser, the console should be empty
14 | - step: In my browser, I evaluate {js}
15 | js: >-
16 | let val = await toolproof.querySelector("[data-results]");
17 |
18 | toolproof.assert_eq(val.innerHTML, `/cheeka/, /smudge/, /theodore/,
19 | /treacle/`);
20 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/compound_filtering/filtering-with-an-exclusion.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering with an exclusion
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | await test(pagefind.search("Cat", {
7 | filters: {
8 | color: {
9 | any: ["Black", "Orange"]
10 | },
11 | mood: {
12 | not: "Lazy"
13 | }
14 | }
15 | }));
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: |-
19 | let val = await toolproof.querySelector("[data-results]");
20 | toolproof.assert_eq(val.innerHTML, `/smudge/, /theodore/`);
21 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/compound_filtering/filtering-with-top-level-exclusion.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering with top-level exclusion
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | await test(pagefind.search("Cat", {
7 | filters: {
8 | none: [
9 | {
10 | color: {
11 | any: ["Orange", "White"]
12 | }
13 | },
14 | {
15 | mood: "Angry"
16 | }
17 | ]
18 | }
19 | }));
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-results]");
24 | toolproof.assert_eq(val.innerHTML, `/grey/`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/config_sources/settings-can-be-pulled-from-command-line-flags.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > Settings can be pulled from command-line flags
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello.
7 | - macro: I run Pagefind with "--site public"
8 | - step: stdout should contain "Running Pagefind"
9 | - step: The file "public/pagefind/pagefind.js" should not be empty
10 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/config_sources/settings-can-be-pulled-from-environment-variables.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > Settings can be pulled from environment variables
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello.
7 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/config_sources/settings-can-be-pulled-from-json-configuration-files.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > Settings can be pulled from JSON configuration files
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello.
7 | - step: I have a "pagefind.json" file with the content {json}
8 | json: |-
9 | {
10 | "site": "public"
11 | }
12 | - macro: I run Pagefind
13 | - step: stdout should contain "Running Pagefind"
14 | - step: The file "public/pagefind/pagefind.js" should not be empty
15 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/config_sources/settings-can-be-pulled-from-multiple-sources.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > Settings can be pulled from multiple sources
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello.
7 | - step: I have a "pagefind.json" file with the content {json}
8 | json: |-
9 | {
10 | "site": "public"
11 | }
12 | - macro: I run Pagefind with "--output-subdir _out"
13 | - step: stdout should contain "Running Pagefind"
14 | - step: The file "public/_out/pagefind.js" should not be empty
15 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/config_sources/settings-can-be-pulled-from-toml-configuration-files.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > Settings can be pulled from TOML configuration files
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello.
7 | - step: I have a "pagefind.toml" file with the content {toml}
8 | toml: site = "public"
9 | - macro: I run Pagefind
10 | - step: stdout should contain "Running Pagefind"
11 | - step: The file "public/pagefind/pagefind.js" should not be empty
12 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/config_sources/settings-can-be-pulled-from-yaml-configuration-files.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > Settings can be pulled from YAML configuration files
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello.
7 | - step: I have a "pagefind.yml" file with the content {yml}
8 | yml: "site: public"
9 | - macro: I run Pagefind
10 | - step: stdout should contain "Running Pagefind"
11 | - step: The file "public/pagefind/pagefind.js" should not be empty
12 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/debounce/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: debounce > Debounced Searches > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 |
10 |
Nothing
11 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/edge_cases/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: edge_cases > Graceful Pagefind Errors > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/exact_phrase/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: exact_phrase > Exact Phrase Matching > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 |
10 |
Nothing
11 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/exclusions/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: exclusions > Exclusions > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/all-results-are-returned-with-no-filters.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > All results are returned with no filters
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat");
10 |
11 | let data = await Promise.all(search.results.map(result => result.data()));
12 |
13 |
14 | document.querySelector('[data-results]').innerText = data.map(d =>
15 | d.url).sort().join(', ');
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: |-
19 | let val = await toolproof.querySelector("[data-results]");
20 | toolproof.assert_eq(val.innerHTML, `/ali/, /cheeka/, /theodore/`);
21 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filter-counts-are-returned-for-a-given-search-term.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filter counts are returned for a given search term
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 | await pagefind.filters(); // Load filters
9 | let search = await pagefind.search("Ali");
10 | let strings = Object.entries(search.filters).map(([filter, values]) => {
11 | values = Object.entries(values).map(([value, count]) => {
12 | return `${value}(${count})`;
13 | })
14 | return `${filter}:[${values.join(", ")}]`;
15 | });
16 |
17 | document.querySelector('[data-results]').innerText = strings.join(' ');
18 | - step: In my browser, the console should be empty
19 | - step: In my browser, I evaluate {js}
20 | js: >-
21 | let val = await toolproof.querySelector("[data-results]");
22 |
23 | toolproof.assert_eq(val.innerHTML, `color:[Black(0), Orange(0), Tabby(1),
24 | White(0)] mood:[Angry(1)]`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-on-a-search-term-with-no-results-returns-nothing.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering on a search term with no results returns nothing
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Pontification", {
10 | filters: {
11 | color: "Orange"
12 | }
13 | });
14 |
15 |
16 | document.querySelector('[data-results]').innerText =
17 | search.results.length;
18 | - step: In my browser, the console should be empty
19 | - step: In my browser, I evaluate {js}
20 | js: |-
21 | let val = await toolproof.querySelector("[data-results]");
22 | toolproof.assert_eq(val.innerHTML, `0`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-on-tagged-elements.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering on tagged elements
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat", {
10 | filters: {
11 | color: "Orange"
12 | }
13 | });
14 |
15 | let data = await Promise.all(search.results.map(result => result.data()));
16 |
17 |
18 | document.querySelector('[data-results]').innerText = data.map(d =>
19 | d.url).sort().join(', ');
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-results]");
24 | toolproof.assert_eq(val.innerHTML, `/theodore/`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-on-tagged-values.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering on tagged values
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat", {
10 | filters: {
11 | color: "Tabby"
12 | }
13 | });
14 |
15 | let data = await Promise.all(search.results.map(result => result.data()));
16 |
17 |
18 | document.querySelector('[data-results]').innerText = data.map(d =>
19 | d.url).sort().join(', ');
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-results]");
24 | toolproof.assert_eq(val.innerHTML, `/ali/`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-returns-multiple-results.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering returns multiple results
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat", {
10 | filters: {
11 | color: "White"
12 | }
13 | });
14 |
15 | let data = await Promise.all(search.results.map(result => result.data()));
16 |
17 |
18 | document.querySelector('[data-results]').innerText = data.map(d =>
19 | d.url).sort().join(', ');
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-results]");
24 | toolproof.assert_eq(val.innerHTML, `/cheeka/, /theodore/`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-with-an--empty--bogus-filter-does-nothing.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering with an _empty_ bogus filter does nothing
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat", {
10 | filters: {
11 | something_nonexistent: []
12 | }
13 | });
14 |
15 | let data = await Promise.all(search.results.map(result => result.data()));
16 |
17 |
18 | document.querySelector('[data-results]').innerText = data.map(d =>
19 | d.url).sort().join(', ');
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-results]");
24 | toolproof.assert_eq(val.innerHTML, `/ali/, /cheeka/, /theodore/`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-with-an-empty-array-returns-all-results.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering with an empty array returns all results
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat", {
10 | filters: {
11 | color: []
12 | }
13 | });
14 |
15 | let data = await Promise.all(search.results.map(result => result.data()));
16 |
17 |
18 | document.querySelector('[data-results]').innerText = data.map(d =>
19 | d.url).sort().join(', ');
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-results]");
24 | toolproof.assert_eq(val.innerHTML, `/ali/, /cheeka/, /theodore/`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-without-search-term-returns-an-unprocessed-excerpt.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering without search term returns an unprocessed excerpt
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | // Run a search so that some index words are loaded
10 |
11 | let unused = await pagefind.search("cat");
12 |
13 |
14 | let search = await pagefind.search(null, {
15 | filters: {
16 | color: ["Black", "White"]
17 | }
18 | });
19 |
20 | let data = await Promise.all(search.results.map(result => result.data()));
21 |
22 |
23 | document.querySelector('[data-results]').innerText = data.map(d =>
24 | d.excerpt).join(', ');
25 | - step: In my browser, the console should be empty
26 | - step: In my browser, I evaluate {js}
27 | js: |-
28 | let val = await toolproof.querySelector("[data-results]");
29 | toolproof.assert_eq(val.innerHTML, `Black White Cat.`);
30 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filtering-without-search-term-returns-only-filter.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filtering without search term returns only filter
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search(null, {
10 | filters: {
11 | color: "White"
12 | }
13 | });
14 |
15 | let data = await Promise.all(search.results.map(result => result.data()));
16 |
17 |
18 | document.querySelector('[data-results]').innerText = data.map(d =>
19 | d.url).sort().join(', ');
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-results]");
24 | toolproof.assert_eq(val.innerHTML, `/cheeka/, /theodore/`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/filters-can-be-retrieved.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Filters can be retrieved
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 | let filters = await pagefind.filters();
9 | let strings = Object.entries(filters).map(([filter, values]) => {
10 | values = Object.entries(values).map(([value, count]) => {
11 | return `${value}(${count})`;
12 | })
13 | return `${filter}:[${values.join(", ")}]`;
14 | });
15 |
16 | document.querySelector('[data-results]').innerText = strings.join(' ');
17 | - step: In my browser, the console should be empty
18 | - step: In my browser, I evaluate {js}
19 | js: >-
20 | let val = await toolproof.querySelector("[data-results]");
21 |
22 | toolproof.assert_eq(val.innerHTML, `color:[Black(1), Orange(1), Tabby(1),
23 | White(2)] mood:[Angry(1)]`);
24 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/non-existent-filters-return-no-results.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Non-existent filters return no results
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat", {
10 | filters: {
11 | name: "Ali"
12 | }
13 | });
14 |
15 |
16 | document.querySelector('[data-results]').innerText =
17 | search.results.length;
18 | - step: In my browser, the console should be empty
19 | - step: In my browser, I evaluate {js}
20 | js: |-
21 | let val = await toolproof.querySelector("[data-results]");
22 | toolproof.assert_eq(val.innerHTML, `0`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/non-existent-values-return-no-results.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Non-existent values return no results
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("Cat", {
10 | filters: {
11 | color: "Green"
12 | }
13 | });
14 |
15 |
16 | document.querySelector('[data-results]').innerText =
17 | search.results.length;
18 | - step: In my browser, the console should be empty
19 | - step: In my browser, I evaluate {js}
20 | js: |-
21 | let val = await toolproof.querySelector("[data-results]");
22 | toolproof.assert_eq(val.innerHTML, `0`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/total-filter-counts-are-returned-for-a-given-search-term.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Filtering > Total filter counts are returned for a given search term
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | await pagefind.filters(); // Load filters
10 |
11 | let search = await pagefind.search("Cat", {
12 | filters: {
13 | color: "White"
14 | }
15 | });
16 |
17 | let strings = Object.entries(search.totalFilters).map(([filter, values])
18 | => {
19 | values = Object.entries(values).map(([value, count]) => {
20 | return `${value}(${count})`;
21 | })
22 | return `${filter}:[${values.join(", ")}]`;
23 | });
24 |
25 |
26 | document.querySelector('[data-results]').innerText = strings.join(' ');
27 | - step: In my browser, the console should be empty
28 | - step: In my browser, I evaluate {js}
29 | js: >-
30 | let val = await toolproof.querySelector("[data-results]");
31 |
32 | toolproof.assert_eq(val.innerHTML, `color:[Black(1), Orange(1), Tabby(1),
33 | White(2)] mood:[Angry(1)]`);
34 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/filtering/total-unfiltered-result-counts-are-given-for-a-filtered-search-term.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: >-
2 | Filtering > Total unfiltered result counts are given for a filtered search
3 | term
4 | steps:
5 | - ref: ./background.toolproof.yml
6 | - step: In my browser, I evaluate {js}
7 | js: >-
8 | let pagefind = await import("/pagefind/pagefind.js");
9 |
10 |
11 | await pagefind.filters(); // Load filters
12 |
13 | let search = await pagefind.search("Ali", {
14 | filters: {
15 | color: "Orange"
16 | }
17 | });
18 |
19 | document.querySelector('[data-results]').innerText =
20 | `results:${search.results.length} total:${search.unfilteredResultCount}`;
21 | - step: In my browser, the console should be empty
22 | - step: In my browser, I evaluate {js}
23 | js: |-
24 | let val = await toolproof.querySelector("[data-results]");
25 | toolproof.assert_eq(val.innerHTML, `results:0 total:1`);
26 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: frozen-pre-1.0/base > Base Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SOURCE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/base/legacy-search-for-a-word.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Tests > LEGACY Search for a word
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
8 |
9 |
world
10 | - macro: I run Pagefind
11 | - step: stdout should contain "Running Pagefind"
12 | - step: stderr should contain "pre-1.0 compatibility mode"
13 | - step: The file "public/_pagefind/pagefind.js" should not be empty
14 | - step: I serve the directory "public"
15 | - step: In my browser, I load "/"
16 | - step: In my browser, I evaluate {js}
17 | js: |-
18 | let pagefind = await import("/_pagefind/pagefind.js");
19 |
20 | let search = await pagefind.search("world");
21 |
22 | let data = await search.results[0].data();
23 | document.querySelector('[data-url]').innerText = data.url;
24 | - step: In my browser, the console should be empty
25 | - step: In my browser, I evaluate {js}
26 | js: |-
27 | let val = await toolproof.querySelector("[data-url]");
28 | toolproof.assert_eq(val.innerHTML, `/cat/`);
29 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/build_options/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: frozen-pre-1.0/build_options > Build Options > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SOURCE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/config_sources/legacy-settings-can-be-pulled-from-command-line-flags.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > LEGACY Settings can be pulled from command-line flags
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
7 |
8 |
Hello.
9 | - macro: I run Pagefind with "--source public"
10 | - step: stdout should contain "Running Pagefind"
11 | - step: stderr should contain "pre-1.0 compatibility mode"
12 | - step: The file "public/_pagefind/pagefind.js" should not be empty
13 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/config_sources/legacy-settings-can-be-pulled-from-environment-variables.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > LEGACY Settings can be pulled from environment variables
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
7 |
8 |
Hello.
9 | - step: I have the environment variable "PAGEFIND_SOURCE" set to "public"
10 | - macro: I run Pagefind
11 | - step: stdout should contain "Running Pagefind"
12 | - step: stderr should contain "pre-1.0 compatibility mode"
13 | - step: The file "public/_pagefind/pagefind.js" should not be empty
14 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/config_sources/legacy-settings-can-be-pulled-from-json-configuration-files.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > LEGACY Settings can be pulled from JSON configuration files
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
7 |
8 |
Hello.
9 | - step: I have a "pagefind.json" file with the content {json}
10 | json: |-
11 | {
12 | "source": "public"
13 | }
14 | - macro: I run Pagefind
15 | - step: stdout should contain "Running Pagefind"
16 | - step: stderr should contain "pre-1.0 compatibility mode"
17 | - step: The file "public/_pagefind/pagefind.js" should not be empty
18 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/config_sources/legacy-settings-can-be-pulled-from-multiple-sources.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > LEGACY Settings can be pulled from multiple sources
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
7 |
8 |
Hello.
9 | - step: I have a "pagefind.json" file with the content {json}
10 | json: |-
11 | {
12 | "source": "public"
13 | }
14 | - macro: I run Pagefind with "--bundle-dir _out"
15 | - step: stdout should contain "Running Pagefind"
16 | - step: The file "public/_out/pagefind.js" should not be empty
17 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/config_sources/legacy-settings-can-be-pulled-from-toml-configuration-files.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > LEGACY Settings can be pulled from TOML configuration files
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
7 |
8 |
Hello.
9 | - step: I have a "pagefind.toml" file with the content {toml}
10 | toml: source = "public"
11 | - macro: I run Pagefind
12 | - step: stdout should contain "Running Pagefind"
13 | - step: stderr should contain "pre-1.0 compatibility mode"
14 | - step: The file "public/_pagefind/pagefind.js" should not be empty
15 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/config_sources/legacy-settings-can-be-pulled-from-yaml-configuration-files.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Config Sources > LEGACY Settings can be pulled from YAML configuration files
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
7 |
8 |
Hello.
9 | - step: I have a "pagefind.yml" file with the content {yml}
10 | yml: 'source: public'
11 | - macro: I run Pagefind
12 | - step: stdout should contain "Running Pagefind"
13 | - step: stderr should contain "pre-1.0 compatibility mode"
14 | - step: The file "public/_pagefind/pagefind.js" should not be empty
15 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/modular_ui/modular_ui_base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: frozen-pre-1.0/modular_ui/modular_ui_base > Base Modular UI Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SOURCE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
11 |
12 |
24 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/modular_ui/modular_ui_base/legacy-pagefind-modular-ui-loads.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Modular UI Tests > LEGACY Pagefind Modular UI loads
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: stderr should contain "pre-1.0 compatibility mode"
11 | - step: The file "public/_pagefind/pagefind.js" should not be empty
12 | - step: I serve the directory "public"
13 | - step: In my browser, I load "/"
14 | - step: In my browser, the console should be empty
15 | - step: In my browser, I evaluate {js}
16 | js: |-
17 | let el = await toolproof.querySelector("#search input");
18 | toolproof.assert(el);
19 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/modular_ui/modular_ui_base/legacy-pagefind-modular-ui-searches.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Modular UI Tests > LEGACY Pagefind Modular UI searches
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: stderr should contain "pre-1.0 compatibility mode"
11 | - step: The file "public/_pagefind/pagefind.js" should not be empty
12 | - step: I serve the directory "public"
13 | - step: In my browser, I load "/"
14 | - step: In my browser, I evaluate {js}
15 | js: |-
16 | let e = new Event('input', {bubbles:true, cancelable:true});
17 | document.querySelector("#search input").value = "world";
18 | document.querySelector("#search input").dispatchEvent(e);
19 | - step: In my browser, the console should be empty
20 | - step: In my browser, I evaluate {js}
21 | js: |-
22 | let val = await toolproof.querySelector(".pagefind-modular-list-link");
23 | toolproof.assert_eq(val.innerHTML, `world`);
24 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/multilingual/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: frozen-pre-1.0/multilingual > Multilingual > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SOURCE" set to "public"
5 | - step: I have a "public/en/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 | Document
11 |
12 |
13 |
14 |
I am some English documentation
15 |
16 |
17 | - step: I have a "public/pt-br/index.html" file with the content {html}
18 | html: |-
19 |
20 |
21 |
22 | Document
23 |
24 |
25 |
I am a Portuguese document (trust me — quilométricas — see?)
26 |
27 |
28 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/multisite/multisite_base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: frozen-pre-1.0/multisite/multisite_base > Multisite Search > Background
2 | type: reference
3 | steps:
4 | - step: I have a "root/index.html" file with the content {html}
5 | html: >-
6 |
Nothing
8 | - step: I have a "root/website_a/hello/index.html" file with the content {html}
9 | html: >-
10 |
12 |
13 |
web web world PAGEFIND_ROOT_SELECTOR
14 | - step: I have a "root/website_b/lorem/index.html" file with the content {html}
15 | html: >-
16 |
18 |
19 |
web ipsum
20 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/sanity/legacy-cli-tests-are-working.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Sanity Tests > LEGACY CLI tests are working
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
7 |
Nothing
8 | - macro: I run Pagefind with "--source public"
9 | - step: stdout should contain "Running Pagefind"
10 | - step: stderr should contain "pre-1.0 compatibility mode"
11 | - step: stderr should contain "The `source` option is deprecated"
12 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/sanity/legacy-web-tests-are-working.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Sanity Tests > LEGACY Web tests are working
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello!
7 | - step: I serve the directory "public"
8 | - step: In my browser, I load "/"
9 | - step: In my browser, I evaluate {js}
10 | js: |-
11 | let val = await toolproof.querySelector("h1");
12 | toolproof.assert_eq(val.innerHTML, `Hello!`);
13 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/search_options/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: frozen-pre-1.0/search_options > Search Options > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SOURCE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/ui/ui_base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: frozen-pre-1.0/ui/ui_base > Base UI Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SOURCE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
13 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/ui/ui_base/legacy-pagefind-ui-loads.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base UI Tests > LEGACY Pagefind UI loads
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: stderr should contain "pre-1.0 compatibility mode"
11 | - step: The file "public/_pagefind/pagefind.js" should not be empty
12 | - step: I serve the directory "public"
13 | - step: In my browser, I load "/"
14 | - step: In my browser, the console should be empty
15 | - step: In my browser, I evaluate {js}
16 | js: |-
17 | let el = await toolproof.querySelector(".pagefind-ui");
18 | toolproof.assert(el);
19 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/frozen-pre-1.0/ui/ui_base/legacy-pagefind-ui-searches.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base UI Tests > LEGACY Pagefind UI searches
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: stderr should contain "pre-1.0 compatibility mode"
11 | - step: The file "public/_pagefind/pagefind.js" should not be empty
12 | - step: I serve the directory "public"
13 | - step: In my browser, I load "/"
14 | - step: In my browser, I evaluate {js}
15 | js: window.pui.triggerSearch("world");
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: |-
19 | let val = await toolproof.querySelector(".pagefind-ui__result-link");
20 | toolproof.assert_eq(val.innerHTML, `world`);
21 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/highlighting/highlighting_results/highlight-script-is-loaded.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Highlighting Result Tests > Highlight script is loaded
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I load "/words/"
5 | - step: In my browser, I evaluate {js}
6 | js: await new Promise(r => setTimeout(r, 200));
7 | - step: The file "public/pagefind/pagefind-highlight.js" should not be empty
8 | - step: In my browser, the console should be empty
9 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/highlighting/highlighting_search/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: highlighting/highlighting_search > Highlighting Search Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 | - step: I have a "public/a/index.html" file with the content {html}
10 | html: >-
11 |
Hello
12 | World
13 | - step: I have a "public/b/index.html" file with the content {html}
14 | html: >-
15 |
Second
17 |
18 |
Second Page
19 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/highlighting/highlighting_search/multiple-query-parameters-are-inserted-through-the-js-api.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: >-
2 | Highlighting Search Tests > Multiple query parameters are inserted through the
3 | JS API
4 | steps:
5 | - ref: ./background.toolproof.yml
6 | - macro: I run Pagefind
7 | - step: stdout should contain "Running Pagefind"
8 | - step: The file "public/pagefind/pagefind.js" should not be empty
9 | - step: I serve the directory "public"
10 | - step: In my browser, I load "/"
11 | - step: In my browser, I evaluate {js}
12 | js: |-
13 | let pagefind = await import("/pagefind/pagefind.js");
14 | await pagefind.options({ highlightParam: "hi" });
15 |
16 | let search = await pagefind.search("hello world");
17 |
18 | let data = await search.results[0].data();
19 | document.querySelector('[data-url]').innerText = data.url;
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-url]");
24 | toolproof.assert_eq(val.innerHTML, `/a/?hi=hello&hi=world`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/highlighting/highlighting_search/query-parameters-can-be-inserted-through-the-js-api.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: >-
2 | Highlighting Search Tests > Query parameters can be inserted through the JS
3 | API
4 | steps:
5 | - ref: ./background.toolproof.yml
6 | - macro: I run Pagefind
7 | - step: stdout should contain "Running Pagefind"
8 | - step: The file "public/pagefind/pagefind.js" should not be empty
9 | - step: I serve the directory "public"
10 | - step: In my browser, I load "/"
11 | - step: In my browser, I evaluate {js}
12 | js: |-
13 | let pagefind = await import("/pagefind/pagefind.js");
14 | await pagefind.options({ highlightParam: "hi" });
15 |
16 | let search = await pagefind.search("world");
17 |
18 | let data = await search.results[0].data();
19 | document.querySelector('[data-url]').innerText = data.url;
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-url]");
24 | toolproof.assert_eq(val.innerHTML, `/a/?hi=world`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/highlighting/highlighting_search/query-parameters-don-t-conflict-with-subresult-anchors.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: >-
2 | Highlighting Search Tests > Query parameters don't conflict with subresult
3 | anchors
4 | steps:
5 | - ref: ./background.toolproof.yml
6 | - macro: I run Pagefind
7 | - step: stdout should contain "Running Pagefind"
8 | - step: The file "public/pagefind/pagefind.js" should not be empty
9 | - step: I serve the directory "public"
10 | - step: In my browser, I load "/"
11 | - step: In my browser, I evaluate {js}
12 | js: |-
13 | let pagefind = await import("/pagefind/pagefind.js");
14 | await pagefind.options({ highlightParam: "hi" });
15 |
16 | let search = await pagefind.search("second");
17 |
18 | let data = await search.results[0].data();
19 | document.querySelector('[data-url]').innerText = data.sub_results[0].url;
20 | - step: In my browser, the console should be empty
21 | - step: In my browser, I evaluate {js}
22 | js: |-
23 | let val = await toolproof.querySelector("[data-url]");
24 | toolproof.assert_eq(val.innerHTML, `/b/?hi=second#second`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/index_chunking/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: index_chunking > Index Chunking > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/indexing/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: indexing > Indexing > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/input_quirks/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: input_quirks > Input Quirk Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have the environment variable "PAGEFIND_verbose" set to "true"
6 | - step: I have a "public/index.html" file with the content {html}
7 | html: >-
8 |
Nothing
10 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/input_quirks/index-gzipped-input-files.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Input Quirk Tests > Index gzipped input files
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
Hello
7 | World
8 | - step: >-
9 | I run "gzip public/cat/index.html && mv public/cat/index.html.gz
10 | public/cat/index.html"
11 | - macro: I run Pagefind
12 | - step: stdout should contain "Running Pagefind"
13 | - step: The file "public/pagefind/pagefind.js" should not be empty
14 | - step: I serve the directory "public"
15 | - step: In my browser, I load "/"
16 | - step: In my browser, I evaluate {js}
17 | js: |-
18 | let pagefind = await import("/pagefind/pagefind.js");
19 |
20 | let search = await pagefind.search("world");
21 |
22 | let data = await search.results[0].data();
23 | document.querySelector('[data-title]').innerText = data.meta.title;
24 | - step: In my browser, the console should be empty
25 | - step: In my browser, I evaluate {js}
26 | js: |-
27 | let val = await toolproof.querySelector("[data-title]");
28 | toolproof.assert_eq(val.innerHTML, `Hello World`);
29 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/log_levels/error_logs.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Log level > error logs
2 | steps:
3 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
4 |
5 | - macro: I run a failing Pagefind with "--verbose"
6 | - "stdout should contain 'Found 0 files'"
7 | - "stderr should contain 'Error: Pagefind was not able to build an index'"
8 |
9 | - macro: I run a failing Pagefind with "--quiet"
10 | - "stdout should be empty"
11 | - "stderr should contain 'Error: Pagefind was not able to build an index'"
12 |
13 | - macro: I run a failing Pagefind with "--silent"
14 | - "stdout should be empty"
15 | - "stderr should contain 'Error: Pagefind was not able to build an index'"
16 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/log_levels/success_logs.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Log level > success logs
2 | steps:
3 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
4 | - step: I have a "public/index.html" file with the content {html}
5 | html: >-
6 |
Nothing
8 | - step: I have a "public/cat/index.html" file with the content {html}
9 | html: >-
10 |
world
Hello
12 | - step: I have a "public/no-lang/index.html" file with the content {html}
13 | html: >-
14 |
world
15 |
16 | - macro: I run Pagefind with "--verbose"
17 | - "stdout should contain 'unknown: 1 page'"
18 | - 'stderr should contain ''data-pagefind-ignore value of "misc" is not valid'''
19 |
20 | - macro: I run Pagefind with "--quiet && echo done"
21 | - "stdout should be exactly 'done\n'"
22 | - 'stderr should contain ''data-pagefind-ignore value of "misc" is not valid'''
23 |
24 | - macro: I run Pagefind with "--silent && echo complete"
25 | - "stdout should be exactly 'complete\n'"
26 | - stderr should be empty
27 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/default-metadata-can-be-defined.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Default metadata can be defined
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 | let search = await pagefind.search("dog");
9 |
10 | let data = await search.results[0].data();
11 | document.querySelector('[data-result]').innerText = [
12 | data.meta.title,
13 | data.meta.image,
14 | data.meta.animal,
15 | data.meta.vegetable,
16 | data.meta.mineral,
17 | ].join(' | ');
18 | - step: In my browser, the console should be empty
19 | - step: In my browser, I evaluate {js}
20 | js: >-
21 | let val = await toolproof.querySelector("[data-result]");
22 |
23 | toolproof.assert_eq(val.innerHTML, `Dog Post. | /puppy.jpg | dog | generic
24 | | generic`);
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/search-results-return-complex-metadata.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Search results return complex metadata
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("cat");
10 |
11 |
12 | let data = await search.results[0].data();
13 |
14 | document.querySelector('[data-result]').innerText = data.meta.footer + " —
15 | " + data.meta.footer_alt;
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: >-
19 | let val = await toolproof.querySelector("[data-result]");
20 |
21 | toolproof.assert_eq(val.innerHTML, `/cat-footer.png — cat footer
22 | picture`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/search-results-return-generic-information-about-the-page.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Search results return generic information about the page
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("cat");
10 |
11 |
12 | let data = await search.results[0].data();
13 |
14 | document.querySelector('[data-result]').innerText = data.meta.title;
15 |
16 | document.querySelector('[data-result-two]').innerText =
17 | `${data.meta.image} | ${data.meta.image_alt}`;
18 | - step: In my browser, the console should be empty
19 | - step: In my browser, I evaluate {js}
20 | js: |-
21 | let val = await toolproof.querySelector("[data-result]");
22 | toolproof.assert_eq(val.innerHTML, `Cat Post.`);
23 | - step: In my browser, I evaluate {js}
24 | js: |-
25 | let val = await toolproof.querySelector("[data-result-two]");
26 | toolproof.assert_eq(val.innerHTML, `/cat.png | cat picture`);
27 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/search-results-return-highlighted-search-excerpt.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Search results return highlighted search excerpt
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 | let search = await pagefind.search("feline");
9 |
10 | let data = await search.results[0].data();
11 | document.querySelector('[data-result]').innerText = data.excerpt;
12 | - step: In my browser, the console should be empty
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let val = await toolproof.querySelector("[data-result]");
16 |
17 | toolproof.assert_eq(val.innerHTML, `Cat Post. A post about the
18 | <mark>'felines'.</mark> This post has some gnarly things to
19 | test the fragment formatting.`);
20 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/search-results-return-nicely-formatted-content.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Search results return nicely formatted content
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: |-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 | let search = await pagefind.search("feline");
9 |
10 | let data = await search.results[0].data();
11 | document.querySelector('[data-result]').innerText = data.content;
12 | - step: In my browser, the console should be empty
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let val = await toolproof.querySelector("[data-result]");
16 |
17 | toolproof.assert_eq(val.innerHTML, `Cat Post. A post about the 'felines'.
18 | This post has some gnarly things to test the fragment formatting.`);
19 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/search-results-return-tagged-filters.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Search results return tagged filters
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("cat");
10 |
11 |
12 | let data = await search.results[0].data();
13 |
14 | document.querySelector('[data-result]').innerText =
15 | Object.entries(data.filters).map(([f, v]) => `${f}: ${v}`).sort().join(',
16 | ');
17 | - step: In my browser, the console should be empty
18 | - step: In my browser, I evaluate {js}
19 | js: |-
20 | let val = await toolproof.querySelector("[data-result]");
21 | toolproof.assert_eq(val.innerHTML, `animal: cats, title: Cat Post.`);
22 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/search-results-return-tagged-metadata.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Search results return tagged metadata
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("cat");
10 |
11 |
12 | let data = await search.results[0].data();
13 |
14 | document.querySelector('[data-result]').innerText =
15 | data.meta["social-image"] + " — " + data.meta.adjective;
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: |-
19 | let val = await toolproof.querySelector("[data-result]");
20 | toolproof.assert_eq(val.innerHTML, `/kitty.jpg — gnarly`);
21 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/metadata/title-metadata-falls-back-to-the-title-element.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Metadata > Title metadata falls back to the title element
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: In my browser, I evaluate {js}
5 | js: >-
6 | let pagefind = await import("/pagefind/pagefind.js");
7 |
8 |
9 | let search = await pagefind.search("NZ");
10 |
11 |
12 | let data = await Promise.all(search.results.map(result => result.data()));
13 |
14 | document.querySelector('[data-result]').innerText = data.map(d =>
15 | d.meta.title).sort().join(', ');
16 | - step: In my browser, the console should be empty
17 | - step: In my browser, I evaluate {js}
18 | js: |-
19 | let val = await toolproof.querySelector("[data-result]");
20 | toolproof.assert_eq(val.innerHTML, `Website | Kaka, Website | Kea`);
21 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/modular_ui/modular_ui_base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: modular_ui/modular_ui_base > Base Modular UI Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
11 |
12 |
24 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/modular_ui/modular_ui_base/pagefind-modular-ui-loads.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Modular UI Tests > Pagefind Modular UI loads
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, the console should be empty
14 | - step: In my browser, I evaluate {js}
15 | js: |-
16 | let el = await toolproof.querySelector("#search input");
17 | toolproof.assert(el);
18 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/modular_ui/modular_ui_base/pagefind-modular-ui-searches.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base Modular UI Tests > Pagefind Modular UI searches
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: |-
15 | let e = new Event('input', {bubbles:true, cancelable:true});
16 | document.querySelector("#search input").value = "world";
17 | document.querySelector("#search input").dispatchEvent(e);
18 | - step: In my browser, the console should be empty
19 | - step: In my browser, I evaluate {js}
20 | js: |-
21 | let val = await toolproof.querySelector(".pagefind-modular-list-link");
22 | toolproof.assert_eq(val.innerHTML, `world`);
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/multilingual/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: multilingual > Multilingual > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/en/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 | Document
11 |
12 |
13 |
I am some English documentation
14 |
15 |
16 | - step: I have a "public/pt-br/index.html" file with the content {html}
17 | html: |-
18 |
19 |
20 |
21 | Document
22 |
23 |
24 |
I am a Portuguese document (trust me — quilométricas — see?)
25 |
26 |
27 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/multisite/multisite_base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: multisite/multisite_base > Multisite Search > Background
2 | type: reference
3 | steps:
4 | - step: I have a "root/index.html" file with the content {html}
5 | html: >-
6 |
Nothing
8 | - step: I have a "root/website_a/hello/index.html" file with the content {html}
9 | html: >-
10 |
web web world web
11 | PAGEFIND_ROOT_SELECTOR
12 | - step: I have a "root/website_b/lorem/index.html" file with the content {html}
13 | html: >-
14 |
web
15 | ipsum
16 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/multisite/multisite_filters/pagefind-can-search-across-multiple-sites-with-common-filters.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: >-
2 | Multisite Filters > Pagefind can search across multiple sites with common
3 | filters
4 | steps:
5 | - ref: ./background.toolproof.yml
6 | - step: In my browser, I evaluate {js}
7 | js: >-
8 | let pagefind = await import("/website_a/pagefind/pagefind.js");
9 |
10 | await pagefind.mergeIndex("/website_b/pagefind/");
11 |
12 |
13 | let search = await pagefind.search("web", {
14 | filters: {
15 | fruit: "apple"
16 | }
17 | });
18 |
19 |
20 | let pages = await Promise.all(search.results.map(r => r.data()));
21 |
22 | document.querySelector('[data-result]').innerText = pages.map(p =>
23 | p.url).join(", ");
24 | - step: In my browser, the console should be empty
25 | - step: In my browser, I evaluate {js}
26 | js: |-
27 | let val = await toolproof.querySelector("[data-result]");
28 | toolproof.assert_eq(val.innerHTML, `/website_a/hello/`);
29 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/multisite/multisite_filters/pagefind-can-search-across-multiple-sites-with-unique-filters.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: >-
2 | Multisite Filters > Pagefind can search across multiple sites with unique
3 | filters
4 | steps:
5 | - ref: ./background.toolproof.yml
6 | - step: In my browser, I evaluate {js}
7 | js: >-
8 | let pagefind = await import("/website_a/pagefind/pagefind.js");
9 |
10 | await pagefind.mergeIndex("/website_b/pagefind/");
11 |
12 |
13 | let search = await pagefind.search("web", {
14 | filters: {
15 | emote: "happy"
16 | }
17 | });
18 |
19 |
20 | let pages = await Promise.all(search.results.map(r => r.data()));
21 |
22 | document.querySelector('[data-result]').innerText = pages.map(p =>
23 | p.url).join(", ");
24 | - step: In my browser, the console should be empty
25 | - step: In my browser, I evaluate {js}
26 | js: |-
27 | let val = await toolproof.querySelector("[data-result]");
28 | toolproof.assert_eq(val.innerHTML, `/website_b/lorem/`);
29 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/node_api/node_base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: node_api/node_base > Node API Base Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have a "public/index.html" file with the content {html}
5 | html: >-
6 |
Nothing
8 | - step: I have a "public/package.json" file with the content {json}
9 | json: |-
10 | {
11 | "name": "test",
12 | "type": "module",
13 | "version": "1.0.0",
14 | "main": "index.js",
15 | "dependencies": {
16 | "pagefind": "file:%toolproof_process_directory%/wrappers/node"
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/node_api/node_base/close-the-pagefind-backend.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Node API Base Tests > Close the Pagefind backend
2 | platforms:
3 | - linux
4 | - mac
5 |
6 | steps:
7 | - ref: ./background.toolproof.yml
8 | - step: I have a "public/index.js" file with the content {js}
9 | js: |2-
10 | import * as pagefind from "pagefind";
11 |
12 | const run = async () => {
13 | const { index } = await pagefind.createIndex();
14 | const { errors, files } = await index.getFiles();
15 | console.log(files.map(f => f.path).join(', '));
16 | await pagefind.close();
17 | const { errors: es } = await index.getFiles();
18 | console.log(`After close: ${es.join(',')}`);
19 | }
20 | run();
21 | - macro: I run Pagefind Node as "index.js" in "public"
22 | - step: stdout should contain "pagefind.js"
23 | - step: >-
24 | stdout should contain "After close: Invalid index, does not yet exist in
25 | the Pagefind service"
26 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/node_api/node_base/pagefind-empty-index-returns-assets.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Node API Base Tests > Pagefind empty index returns assets
2 | platforms:
3 | - linux
4 | - mac
5 |
6 | steps:
7 | - ref: ./background.toolproof.yml
8 | - step: I have a "public/index.js" file with the content {js}
9 | js: |2-
10 | import * as pagefind from "pagefind";
11 |
12 | const run = async () => {
13 | const { index } = await pagefind.createIndex();
14 | const { errors, files } = await index.getFiles();
15 | console.log(files.map(f => f.path).join(', '));
16 | }
17 | run();
18 | - macro: I run Pagefind Node as "index.js" in "public"
19 | - step: stdout should contain "pagefind.js"
20 | - step: stdout should contain "pagefind-ui.js"
21 | - step: stdout should contain "pagefind-ui.css"
22 | - step: stdout should contain "pagefind-modular-ui.js"
23 | - step: stdout should contain "pagefind-modular-ui.css"
24 | - step: stdout should contain "wasm.unknown.pagefind"
25 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/node_api/node_base/pagefind-error-handling.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Node API Base Tests > Pagefind error handling
2 | platforms:
3 | - linux
4 | - mac
5 |
6 | steps:
7 | - ref: ./background.toolproof.yml
8 | - step: I have a "public/index.js" file with the content {js}
9 | js: |2-
10 | import * as pagefind from "pagefind";
11 |
12 | const bad = async () => {
13 | const { index } = await pagefind.createIndex();
14 | await index.deleteIndex();
15 | const { errors, files } = await index.getFiles();
16 | console.log(JSON.stringify(errors));
17 |
18 | try {
19 | const response = await pagefind.createIndex({
20 | rootSelector: 5
21 | });
22 | } catch(e) {
23 | console.log(e.toString());
24 | }
25 | }
26 | bad();
27 | - macro: I run Pagefind Node as "index.js" in "public"
28 | - step: 'stdout should contain "invalid type: integer `5`"'
29 | - step: >-
30 | stdout should contain "Index has been deleted from the Pagefind service
31 | and no longer exists"
32 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/partial_matching/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: partial_matching > Partial Matching > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/python_api/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | # Requirements:
2 | # venv
3 | # python>=3.11
4 |
5 | name: Python API Setup
6 | type: reference
7 | steps:
8 | - step: I have a "public/index.html" file with the content {html}
9 | html: >-
10 |
Nothing
12 | - step: I run 'python3 -m venv "$PWD/.venv"'
13 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/python_api/py-close-the-pagefind-backend.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Python API > Close the Pagefind backend
2 | platforms:
3 | - linux
4 | - mac
5 |
6 | steps:
7 | - ref: ./background.toolproof.yml
8 | - step: I have a "public/run.py" file with the content {python}
9 | python: |2-
10 | import sys
11 | sys.path.append('%toolproof_process_directory%/wrappers/python/src')
12 |
13 | import asyncio
14 | import json
15 | import logging
16 | import os
17 | from pagefind.index import PagefindIndex, IndexConfig
18 |
19 | async def main():
20 | async with PagefindIndex() as index:
21 | files = await index.get_files()
22 |
23 | for file in files:
24 | print(file["path"])
25 |
26 | await index.delete_index()
27 |
28 | try:
29 | files = await index.get_files()
30 | except AssertionError:
31 | print("errored getting files after close")
32 |
33 | if __name__ == "__main__":
34 | asyncio.run(main())
35 | - macro: I run Pagefind Python as "run.py" in "public"
36 | - step: stdout should contain "pagefind.js"
37 | - step: stdout should contain "pagefind-ui.js"
38 | - step: stdout should contain "errored getting files after close"
39 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/sanity/cli-tests-are-working.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Sanity Tests > CLI tests are working
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html:
a
5 | - macro: I run Pagefind with "--site public"
6 | - step: stdout should contain "Running Pagefind"
7 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/sanity/web-tests-are-working.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Sanity Tests > Web tests are working
2 | steps:
3 | - step: I have a "public/index.html" file with the content {html}
4 | html: >-
5 |
Hello!
7 | - step: I serve the directory "public"
8 | - step: In my browser, I load "/"
9 | - step: In my browser, I evaluate {js}
10 | js: |-
11 | let val = await toolproof.querySelector("h1");
12 | toolproof.assert_eq(val.innerHTML, `Hello!`);
13 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/scoring_defaults/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: scoring_defaults > Result Scoring > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
11 | - step: I have a "public/cat/index.html" file with the content {html}
12 | html: >-
13 |
Happy cat post, that
14 | later mentions dogs in the context of cats
15 | - step: I have a "public/dog/index.html" file with the content {html}
16 | html: >-
17 |
A post about dogs vs
18 | cats (but mainly dogs)
19 | - macro: I run Pagefind
20 | - step: stdout should contain "Running Pagefind"
21 | - step: I serve the directory "public"
22 | - step: In my browser, I load "/"
23 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/search_options/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: search_options > Search Options > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/sentences/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: sentences > Sentence Building Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/sentences/pagefind-joins-block-elements-as-sentences.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Sentence Building Tests > Pagefind joins block elements as sentences
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/apiary/index.html" file with the content {html}
5 | html: >-
6 |
Hello
World
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 |
18 | let search = await pagefind.search("h");
19 |
20 |
21 | let pages = await Promise.all(search.results.map(r => r.data()));
22 |
23 | document.querySelector('[data-result]').innerText = pages.map(p =>
24 | p.content).join(", ");
25 | - step: In my browser, the console should be empty
26 | - step: In my browser, I evaluate {js}
27 | js: |-
28 | let val = await toolproof.querySelector("[data-result]");
29 | toolproof.assert_eq(val.innerHTML, `Hello. World.`);
30 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/sentences/pagefind-treats-br-tags-as-spaces.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Sentence Building Tests > Pagefind treats br tags as spaces
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/apiary/index.html" file with the content {html}
5 | html: >-
6 |
Hello World
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: >-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 |
18 | let search = await pagefind.search("w");
19 |
20 |
21 | let pages = await Promise.all(search.results.map(r => r.data()));
22 |
23 | document.querySelector('[data-result]').innerText = pages.map(p =>
24 | p.content).join(", ");
25 | - step: In my browser, the console should be empty
26 | - step: In my browser, I evaluate {js}
27 | js: |-
28 | let val = await toolproof.querySelector("[data-result]");
29 | toolproof.assert_eq(val.innerHTML, `Hello World.`);
30 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/stemming/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: stemming > Word Stemming > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/stemming/search-is-case-independent.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Word Stemming > Search is case independent
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
the cat is
7 | Meowing
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: |-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 | let search = await pagefind.search("meOWings");
18 |
19 | let data = await search.results[0].data();
20 | document.querySelector('[data-result]').innerText = data.url;
21 | - step: In my browser, the console should be empty
22 | - step: In my browser, I evaluate {js}
23 | js: |-
24 | let val = await toolproof.querySelector("[data-result]");
25 | toolproof.assert_eq(val.innerHTML, `/cat/`);
26 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/stemming/search-is-punctuation-independent.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Word Stemming > Search is punctuation independent
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/apple/index.html" file with the content {html}
5 | html: >-
6 |
My laptop doesn't
7 | have a USB-A port
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: |-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 | let search = await pagefind.search("usb[a");
18 |
19 | let data = await search.results[0].data();
20 | document.querySelector('[data-result]').innerText = data.url;
21 | - step: In my browser, the console should be empty
22 | - step: In my browser, I evaluate {js}
23 | js: |-
24 | let val = await toolproof.querySelector("[data-result]");
25 | toolproof.assert_eq(val.innerHTML, `/apple/`);
26 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/stemming/searching-for-a-word-will-match-against-the-stem-of-that-word.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Word Stemming > Searching for a word will match against the stem of that word
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
the cat is
7 | meowing
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: |-
15 | let pagefind = await import("/pagefind/pagefind.js");
16 |
17 | let search = await pagefind.search("meowed");
18 |
19 | let data = await search.results[0].data();
20 | document.querySelector('[data-result]').innerText = data.url;
21 | - step: In my browser, the console should be empty
22 | - step: In my browser, I evaluate {js}
23 | js: |-
24 | let val = await toolproof.querySelector("[data-result]");
25 | toolproof.assert_eq(val.innerHTML, `/cat/`);
26 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/suggestions/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: suggestions > Spellcheck > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/suggestions/spelling-correction-can-be-returned-for-the-unique-words-in-the-dataset.toolproof.yml:
--------------------------------------------------------------------------------
1 | #TODO: This is an intentionally skipped test — add skipping to toolproof.
2 |
3 | type: reference
4 | name: >-
5 | Spellcheck > Spelling correction can be returned for the unique words in the
6 | dataset
7 | steps:
8 | - ref: ./background.toolproof.yml
9 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/ui/ui_base/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: ui/ui_base > Base UI Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: |-
7 |
8 |
9 |
10 |
13 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/ui/ui_base/pagefind-ui-loads.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base UI Tests > Pagefind UI loads
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, the console should be empty
14 | - step: In my browser, I evaluate {js}
15 | js: |-
16 | let el = await toolproof.querySelector(".pagefind-ui");
17 | toolproof.assert(el);
18 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/ui/ui_base/pagefind-ui-searches.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: Base UI Tests > Pagefind UI searches
2 | steps:
3 | - ref: ./background.toolproof.yml
4 | - step: I have a "public/cat/index.html" file with the content {html}
5 | html: >-
6 |
world
8 | - macro: I run Pagefind
9 | - step: stdout should contain "Running Pagefind"
10 | - step: The file "public/pagefind/pagefind.js" should not be empty
11 | - step: I serve the directory "public"
12 | - step: In my browser, I load "/"
13 | - step: In my browser, I evaluate {js}
14 | js: window.pui.triggerSearch("world");
15 | - step: In my browser, the console should be empty
16 | - step: In my browser, I evaluate {js}
17 | js: |-
18 | let val = await toolproof.querySelector(".pagefind-ui__result-link");
19 | toolproof.assert_eq(val.innerHTML, `world`);
20 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/ui/ui_highlight/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: ui/ui_highlight > Base UI Tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/ui/ui_hooks/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: ui/ui_hooks > UI Hooks > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/ui/ui_scoring/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: ui/ui_scoring > UI Scoring > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/ui/ui_strings/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: ui/ui_strings > UI Test Strings > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/urls/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: urls > URL tests > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |
Nothing
9 | - step: I have a "public/package.json" file with the content {json}
10 | json: |-
11 | {
12 | "name": "test",
13 | "type": "module",
14 | "version": "1.0.0",
15 | "main": "index.js",
16 | "dependencies": {
17 | "pagefind": "file:%toolproof_process_directory%/wrappers/node"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/pagefind/integration_tests/weighting/background.toolproof.yml:
--------------------------------------------------------------------------------
1 | name: weighting > Word Weighting > Background
2 | type: reference
3 | steps:
4 | - step: I have the environment variable "PAGEFIND_SITE" set to "public"
5 | - step: I have a "public/index.html" file with the content {html}
6 | html: >-
7 |