From 3101d32d425a7050c9f937ad205f77504f040528 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Sun, 22 Oct 2023 15:48:59 +0100 Subject: [PATCH 1/3] feat: adds data-cy attribute --- agenta-web/src/components/AppSelector/Welcome.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/agenta-web/src/components/AppSelector/Welcome.tsx b/agenta-web/src/components/AppSelector/Welcome.tsx index 3dd67c867c9..70274347d57 100644 --- a/agenta-web/src/components/AppSelector/Welcome.tsx +++ b/agenta-web/src/components/AppSelector/Welcome.tsx @@ -143,7 +143,11 @@ const Welcome: React.FC = ({onWriteOwnApp, onCreateFromTemplate}) => {

The developer-first open source LLMOps platform.

-
+

Quickstart From a Template

From ff798e35ddaca78c59a43258c74636bf04ffb9d4 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Sun, 22 Oct 2023 15:49:02 +0100 Subject: [PATCH 2/3] Add conditional app variant check --- .../cypress/support/commands/evaluations.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/agenta-web/cypress/support/commands/evaluations.ts b/agenta-web/cypress/support/commands/evaluations.ts index fe961743278..26e9dca75d0 100644 --- a/agenta-web/cypress/support/commands/evaluations.ts +++ b/agenta-web/cypress/support/commands/evaluations.ts @@ -7,7 +7,22 @@ Cypress.Commands.add("createVariantsAndTestsets", () => { cy.get('[data-cy="openai-api-input"]').type(`${Cypress.env("OPENAI_API_KEY")}`) cy.get('[data-cy="openai-api-save"]').click() cy.visit("/apps") - cy.get('[data-cy="create-new-app-button"]').click() + + // Check if there are app variants present + cy.request({ + url: `http://localhost/api/organizations/`, + method: "GET", + }).then((res) => { + cy.request({ + url: `http://localhost/api/apps/?org_id=${res.body[0].id}`, + method: "GET", + }).then((resp) => { + if (resp.body.length) { + cy.get('[data-cy="create-new-app-button"]').click() + } + }) + }) + cy.get('[data-cy="create-from-template"]').click() cy.get('[data-cy="create-app-button"]').click() const appName = randString(5) From 2067d2962045aed50fa9d4563ea9932313cea8b8 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Sun, 29 Oct 2023 17:43:54 +0100 Subject: [PATCH 3/3] minor fix --- agenta-web/cypress/support/commands/evaluations.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agenta-web/cypress/support/commands/evaluations.ts b/agenta-web/cypress/support/commands/evaluations.ts index 18fa90572ea..84fe3169b77 100644 --- a/agenta-web/cypress/support/commands/evaluations.ts +++ b/agenta-web/cypress/support/commands/evaluations.ts @@ -14,11 +14,11 @@ Cypress.Commands.add("createVariant", () => { // Check if there are app variants present cy.request({ - url: `http://localhost/api/organizations/`, + url: `${Cypress.env().baseApiURL}/organizations/`, method: "GET", }).then((res) => { cy.request({ - url: `http://localhost/api/apps/?org_id=${res.body[0].id}`, + url: `${Cypress.env().baseApiURL}/apps/?org_id=${res.body[0].id}`, method: "GET", }).then((resp) => { if (resp.body.length) {