- add 'pause' crawl state (fixes #2567) - gracefully shut down crawler pods, and then redis pod when paused - crawler uploads WACZ before shutting down (dependent on webrecorder/browsertrix-crawler#824, supported in 1.6.1+) - add 'paused_at' on crawl spec to indicate when crawl is paused - support max pause time limit, after which crawl becomes automatically stopped. - add 'stopped_pause_expired' when pause automatically expires and crawl is stopped - /crawl/<id>/{pause,resume} apis to toggle 'paused' on crawl spec - ui: add pause/resume button, paused state (partially addresses #2568) - ui: add pausing/resuming derivative states when crawl is running and pausing, or paused and not pausing (partially addresses #2569) - Designed to work with crawler 1.6.1+ which support pausing + uploading on pause Work on #2566, Fixes #2576 --------- Co-authored-by: sua yoo <sua@webrecorder.org> Co-authored-by: Tessa Walsh <tessa@bitarchivist.net> Co-authored-by: sua yoo <sua@suayoo.com>
56 lines
1.3 KiB
Python
56 lines
1.3 KiB
Python
import requests
|
|
|
|
from .conftest import API_PREFIX
|
|
|
|
|
|
def test_api_docs():
|
|
r = requests.get(f"{API_PREFIX}/docs")
|
|
assert r.status_code == 200
|
|
|
|
text = r.text
|
|
assert "<title>Browsertrix API</title>" in text
|
|
assert "/favicon.ico" in text
|
|
assert "/api/openapi.json" in text
|
|
|
|
|
|
def test_api_redoc():
|
|
r = requests.get(f"{API_PREFIX}/redoc")
|
|
assert r.status_code == 200
|
|
|
|
text = r.text
|
|
assert "<title>Browsertrix API</title>" in text
|
|
assert "/favicon.ico" in text
|
|
assert "/api/openapi.json" in text
|
|
|
|
|
|
def test_api_openapi():
|
|
r = requests.get(f"{API_PREFIX}/openapi.json")
|
|
assert r.status_code == 200
|
|
|
|
json = r.json()
|
|
assert json["info"]["title"] == "Browsertrix"
|
|
assert json["info"]["x-logo"]["url"] == "/docs-logo.svg"
|
|
|
|
|
|
def test_api_settings():
|
|
r = requests.get(f"{API_PREFIX}/settings")
|
|
assert r.status_code == 200
|
|
|
|
data = r.json()
|
|
|
|
assert data == {
|
|
"registrationEnabled": False,
|
|
"jwtTokenLifetime": 1440,
|
|
"defaultBehaviorTimeSeconds": 300,
|
|
"maxPagesPerCrawl": 4,
|
|
"numBrowsers": 2,
|
|
"maxScale": 3,
|
|
"defaultPageLoadTimeSeconds": 120,
|
|
"billingEnabled": True,
|
|
"signUpUrl": "",
|
|
"salesEmail": "",
|
|
"supportEmail": "",
|
|
"localesEnabled": None,
|
|
"pausedExpiryMinutes": 10080,
|
|
}
|