-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
8 changed files
with
163 additions
and
72 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
CRX_PUBLIC_KEY="longCRXPublicKeyToEnsureTheExtensionIdStaysTheSameandOauth2.0WorksNicely" | ||
OAUTH_CLIENT_ID=xxx.apps.googleusercontent.com | ||
PUBLIC_EXTENSION_OS_API_ENDPOINT=https://localhost:3000/v1/chat/completions | ||
PUBLIC_EXTENSION_OS_API_ENDPOINT=https://localhost:3000/v1/chat/completions | ||
E2E_TEST_GROQ_KEY="yourapikey:thisisusedforE2ETestingOnly" |
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,7 +1,7 @@ | ||
{ | ||
"name": "extension-os", | ||
"displayName": "Extension-OS: Your AI Partner", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "AI at Your Fingertips, Anytime, Anywhere.", | ||
"author": "[email protected]", | ||
"scripts": { | ||
|
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { test, expect } from "./fixtures"; | ||
const groqKey = process.env.E2E_TEST_GROQ_KEY; | ||
|
||
test("be able to use groq and succesfully execute a query", async ({ | ||
page, | ||
}) => { | ||
await page.waitForTimeout(300); | ||
const pageTitle = await page.title(); | ||
await expect(pageTitle).toBe("Extension-OS: Your AI Partner"); | ||
await page.click("#llm-provider"); | ||
await page.click('div[role="option"] >> text="Groq"'); | ||
await expect(page.locator("#llm-model > span")).toHaveText( | ||
"llama-3.1-70b-versatile" | ||
); | ||
|
||
const llmKeyInput = await page.locator("#llm-key"); // Changed from getById to locator | ||
await llmKeyInput.fill(groqKey); | ||
|
||
await page.goto("https://www.york.ac.uk/teaching/cws/wws/webpage1.html"); | ||
const pageTitle2 = await page.title(); | ||
await expect(pageTitle2).toBe("webpage1"); | ||
await page.mouse.move(100, 100); // Move the mouse to the starting position (x: 100, y: 100) | ||
await page.mouse.down(); // Press the mouse button down to start selecting | ||
await page.mouse.move(200, 120); // Move the mouse to the end position (x: 300, y: 300) to select text | ||
await page.mouse.up(); // Release the mouse button to complete the selection | ||
|
||
const options = await page.getByRole("option"); | ||
const optionsCount = await options.count(); | ||
//Must be 7 as you have to count the +2 (separator + Setup Your Own Prompt) | ||
// expect(optionsCount).toBe(7); | ||
await page.click('role=option[name="❗Grammar Fixer"]'); | ||
await page.waitForSelector("#success", { state: "visible" }); | ||
}); | ||
|
||
test("be able to use default localhost and succesfully execute a query", async ({ | ||
page, | ||
}) => { | ||
await page.waitForTimeout(300); | ||
const pageTitle = await page.title(); | ||
await expect(pageTitle).toBe("Extension-OS: Your AI Partner"); | ||
await page.click("#llm-provider"); | ||
await page.click('div[role="option"] >> text="Localhost"'); | ||
const modelText = await page.locator("#llm-model").inputValue(); // Retrieve the text from the input | ||
await expect(modelText).toBe("llama3"); // | ||
|
||
await page.goto("https://www.york.ac.uk/teaching/cws/wws/webpage1.html"); | ||
const pageTitle2 = await page.title(); | ||
await expect(pageTitle2).toBe("webpage1"); | ||
await page.mouse.move(100, 100); // Move the mouse to the starting position (x: 100, y: 100) | ||
await page.mouse.down(); // Press the mouse button down to start selecting | ||
await page.mouse.move(200, 120); // Move the mouse to the end position (x: 300, y: 300) to select text | ||
await page.mouse.up(); // Release the mouse button to complete the selection | ||
|
||
const options = await page.getByRole("option"); | ||
const optionsCount = await options.count(); | ||
//Must be 7 as you have to count the +2 (separator + Setup Your Own Prompt) | ||
// expect(optionsCount).toBe(7); | ||
await page.click('role=option[name="❗Grammar Fixer"]'); | ||
await page.waitForSelector("#success", { state: "visible" }); | ||
}); |