test: update e2e tests

This commit is contained in:
tomasz-io 2024-12-04 15:21:20 -08:00
parent fe7f0d51a2
commit 99fb7c96c1
4 changed files with 30 additions and 14 deletions

View file

@ -19,7 +19,6 @@ gui/**
continue_rc_schema.json
e2e/compiled
test-resources/
.test-extensions
some-folder
e2e/_output
e2e/.test-extensions
e2e/storage

View file

@ -5,6 +5,7 @@ import {
By,
WebElement,
WebDriver,
Key,
} from "vscode-extension-tester";
import { expect } from "chai";
@ -44,7 +45,7 @@ describe("GUI Test", () => {
let driver: WebDriver;
before(async function () {
this.timeout(10000000);
this.timeout(10000);
await new Workbench().executeCommand("continue.focusContinueInput");
@ -59,12 +60,27 @@ describe("GUI Test", () => {
await new EditorView().closeAllEditors();
});
it("Find description", async () => {
it("should display correct panel description", async () => {
const description = await view.findWebElement(
By.xpath("//*[contains(text(), 'Quickly')]"),
);
expect(await description.getText()).has.string(
"Quickly get up and running using our API keys.",
);
});
it("should allow typing text in the editor", async () => {
const tiptap = await view.findWebElement(By.className("tiptap"));
await tiptap.sendKeys("Hello world!");
expect(await tiptap.getText()).has.string("Hello world!");
// Just to show that we can
await tiptap.sendKeys(Key.ENTER);
await new Promise((res) => {
setTimeout(res, 5000);
});
}).timeout(6000);
});

View file

@ -618,11 +618,13 @@
"build:rust": "cargo-cp-artifact -ac sync sync.node -- cargo build --manifest-path ../../sync/Cargo.toml --message-format=json-render-diagnostics",
"build-debug:rust": "npm run build:rust --",
"build-release:rust": "npm run build:rust -- --release",
"compile-ui-tests": "tsc -p ./tsconfig.ui-test.json",
"get-chromedriver": "extest get-chromedriver --storage ./some-folder",
"get-vscode": "extest get-vscode --storage ./some-folder",
"install-vsix": "extest install-vsix -f ./build/continue-0.9.243.vsix --extensions_dir .test-extensions --storage ./some-folder",
"ui-test": "npm run install-vsix && extest run-tests './e2e/compiled/*.test.js' --code_settings settings.json --extensions_dir .test-extensions --storage ./some-folder"
"e2e:compile": "tsc -p ./tsconfig.e2e.json",
"e2e:create-storage": "mkdir -p ./e2e/storage",
"e2e:get-chromedriver": "extest get-chromedriver --storage ./e2e/storage",
"e2e:get-vscode": "extest get-vscode --storage ./e2e/storage && codesign --entitlements entitlements.plist --deep --force -s - './e2e/storage/Visual Studio Code.app'",
"e2e:install-vsix": "extest install-vsix -f ./build/continue-0.9.243.vsix --extensions_dir ./e2e/.test-extensions --storage ./e2e/storage",
"e2e:test": "extest run-tests './e2e/_output/*.test.js' --code_settings settings.json --extensions_dir ./e2e/.test-extensions --storage ./e2e/storage",
"e2e:all": "npm run e2e:compile && npm run e2e:create-storage && npm run e2e:get-chromedriver && npm run e2e:get-vscode && npm run e2e:install-vsix && npm run e2e:test"
},
"devDependencies": {
"@biomejs/biome": "1.6.4",

View file

@ -1,8 +1,8 @@
{
"compilerOptions": {
"module": "Node16",
"module": "CommonJS",
"target": "ES2022",
"outDir": "e2e/compiled",
"outDir": "e2e/_output",
"sourceMap": true,
"strict": true,
"rootDir": "e2e",
@ -12,7 +12,6 @@
"exclude": [
"node_modules",
".vscode-test",
"test-resources",
"e2e/resources/**",
".test-extensions"
],