Integrate Content Editor and Publication workflow
This commit is contained in:
+10
-10
@@ -57,7 +57,7 @@ def main():
|
||||
work = Path(temp)
|
||||
site = work / "site"
|
||||
shutil.copytree(
|
||||
ROOT / "examples/studio-site", site, ignore=shutil.ignore_patterns(".engine")
|
||||
ROOT / "examples/site-studio", site, ignore=shutil.ignore_patterns(".engine")
|
||||
)
|
||||
env = {
|
||||
"SITE_ROOT": str(site),
|
||||
@@ -69,7 +69,7 @@ def main():
|
||||
"SITE_COOKIE_SECURE": "0",
|
||||
}
|
||||
with patch.dict(os.environ, env), serve(create_app()) as origin, sync_playwright() as pw:
|
||||
browser = pw.chromium.launch(headless=True, args=["--no-sandbox"])
|
||||
browser = pw.chromium.launch(channel="chromium", headless=True, args=["--no-sandbox", "--no-proxy-server"])
|
||||
page = browser.new_page(viewport={"width": 1440, "height": 960})
|
||||
page.on("pageerror", lambda exc: results["console_errors"].append(str(exc)))
|
||||
page.goto(origin + "/admin/login")
|
||||
@@ -82,7 +82,7 @@ def main():
|
||||
("/admin/", "overview"),
|
||||
("/admin/pages", "pages"),
|
||||
("/admin/pages/index", "page"),
|
||||
("/admin/pages/index/blocks/b_hero", "block"),
|
||||
("/admin/pages/index/blocks/hero_home", "block"),
|
||||
("/admin/content", "collections"),
|
||||
("/admin/content/services", "entries"),
|
||||
("/admin/content/services/bots", "entry"),
|
||||
@@ -140,24 +140,24 @@ def main():
|
||||
results["widths"].append([mode + "-dark", width])
|
||||
page.screenshot(path=str(args.out / "expert-dark-mobile.png"))
|
||||
page.goto(origin + "/admin/publish")
|
||||
invoker = page.get_by_role(
|
||||
"button", name="Опубликовать текущий черновик сайта", exact=True
|
||||
)
|
||||
page.locator('[data-pub-action=candidate]').first.click()
|
||||
page.locator('[data-publication-root][aria-busy=false]').wait_for()
|
||||
invoker = page.locator('[data-pub-action=publish]')
|
||||
invoker.click()
|
||||
page.locator("#confirm-dialog").wait_for(state="visible")
|
||||
page.locator("#publication-modal-root dialog[open]").wait_for(state="visible")
|
||||
for _ in range(4):
|
||||
page.keyboard.press("Tab")
|
||||
assert page.locator("#confirm-dialog").evaluate(
|
||||
assert page.locator("#publication-modal-root dialog").evaluate(
|
||||
"(e)=>e.contains(document.activeElement)"
|
||||
)
|
||||
page.keyboard.press("Escape")
|
||||
assert not page.locator("#confirm-dialog").is_visible()
|
||||
assert not page.locator("#publication-modal-root dialog").is_visible()
|
||||
assert invoker.evaluate("(e)=>e===document.activeElement")
|
||||
assert not results["console_errors"], results["console_errors"]
|
||||
browser.close()
|
||||
# Reference is rendered from its own assets, independent of the runtime package.
|
||||
with sync_playwright() as pw:
|
||||
browser = pw.chromium.launch(headless=True, args=["--no-sandbox"])
|
||||
browser = pw.chromium.launch(channel="chromium", headless=True, args=["--no-sandbox", "--no-proxy-server"])
|
||||
page = browser.new_page(viewport={"width": 1440, "height": 960})
|
||||
page.goto((ROOT / "design/antirion-rework.html").as_uri())
|
||||
page.screenshot(path=str(args.out / "reference-antirion.png"), full_page=True)
|
||||
|
||||
Reference in New Issue
Block a user