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

Commit237a5d1

Browse files
committed
fix: always use bash when executing web terminal tests
1 parent064a08e commit237a5d1

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

‎site/e2e/helpers.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import{expect,typePage}from"@playwright/test";
1+
import{typeBrowserContext,expect,typePage}from"@playwright/test";
22
importaxiosfrom"axios";
33
import{typeChildProcess,exec,spawn}from"child_process";
44
import{randomUUID}from"crypto";
@@ -445,7 +445,7 @@ const createTemplateVersionTar = async (
445445
resource.agents=resource.agents?.map(
446446
(agent:RecursivePartial<Agent>)=>{
447447
if(agent.apps){
448-
agent.apps=agent.apps?.map((app:RecursivePartial<App>)=>{
448+
agent.apps=agent.apps.map((app)=>{
449449
return{
450450
command:"",
451451
displayName:"example",
@@ -791,3 +791,23 @@ export const updateWorkspaceParameters = async (
791791
state:"visible",
792792
});
793793
};
794+
795+
exportasyncfunctionopenTerminalWindow(
796+
page:Page,
797+
context:BrowserContext,
798+
workspaceName:string,
799+
):Promise<Page>{
800+
// Wait for the web terminal to open in a new tab
801+
constpagePromise=context.waitForEvent("page");
802+
awaitpage.getByTestId("terminal").click();
803+
constterminal=awaitpagePromise;
804+
awaitterminal.waitForLoadState("domcontentloaded");
805+
806+
// Specify that the shell should be `bash`, to prevent inheriting a shell that
807+
// isn't POSIX compatible, such as Fish.
808+
constcommandQuery=`?command=${encodeURIComponent("/usr/bin/env bash")}`;
809+
awaitexpect(terminal).toHaveURL(`/@admin/${workspaceName}.dev/terminal`);
810+
awaitterminal.goto(`/@admin/${workspaceName}.dev/terminal${commandQuery}`);
811+
812+
returnterminal;
813+
}

‎site/e2e/tests/webTerminal.spec.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { randomUUID } from "crypto";
33
import{
44
createTemplate,
55
createWorkspace,
6+
openTerminalWindow,
67
startAgent,
78
stopAgent,
89
}from"../helpers";
@@ -33,14 +34,9 @@ test("web terminal", async ({ context, page }) => {
3334
},
3435
],
3536
});
36-
awaitcreateWorkspace(page,template);
37+
constworkspaceName=awaitcreateWorkspace(page,template);
3738
constagent=awaitstartAgent(page,token);
38-
39-
// Wait for the web terminal to open in a new tab
40-
constpagePromise=context.waitForEvent("page");
41-
awaitpage.getByTestId("terminal").click();
42-
constterminal=awaitpagePromise;
43-
awaitterminal.waitForLoadState("domcontentloaded");
39+
constterminal=awaitopenTerminalWindow(page,context,workspaceName);
4440

4541
awaitterminal.waitForSelector("div.xterm-rows",{
4642
state:"visible",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp