Update
DevPlace CI / test (push) Has been cancelled

This commit is contained in:
2026-08-10 00:23:20 +02:00
parent 2bdcf6528f
commit 6cac64a3f6
63 changed files with 3499 additions and 68 deletions
+107 -2
View File
@@ -32,6 +32,7 @@ def _workspaces_on():
get_table("tunnels").delete(instance_uid=uid)
get_table("workspace_flags").delete(instance_uid=uid)
instances.delete(uid=uid)
get_table("workspace_editor_prefs").delete()
def _row_for(user: dict) -> dict:
@@ -111,7 +112,7 @@ def test_project_page_shows_a_direct_vscode_button_for_a_running_workspace(alice
page.goto(
f"{BASE_URL}/projects/{project['slug']}", wait_until="domcontentloaded"
)
button = page.locator(".project-detail-actions a:has-text('VS Code')")
button = page.locator(".project-detail-actions a[data-editor-open]")
button.wait_for(state="visible")
expect(button).to_have_attribute("target", "_blank")
expect(button).to_have_attribute(
@@ -129,7 +130,7 @@ def test_direct_vscode_button_is_absent_while_the_workspace_is_stopped(alice):
f"{BASE_URL}/projects/{project['slug']}", wait_until="domcontentloaded"
)
page.locator(".project-detail-actions").wait_for(state="visible")
assert not page.locator(".project-detail-actions a:has-text('VS Code')").count()
assert not page.locator(".project-detail-actions a[data-editor-open]").count()
def _await_workspace_flag(slug: str, key: str, expected: bool) -> bool:
@@ -310,3 +311,107 @@ def test_workspaces_sidebar_link_is_present_for_admin(alice):
link = page.locator(".sidebar-link:has-text('Workspaces')")
link.wait_for(state="visible")
expect(link).to_have_class(re.compile("active"))
def test_the_editor_card_shows_the_resolved_profile_and_its_sources(alice):
page, user = alice
row = _row_for(user)
project = _project_for(row["uid"], "WS Editor Card")
_workspace_for(project, row["uid"])
page.goto(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
card = page.locator(".workspace-editor")
card.wait_for(state="visible")
expect(card.locator(".workspace-editor-summary").first).to_contain_text("devplace-dark")
expect(card.locator(".workspace-editor-resources")).to_contain_text("cores")
expect(card.locator(".workspace-editor-form select[name='theme']")).to_be_visible()
def test_saving_an_editor_preference_changes_its_source_to_the_member(alice):
page, user = alice
row = _row_for(user)
project = _project_for(row["uid"], "WS Editor Save")
_workspace_for(project, row["uid"])
try:
page.goto(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
page.locator(".workspace-editor-form").wait_for(state="visible")
page.select_option(".workspace-editor-form select[name='theme']", "devplace-light")
page.locator(".workspace-editor-actions button[type='submit']").click()
page.wait_for_url(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
summary = page.locator(".workspace-editor-summary").first
summary.wait_for(state="visible")
expect(summary).to_contain_text("devplace-light")
expect(summary).to_contain_text("user")
finally:
get_table("workspace_editor_prefs").delete(owner_id=row["uid"])
def test_resetting_editor_preferences_restores_the_site_default(alice):
page, user = alice
row = _row_for(user)
project = _project_for(row["uid"], "WS Editor Reset")
_workspace_for(project, row["uid"])
try:
page.goto(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
page.locator(".workspace-editor-form").wait_for(state="visible")
page.select_option(".workspace-editor-form select[name='theme']", "devplace-light")
page.locator(".workspace-editor-actions button[type='submit']").click()
page.wait_for_url(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
page.locator(".workspace-editor-reset button").click()
page.wait_for_url(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
summary = page.locator(".workspace-editor-summary").first
summary.wait_for(state="visible")
expect(summary).to_contain_text("devplace-dark")
finally:
get_table("workspace_editor_prefs").delete(owner_id=row["uid"])
def test_the_editor_launch_control_carries_the_window_profile(alice):
page, user = alice
row = _row_for(user)
project = _project_for(row["uid"], "WS Editor Launch")
instance = _workspace_for(project, row["uid"])
page.goto(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
launch = page.locator(".workspace-actions a[data-editor-open]")
launch.wait_for(state="visible")
expect(launch).to_have_attribute("data-editor-mode", "tab")
expect(launch).to_have_attribute("target", "_blank")
expect(launch).to_have_attribute(
"href",
f"/projects/{project['slug']}/containers/instances/{instance['uid']}/code/",
)
def test_the_workspace_help_states_that_every_folder_is_trusted(alice):
page, user = alice
row = _row_for(user)
project = _project_for(row["uid"], "WS Editor Trust")
_workspace_for(project, row["uid"])
page.goto(
f"{BASE_URL}/projects/{project['slug']}/workspace",
wait_until="domcontentloaded",
)
help_card = page.locator(".workspace-help")
help_card.wait_for(state="visible")
expect(help_card).to_contain_text("Restricted Mode")
expect(help_card).to_contain_text("dpc")