Create ollama e2e test (#296)

This commit is contained in:
Will Chen
2025-05-31 22:01:48 -07:00
committed by GitHub
parent efb814ec95
commit af7d6fa9f8
6 changed files with 103 additions and 3 deletions

View File

@@ -73,6 +73,13 @@ class PageObject {
await this.page.getByText("test-model").click();
}
async selectTestOllamaModel() {
await this.page.getByRole("button", { name: "Model: Auto" }).click();
await this.page.getByText("Local models").click();
await this.page.getByText("Ollama", { exact: true }).click();
await this.page.getByText("Testollama", { exact: true }).click();
}
async setUpTestProvider() {
await this.page.getByText("Add custom providerConnect to").click();
// Fill out provider dialog
@@ -201,6 +208,7 @@ export const test = base.extend<{
const latestBuild = findLatestBuild();
// parse the directory and find paths and other info
const appInfo = parseElectronApp(latestBuild);
process.env.OLLAMA_HOST = "http://localhost:3500/ollama";
process.env.E2E_TEST_BUILD = "true";
// This is just a hack to avoid the AI setup screen.
process.env.OPENAI_API_KEY = "sk-test";

7
e2e-tests/ollama.spec.ts Normal file
View File

@@ -0,0 +1,7 @@
import { test } from "./helpers/test_helper";
test("send message to ollama", async ({ po }) => {
await po.selectTestOllamaModel();
await po.sendPrompt("hi");
await po.snapshotMessages();
});

View File

@@ -0,0 +1,4 @@
- paragraph: hi
- paragraph: ollamachunkollamachunk
- button "Retry":
- img