Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: always use bash when executing web terminal tests#12755

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
aslilac merged 1 commit intomainfromfix-leaky-terminal-test
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletionssite/e2e/helpers.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
import { expect, type Page } from "@playwright/test";
import {type BrowserContext,expect, type Page } from "@playwright/test";
import axios from "axios";
import { type ChildProcess, exec, spawn } from "child_process";
import { randomUUID } from "crypto";
Expand DownExpand Up@@ -445,7 +445,7 @@ const createTemplateVersionTar = async (
resource.agents = resource.agents?.map(
(agent: RecursivePartial<Agent>) => {
if (agent.apps) {
agent.apps = agent.apps?.map((app: RecursivePartial<App>) => {
agent.apps = agent.apps.map((app) => {
return {
command: "",
displayName: "example",
Expand DownExpand Up@@ -791,3 +791,23 @@ export const updateWorkspaceParameters = async (
state: "visible",
});
};

export async function openTerminalWindow(
page: Page,
context: BrowserContext,
workspaceName: string,
): Promise<Page> {
// Wait for the web terminal to open in a new tab
const pagePromise = context.waitForEvent("page");
await page.getByTestId("terminal").click();
const terminal = await pagePromise;
await terminal.waitForLoadState("domcontentloaded");

// Specify that the shell should be `bash`, to prevent inheriting a shell that
// isn't POSIX compatible, such as Fish.
const commandQuery = `?command=${encodeURIComponent("/usr/bin/env bash")}`;
await expect(terminal).toHaveURL(`/@admin/${workspaceName}.dev/terminal`);
await terminal.goto(`/@admin/${workspaceName}.dev/terminal${commandQuery}`);

return terminal;
}
10 changes: 3 additions & 7 deletionssite/e2e/tests/webTerminal.spec.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,6 +3,7 @@ import { randomUUID } from "crypto";
import {
createTemplate,
createWorkspace,
openTerminalWindow,
startAgent,
stopAgent,
} from "../helpers";
Expand DownExpand Up@@ -33,14 +34,9 @@ test("web terminal", async ({ context, page }) => {
},
],
});
await createWorkspace(page, template);
const workspaceName =await createWorkspace(page, template);
const agent = await startAgent(page, token);

// Wait for the web terminal to open in a new tab
const pagePromise = context.waitForEvent("page");
await page.getByTestId("terminal").click();
const terminal = await pagePromise;
await terminal.waitForLoadState("domcontentloaded");
const terminal = await openTerminalWindow(page, context, workspaceName);

await terminal.waitForSelector("div.xterm-rows", {
state: "visible",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp