From fe17416c0708c07e4b4de848163e268221c57fa7 Mon Sep 17 00:00:00 2001 From: "Helly Zhang (Centific Technologies Inc)" Date: Mon, 22 Jul 2024 10:22:50 +0800 Subject: [PATCH] test: update ai endpoint --- .github/workflows/ui-test.yml | 2 +- .../ui-test/localdebug/localdebug-aichat-bot-py.test.ts | 4 ++-- .../ui-test/localdebug/localdebug-aichat-bot-ts.test.ts | 4 ++-- .../src/ui-test/localdebug/localdebug-aichat-bot.test.ts | 4 ++-- .../localdebug-chatdata-customize-js-azureopenai.test.ts | 8 ++++---- .../localdebug-chatdata-customize-py-azureopenai.test.ts | 8 ++++---- .../localdebug-chatdata-customize-ts-azureopenai.test.ts | 8 ++++---- ...bug-chatdata-customize-js-azureopenai-win-only.test.ts | 8 ++++---- ...bug-chatdata-customize-py-azureopenai-win-only.test.ts | 8 ++++---- ...bug-chatdata-customize-ts-azureopenai-win-only.test.ts | 8 ++++---- packages/tests/src/utils/playwrightOperation.ts | 4 ++++ 11 files changed, 35 insertions(+), 31 deletions(-) diff --git a/.github/workflows/ui-test.yml b/.github/workflows/ui-test.yml index a57f7d4238..b113db0d56 100644 --- a/.github/workflows/ui-test.yml +++ b/.github/workflows/ui-test.yml @@ -457,7 +457,7 @@ jobs: - name: Upload screenshots uses: actions/upload-artifact@v3 - if: failure() + if: always() with: name: screenshots ${{ matrix.test-case }} ${{ matrix.os }} path: ./packages/tests/.test-resources/screenshots/ diff --git a/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-py.test.ts b/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-py.test.ts index ac3596cc56..23f7236793 100644 --- a/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-py.test.ts +++ b/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-py.test.ts @@ -72,12 +72,12 @@ describe("Local Debug Tests", function () { editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_MODEL_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await createEnvironmentWithPython(); diff --git a/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-ts.test.ts b/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-ts.test.ts index 59a6d7704a..1bb9e21939 100644 --- a/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-ts.test.ts +++ b/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot-ts.test.ts @@ -67,12 +67,12 @@ describe("Local Debug Tests", function () { editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_MODEL_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); diff --git a/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot.test.ts b/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot.test.ts index 3e2b97a900..4d60efb277 100644 --- a/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot.test.ts +++ b/packages/tests/src/ui-test/localdebug/localdebug-aichat-bot.test.ts @@ -65,12 +65,12 @@ describe("Local Debug Tests", function () { editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_MODEL_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); diff --git a/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-js-azureopenai.test.ts b/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-js-azureopenai.test.ts index c64e942f90..0bc572fa7c 100644 --- a/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-js-azureopenai.test.ts +++ b/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-js-azureopenai.test.ts @@ -59,20 +59,20 @@ describe("Local Debug Tests", function () { const azureOpenAiModelDeploymentName = OpenAiKey.azureOpenAiModelDeploymentName ? OpenAiKey.azureOpenAiModelDeploymentName - : "https://test.com"; + : "fake"; const azureOpenAiEndpoint = OpenAiKey.azureOpenAiEndpoint ? OpenAiKey.azureOpenAiEndpoint - : "fake"; + : "https://test.com"; editDotEnvFile(envPath, "SECRET_AZURE_OPENAI_API_KEY", azureOpenAiKey); editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); diff --git a/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-py-azureopenai.test.ts b/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-py-azureopenai.test.ts index 3248cc6bcb..979bcfec41 100644 --- a/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-py-azureopenai.test.ts +++ b/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-py-azureopenai.test.ts @@ -66,20 +66,20 @@ describe("Local Debug Tests", function () { const azureOpenAiModelDeploymentName = OpenAiKey.azureOpenAiModelDeploymentName ? OpenAiKey.azureOpenAiModelDeploymentName - : "https://test.com"; + : "fake"; const azureOpenAiEndpoint = OpenAiKey.azureOpenAiEndpoint ? OpenAiKey.azureOpenAiEndpoint - : "fake"; + : "https://test.com"; editDotEnvFile(envPath, "SECRET_AZURE_OPENAI_API_KEY", azureOpenAiKey); editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_MODEL_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await createEnvironmentWithPython(); diff --git a/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-ts-azureopenai.test.ts b/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-ts-azureopenai.test.ts index afc6101f5a..99e97e3589 100644 --- a/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-ts-azureopenai.test.ts +++ b/packages/tests/src/ui-test/localdebug/localdebug-chatdata-customize-ts-azureopenai.test.ts @@ -60,20 +60,20 @@ describe("Local Debug Tests", function () { const azureOpenAiModelDeploymentName = OpenAiKey.azureOpenAiModelDeploymentName ? OpenAiKey.azureOpenAiModelDeploymentName - : "https://test.com"; + : "fake"; const azureOpenAiEndpoint = OpenAiKey.azureOpenAiEndpoint ? OpenAiKey.azureOpenAiEndpoint - : "fake"; + : "https://test.com"; editDotEnvFile(envPath, "SECRET_AZURE_OPENAI_API_KEY", azureOpenAiKey); editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await startDebugging(DebugItemSelect.DebugInTeamsUsingChrome); diff --git a/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-js-azureopenai-win-only.test.ts b/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-js-azureopenai-win-only.test.ts index 4472d5cec6..b33bd2c3b5 100644 --- a/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-js-azureopenai-win-only.test.ts +++ b/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-js-azureopenai-win-only.test.ts @@ -81,20 +81,20 @@ describe("Remote debug Tests", function () { const azureOpenAiModelDeploymentName = OpenAiKey.azureOpenAiModelDeploymentName ? OpenAiKey.azureOpenAiModelDeploymentName - : "https://test.com"; + : "fake"; const azureOpenAiEndpoint = OpenAiKey.azureOpenAiEndpoint ? OpenAiKey.azureOpenAiEndpoint - : "fake"; + : "https://test.com"; editDotEnvFile(envPath, "SECRET_AZURE_OPENAI_API_KEY", azureOpenAiKey); editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await provisionProject(appName, projectPath); await deployProject(projectPath, Timeout.botDeploy); diff --git a/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-py-azureopenai-win-only.test.ts b/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-py-azureopenai-win-only.test.ts index b9ce47e31d..9fd07e97d6 100644 --- a/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-py-azureopenai-win-only.test.ts +++ b/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-py-azureopenai-win-only.test.ts @@ -83,20 +83,20 @@ describe("Remote debug Tests", function () { const azureOpenAiModelDeploymentName = OpenAiKey.azureOpenAiModelDeploymentName ? OpenAiKey.azureOpenAiModelDeploymentName - : "https://test.com"; + : "fake"; const azureOpenAiEndpoint = OpenAiKey.azureOpenAiEndpoint ? OpenAiKey.azureOpenAiEndpoint - : "fake"; + : "https://test.com"; editDotEnvFile(envPath, "SECRET_AZURE_OPENAI_API_KEY", azureOpenAiKey); editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_MODEL_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await provisionProject(appName, projectPath); await deployProject(projectPath, Timeout.botDeploy); diff --git a/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-ts-azureopenai-win-only.test.ts b/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-ts-azureopenai-win-only.test.ts index 78d943dc49..18f42cc5ec 100644 --- a/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-ts-azureopenai-win-only.test.ts +++ b/packages/tests/src/ui-test/remotedebug/remotedebug-chatdata-customize-ts-azureopenai-win-only.test.ts @@ -82,20 +82,20 @@ describe("Remote debug Tests", function () { const azureOpenAiModelDeploymentName = OpenAiKey.azureOpenAiModelDeploymentName ? OpenAiKey.azureOpenAiModelDeploymentName - : "https://test.com"; + : "fake"; const azureOpenAiEndpoint = OpenAiKey.azureOpenAiEndpoint ? OpenAiKey.azureOpenAiEndpoint - : "fake"; + : "https://test.com"; editDotEnvFile(envPath, "SECRET_AZURE_OPENAI_API_KEY", azureOpenAiKey); editDotEnvFile( envPath, "AZURE_OPENAI_ENDPOINT", - azureOpenAiModelDeploymentName + azureOpenAiEndpoint ); editDotEnvFile( envPath, "AZURE_OPENAI_DEPLOYMENT_NAME", - azureOpenAiEndpoint + azureOpenAiModelDeploymentName ); await provisionProject(appName, projectPath); await deployProject(projectPath, Timeout.botDeploy); diff --git a/packages/tests/src/utils/playwrightOperation.ts b/packages/tests/src/utils/playwrightOperation.ts index d46851d061..b9a8970b23 100644 --- a/packages/tests/src/utils/playwrightOperation.ts +++ b/packages/tests/src/utils/playwrightOperation.ts @@ -1294,6 +1294,10 @@ export async function validateWelcomeAndReplyBot( await frame?.waitForSelector( `p:has-text("${options?.expectedReplyMessage}")` ); + await page.screenshot({ + path: getPlaywrightScreenshotPath("success"), + fullPage: true, + }); console.log( `verify bot successfully with content ${options?.expectedReplyMessage}!!!` );