-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: improve e2e test stability and add terminal test case (#1710)
* test: improve exist e2e test case * chore: remove CollaborationModule from startup * test: add terminal case * test: add auto search case * test: improve terminal test case * chore: cd workspace path on terminal * chore: update user key typing delay * chore: update playwright viewport
- Loading branch information
Showing
16 changed files
with
137 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,9 @@ | ||
import { startServer } from '@opensumi/ide-dev-tool/src/server'; | ||
// eslint-disable-next-line import/order | ||
import { CollaborationModule } from '@opensumi/ide-collaboration/lib/node'; | ||
import { ExpressFileServerModule } from '@opensumi/ide-express-file-server/lib/node'; | ||
import { OpenerModule } from '@opensumi/ide-remote-opener/lib/node'; | ||
|
||
import { CommonNodeModules } from '../../src/node/common-modules'; | ||
|
||
startServer({ | ||
modules: [...CommonNodeModules, ExpressFileServerModule, OpenerModule, CollaborationModule], | ||
modules: [...CommonNodeModules, ExpressFileServerModule, OpenerModule], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,44 @@ | ||
import { OpenSumiApp } from './app'; | ||
import { OpenSumiPanel } from './panel'; | ||
|
||
export class OpenSumiSearchView extends OpenSumiPanel { | ||
id = 'search'; | ||
constructor(app: OpenSumiApp) { | ||
super(app, 'search'); | ||
} | ||
|
||
get searchInputSelector() { | ||
return '#search-input-field'; | ||
} | ||
|
||
get replaceInputSelector() { | ||
return '#replace-input-field'; | ||
} | ||
|
||
async getSearchResult() { | ||
let results; | ||
let files; | ||
const resultElement = await this.app.page.waitForSelector('[class*="result_describe__"]'); | ||
const text = await resultElement.textContent(); | ||
const regx = /^(\d+) results found in (\d+) files/gi; | ||
if (text) { | ||
const match = regx.exec(text); | ||
if (match) { | ||
results = Number(match[1]); | ||
files = Number(match[2]); | ||
} | ||
} | ||
return { | ||
results, | ||
files, | ||
}; | ||
} | ||
|
||
async focusOnSearch() { | ||
const visible = await this.isVisible(); | ||
if (!visible) { | ||
await this.open(); | ||
} | ||
const $searchInput = await this.app.page.$(this.searchInputSelector); | ||
await $searchInput?.focus(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { OpenSumiApp } from './app'; | ||
import { OpenSumiPanel } from './panel'; | ||
|
||
export class OpenSumiTerminal extends OpenSumiPanel { | ||
constructor(app: OpenSumiApp) { | ||
super(app, 'terminal'); | ||
} | ||
|
||
async sendText(text: string) { | ||
const visible = await this.isVisible(); | ||
if (!visible) { | ||
await this.open(); | ||
} | ||
await this.focus(); | ||
const box = await this.view?.boundingBox(); | ||
if (box) { | ||
await this.app.page.mouse.click(box.x + box?.width / 2, box.y + box?.height / 2); | ||
} | ||
await this.page.keyboard.type(text); | ||
await this.app.page.keyboard.press('Enter'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters