feat: create "Diet Analysis" tempalate (#6660)
* feat: create "Diet Analysis" tempalate
* feat: add novita template
* update in template file added tags and description
* Update Diet Analysis.json
* ✨ (Diet Analysis.spec.ts): add integration test for Diet Analysis feature to ensure proper functionality and behavior in the application.
* note-style
---------
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
This commit is contained in:
parent
4ab4e736be
commit
fdaee4c40a
2 changed files with 1309 additions and 0 deletions
File diff suppressed because one or more lines are too long
57
src/frontend/tests/core/integrations/Diet Analysis.spec.ts
Normal file
57
src/frontend/tests/core/integrations/Diet Analysis.spec.ts
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
import { expect, test } from "@playwright/test";
|
||||
import * as dotenv from "dotenv";
|
||||
import path from "path";
|
||||
import { awaitBootstrapTest } from "../../utils/await-bootstrap-test";
|
||||
import { initialGPTsetup } from "../../utils/initialGPTsetup";
|
||||
import { withEventDeliveryModes } from "../../utils/withEventDeliveryModes";
|
||||
|
||||
withEventDeliveryModes(
|
||||
"Diet Analysis",
|
||||
{ tag: ["@release", "@starter-projects"] },
|
||||
async ({ page }) => {
|
||||
test.skip(
|
||||
!process?.env?.NOVITA_API_KEY,
|
||||
"NOVITA_API_KEY required to run this test",
|
||||
);
|
||||
|
||||
if (!process.env.CI) {
|
||||
dotenv.config({ path: path.resolve(__dirname, "../../.env") });
|
||||
}
|
||||
|
||||
await awaitBootstrapTest(page);
|
||||
|
||||
await page.getByTestId("side_nav_options_all-templates").click();
|
||||
await page.getByRole("heading", { name: "Diet Analysis" }).click();
|
||||
|
||||
await page
|
||||
.getByTestId("popover-anchor-input-api_key")
|
||||
.last()
|
||||
.fill(process.env.NOVITA_API_KEY ?? "");
|
||||
|
||||
await page.getByTestId("playground-btn-flow-io").click();
|
||||
|
||||
await page
|
||||
.getByTestId("input-chat-playground")
|
||||
.last()
|
||||
.fill(
|
||||
"I ate a lot of junk food yesterday. What should I do today to improve my diet?",
|
||||
);
|
||||
|
||||
await page.getByTestId("button-send").last().click();
|
||||
|
||||
const stopButton = page.getByRole("button", { name: "Stop" });
|
||||
await stopButton.waitFor({ state: "visible", timeout: 30000 });
|
||||
|
||||
if (await stopButton.isVisible()) {
|
||||
await expect(stopButton).toBeHidden({ timeout: 120000 });
|
||||
}
|
||||
|
||||
const output = await page
|
||||
.getByTestId("div-chat-message")
|
||||
.last()
|
||||
.innerText();
|
||||
expect(output.toLowerCase()).toContain("healthy");
|
||||
expect(output.toLowerCase()).toContain("hydrate");
|
||||
expect(output.length).toBeGreaterThan(500);
|
||||
},
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue