diff --git a/.github/workflows/deploy-waf.yml b/.github/workflows/deploy-waf.yml
index 0ed79c84..0a339425 100644
--- a/.github/workflows/deploy-waf.yml
+++ b/.github/workflows/deploy-waf.yml
@@ -1,11 +1,11 @@
-name: Validate WAF Deployment
+name: Validate WAF Deployment
on:
push:
branches:
- main
schedule:
- - cron: '0 11,23 * * *' # Runs at 11:00 AM and 11:00 PM GMT
+ - cron: "0 11,23 * * *" # Runs at 11:00 AM and 11:00 PM GMT
jobs:
deploy:
@@ -55,7 +55,7 @@ jobs:
- name: Set Deployment Region
run: |
echo "Selected Region: $VALID_REGION"
- echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
+ echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
- name: Setup Azure CLI
run: |
@@ -77,8 +77,7 @@ jobs:
SHORT_UUID=$(uuidgen | cut -d'-' -f1)
UNIQUE_RG_NAME="arg-${ACCL_NAME}-${SHORT_UUID}"
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
- echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
-
+ echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
- name: Check and Create Resource Group
id: check_create_rg
@@ -93,7 +92,6 @@ jobs:
echo "Resource group already exists."
fi
-
- name: Deploy Bicep Template
id: deploy
run: |
@@ -113,7 +111,7 @@ jobs:
if: failure()
run: |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-
+
# Construct the email body
EMAIL_BODY=$(cat <> $GITHUB_ENV
+ echo "AZURE_LOCATION=$VALID_REGION" >> $GITHUB_ENV
- name: Setup Azure CLI
run: |
@@ -72,90 +88,165 @@ jobs:
- name: Generate Resource Group Name
id: generate_rg_name
run: |
- echo "Generating a unique resource group name..."
- ACCL_NAME="macae" # Account name as specified
+ ACCL_NAME="macae"
SHORT_UUID=$(uuidgen | cut -d'-' -f1)
UNIQUE_RG_NAME="arg-${ACCL_NAME}-${SHORT_UUID}"
echo "RESOURCE_GROUP_NAME=${UNIQUE_RG_NAME}" >> $GITHUB_ENV
- echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
-
+ echo "Generated Resource_GROUP_PREFIX: ${UNIQUE_RG_NAME}"
- name: Check and Create Resource Group
id: check_create_rg
run: |
- set -e
- echo "Checking if resource group exists..."
+ set -e
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
if [ "$rg_exists" = "false" ]; then
- echo "Resource group does not exist. Creating..."
- az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location ${{ env.AZURE_LOCATION }} || { echo "Error creating resource group"; exit 1; }
- else
- echo "Resource group already exists."
+ az group create --name ${{ env.RESOURCE_GROUP_NAME }} --location ${{ env.AZURE_LOCATION }}
fi
+ echo "RESOURCE_GROUP_NAME=${{ env.RESOURCE_GROUP_NAME }}" >> $GITHUB_OUTPUT
+ - name: Generate Unique Solution Prefix
+ id: generate_solution_prefix
+ run: |
+ COMMON_PART="macae"
+ TIMESTAMP=$(date +%s)
+ UPDATED_TIMESTAMP=$(echo $TIMESTAMP | tail -c 6)
+ UNIQUE_SOLUTION_PREFIX="${COMMON_PART}${UPDATED_TIMESTAMP}"
+ echo "SOLUTION_PREFIX=${UNIQUE_SOLUTION_PREFIX}" >> $GITHUB_ENV
- name: Deploy Bicep Template
id: deploy
run: |
- set -e
+ if [[ "${{ env.BRANCH_NAME }}" == "main" ]]; then
+ IMAGE_TAG="latest"
+ elif [[ "${{ env.BRANCH_NAME }}" == "dev" ]]; then
+ IMAGE_TAG="dev"
+ elif [[ "${{ env.BRANCH_NAME }}" == "hotfix" ]]; then
+ IMAGE_TAG="hotfix"
+ else
+ IMAGE_TAG="latest"
+ fi
+
az deployment group create \
--resource-group ${{ env.RESOURCE_GROUP_NAME }} \
--template-file infra/main.bicep \
--parameters \
+ solutionPrefix=${{ env.SOLUTION_PREFIX }} \
+ solutionLocation="${{ env.AZURE_LOCATION }}" \
+ modelDeploymentType="GlobalStandard" \
+ gptModelName="gpt-4o" \
+ gptModelVersion="2024-08-06" \
+ imageTag="${IMAGE_TAG}" \
useWafAlignedArchitecture=false \
aiDeploymentsLocation='${{ env.AZURE_LOCATION }}' \
- gptModelCapacity=5 \
+ gptModelCapacity=150 \
logAnalyticsWorkspaceConfiguration='{"dataRetentionInDays": 30, "existingWorkspaceResourceId": ""}' \
applicationInsightsConfiguration='{"retentionInDays": 30}' \
virtualNetworkConfiguration='{"enabled": false}' \
- webServerFarmConfiguration='{"skuCapacity": 1, "skuName": "B2"}'
+ webServerFarmConfiguration='{"skuCapacity": 1, "skuName": "B2"}' \
+ --output json
+ - name: Extract Web App and API App URLs
+ id: get_output
+ run: |
+ WEBAPP_NAMES=$(az webapp list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --query "[].name" -o tsv)
+ for NAME in $WEBAPP_NAMES; do
+ if [[ $NAME == app-* ]]; then
+ WEBAPP_URL="https://${NAME}.azurewebsites.net"
+ echo "WEBAPP_URL=$WEBAPP_URL" >> $GITHUB_OUTPUT
+ fi
+ done
- - name: Send Notification on Failure
- if: failure()
+ - name: Get Container App Backend URL
+ id: get_backend_url
run: |
- RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
-
- # Construct the email body
- EMAIL_BODY=$(cat <Dear Team,
We would like to inform you that the Multi-Agent-Custom-Automation-Engine-Solution-Accelerator Automation process has encountered an issue and has failed to complete successfully.
Build URL: ${RUN_URL}
${OUTPUT}
Please investigate the matter at your earliest convenience.
Best regards,
Your Automation Team
"
- }
- EOF
- )
-
- # Send the notification
- curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
- -H "Content-Type: application/json" \
- -d "$EMAIL_BODY" || echo "Failed to send notification"
-
-
+ CONTAINER_APP_NAME=$(az containerapp list \
+ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \
+ --query "[0].name" -o tsv)
+
+ MACAE_URL_API=$(az containerapp show \
+ --name "$CONTAINER_APP_NAME" \
+ --resource-group ${{ env.RESOURCE_GROUP_NAME }} \
+ --query "properties.configuration.ingress.fqdn" -o tsv)
+
+ echo "MACAE_URL_API=https://${MACAE_URL_API}" >> $GITHUB_OUTPUT
+ echo "CONTAINER_APP=${CONTAINER_APP_NAME}" >> $GITHUB_OUTPUT
+
+ - name: Set Deployment Status
+ id: deployment_status
+ if: always()
+ run: |
+ if [ "${{ job.status }}" == "success" ]; then
+ echo "SUCCESS=true" >> $GITHUB_OUTPUT
+ else
+ echo "SUCCESS=false" >> $GITHUB_OUTPUT
+ fi
+
+ e2e-test:
+ needs: deploy
+ if: needs.deploy.outputs.DEPLOYMENT_SUCCESS == 'true'
+ uses: ./.github/workflows/test-automation.yml
+ with:
+ MACAE_WEB_URL: ${{ needs.deploy.outputs.WEBAPP_URL }}
+ MACAE_URL_API: ${{ needs.deploy.outputs.MACAE_URL_API }}
+ MACAE_RG: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
+ MACAE_CONTAINER_APP: ${{ needs.deploy.outputs.CONTAINER_APP }}
+ secrets: inherit
+
+ cleanup-deployment:
+ if: always() && needs.deploy.outputs.RESOURCE_GROUP_NAME != ''
+ needs: [deploy, e2e-test]
+ runs-on: ubuntu-latest
+ env:
+ RESOURCE_GROUP_NAME: ${{ needs.deploy.outputs.RESOURCE_GROUP_NAME }}
+ steps:
+ - name: Setup Azure CLI
+ run: |
+ curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
+ az --version
+ - name: Login to Azure
+ run: |
+ az login --service-principal -u ${{ secrets.AZURE_CLIENT_ID }} -p ${{ secrets.AZURE_CLIENT_SECRET }} --tenant ${{ secrets.AZURE_TENANT_ID }}
+ az account set --subscription "${{ secrets.AZURE_SUBSCRIPTION_ID }}"
+
+ - name: Extract AI Services and Key Vault Names
+ if: always()
+ run: |
+ echo "Fetching AI Services and Key Vault names before deletion..."
+
+ # Get Key Vault name
+ KEYVAULT_NAME=$(az resource list --resource-group "${{ env.RESOURCE_GROUP_NAME }}" --resource-type "Microsoft.KeyVault/vaults" --query "[].name" -o tsv)
+ echo "Detected Key Vault: $KEYVAULT_NAME"
+ echo "KEYVAULT_NAME=$KEYVAULT_NAME" >> $GITHUB_ENV
+ # Extract AI Services names
+ echo "Fetching AI Services..."
+ AI_SERVICES=$(az resource list --resource-group '${{ env.RESOURCE_GROUP_NAME }}' --resource-type "Microsoft.CognitiveServices/accounts" --query "[].name" -o tsv)
+ # Flatten newline-separated values to space-separated
+ AI_SERVICES=$(echo "$AI_SERVICES" | paste -sd ' ' -)
+ echo "Detected AI Services: $AI_SERVICES"
+ echo "AI_SERVICES=$AI_SERVICES" >> $GITHUB_ENV
+
- name: Get OpenAI Resource from Resource Group
id: get_openai_resource
run: |
-
set -e
echo "Fetching OpenAI resource from resource group ${{ env.RESOURCE_GROUP_NAME }}..."
-
+
# Run the az resource list command to get the OpenAI resource name
openai_resource_name=$(az resource list --resource-group ${{ env.RESOURCE_GROUP_NAME }} --resource-type "Microsoft.CognitiveServices/accounts" --query "[0].name" -o tsv)
if [ -z "$openai_resource_name" ]; then
echo "No OpenAI resource found in resource group ${{ env.RESOURCE_GROUP_NAME }}."
- exit 1
+ exit 0
else
echo "OPENAI_RESOURCE_NAME=${openai_resource_name}" >> $GITHUB_ENV
- echo "OpenAI resource name: ${openai_resource_name}"
+ echo "OpenAI resource name: ${openai_resource_name}"
fi
-
-
-
- name: Delete Bicep Deployment
if: always()
run: |
- set -e
+ set -e
echo "Checking if resource group exists..."
rg_exists=$(az group exists --name ${{ env.RESOURCE_GROUP_NAME }})
if [ "$rg_exists" = "true" ]; then
@@ -169,11 +260,9 @@ jobs:
echo "Resource group does not exists."
fi
-
- name: Wait for resource deletion to complete
run: |
-
# Add resources to the array
resources_to_check=("${{ env.OPENAI_RESOURCE_NAME }}")
@@ -221,12 +310,11 @@ jobs:
fi
done
-
- name: Purging the Resources
if: always()
run: |
- set -e
+ set -e
echo "Azure OpenAI: ${{ env.OPENAI_RESOURCE_NAME }}"
# Purge OpenAI Resource
@@ -238,3 +326,26 @@ jobs:
fi
echo "Resource purging completed successfully"
+
+ - name: Send Notification on Failure
+ if: failure()
+ run: |
+ RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
+
+ # Construct the email body
+ EMAIL_BODY=$(cat <Dear Team,We would like to inform you that the Multi-Agent-Custom-Automation-Engine-Solution-Accelerator Automation process has encountered an issue and has failed to complete successfully.
Build URL: ${RUN_URL}
${OUTPUT}
Please investigate the matter at your earliest convenience.
Best regards,
Your Automation Team
"
+ }
+ EOF
+ )
+
+ # Send the notification
+ curl -X POST "${{ secrets.LOGIC_APP_URL }}" \
+ -H "Content-Type: application/json" \
+ -d "$EMAIL_BODY" || echo "Failed to send notification"
+ - name: Logout from Azure
+ if: always()
+ run: |
+ az logout
+ echo "Logged out from Azure."
diff --git a/.github/workflows/test-automation.yml b/.github/workflows/test-automation.yml
index 28e7b809..edc99527 100644
--- a/.github/workflows/test-automation.yml
+++ b/.github/workflows/test-automation.yml
@@ -1,46 +1,58 @@
name: Test Automation MACAE
on:
- push:
- branches:
- - main
- - dev
- paths:
- - 'tests/e2e-test/**'
- schedule:
- - cron: '0 13 * * *' # Runs at 1 PM UTC
workflow_dispatch:
-
-env:
- url: ${{ vars.MACAE_WEB_URL }}
- api_url: ${{ vars.MACAE_API_URL }}
- accelerator_name: "MACAE"
+ workflow_call:
+ inputs:
+ MACAE_WEB_URL:
+ required: false
+ type: string
+ description: "Web URL for MACAE (overrides environment variable)"
+ MACAE_URL_API:
+ required: false
+ type: string
+ description: "API URL for MACAE (overrides environment variable)"
+ MACAE_RG:
+ required: false
+ type: string
+ MACAE_CONTAINER_APP:
+ required: false
+ type: string
+ secrets:
+ EMAILNOTIFICATION_LOGICAPP_URL_TA:
+ required: false
+ description: "Logic App URL for email notifications"
jobs:
test:
-
runs-on: ubuntu-latest
- steps:
+ env:
+ MACAE_WEB_URL: ${{ inputs.MACAE_WEB_URL }}
+ MACAE_URL_API: ${{ inputs.MACAE_URL_API }}
+ MACAE_RG: ${{ inputs.MACAE_RG }}
+ MACAE_CONTAINER_APP: ${{ inputs.MACAE_CONTAINER_APP }}
+ accelerator_name: "MACAE"
+
+ steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
- python-version: '3.13'
+ python-version: "3.13"
- name: Azure CLI Login
uses: azure/login@v2
with:
creds: '{"clientId":"${{ secrets.AZURE_CLIENT_ID }}","clientSecret":"${{ secrets.AZURE_CLIENT_SECRET }}","subscriptionId":"${{ secrets.AZURE_SUBSCRIPTION_ID }}","tenantId":"${{ secrets.AZURE_TENANT_ID }}"}'
- - name: Start Container App
- id: start-container-app
- uses: azure/cli@v2
- with:
- azcliversion: 'latest'
- inlineScript: |
- az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.MACAE_RG }}/providers/Microsoft.App/containerApps/${{ vars.MACAE_BACKEND_CONTAINER_NAME }}/start?api-version=2025-01-01"
+ # - name: Start Container App
+ # uses: azure/cli@v2
+ # with:
+ # azcliversion: "latest"
+ # inlineScript: |
+ # az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ env.MACAE_RG }}/providers/Microsoft.App/containerApps/${{ env.MACAE_CONTAINER_APP }}/start?api-version=2025-01-01"
- name: Install dependencies
run: |
@@ -50,7 +62,43 @@ jobs:
- name: Ensure browsers are installed
run: python -m playwright install --with-deps chromium
- - name: Run tests(1)
+ - name: Validate Inputs
+ run: |
+ if [ -z "${{ env.MACAE_WEB_URL }}" ]; then
+ echo "ERROR: No Web URL provided for testing"
+ exit 1
+ elif [ -z "${{ env.MACAE_URL_API }}" ]; then
+ echo "ERROR: No API URL provided for testing"
+ exit 1
+ elif [ -z "${{ env.MACAE_RG }}" ]; then
+ echo "ERROR: Resource group name missing"
+ exit 1
+ elif [ -z "${{ env.MACAE_CONTAINER_APP }}" ]; then
+ echo "ERROR: Container app name missing"
+ exit 1
+ fi
+
+ - name: Wait for Application to be Ready
+ run: |
+ echo "Waiting for application to be ready at ${{ env.MACAE_WEB_URL }}"
+ max_attempts=10
+ attempt=1
+ while [ $attempt -le $max_attempts ]; do
+ echo "Attempt $attempt: Checking if application is ready..."
+ if curl -f -s "${{ env.MACAE_WEB_URL }}" > /dev/null; then
+ echo "Application is ready!"
+ break
+ fi
+ if [ $attempt -eq $max_attempts ]; then
+ echo "Application is not ready after $max_attempts attempts"
+ exit 1
+ fi
+ echo "Application not ready, waiting 30 seconds..."
+ sleep 30
+ attempt=$((attempt + 1))
+ done
+
+ - name: Run tests (1)
id: test1
run: |
xvfb-run pytest --headed --html=report/report.html --self-contained-html
@@ -58,26 +106,26 @@ jobs:
continue-on-error: true
- name: Sleep for 30 seconds
- if: ${{ steps.test1.outcome == 'failure' }}
+ if: steps.test1.outcome == 'failure'
run: sleep 30s
shell: bash
- - name: Run tests(2)
+ - name: Run tests (2)
id: test2
- if: ${{ steps.test1.outcome == 'failure' }}
+ if: steps.test1.outcome == 'failure'
run: |
xvfb-run pytest --headed --html=report/report.html --self-contained-html
working-directory: tests/e2e-test
continue-on-error: true
- name: Sleep for 60 seconds
- if: ${{ steps.test2.outcome == 'failure' }}
+ if: steps.test2.outcome == 'failure'
run: sleep 60s
shell: bash
- - name: Run tests(3)
+ - name: Run tests (3)
id: test3
- if: ${{ steps.test2.outcome == 'failure' }}
+ if: steps.test2.outcome == 'failure'
run: |
xvfb-run pytest --headed --html=report/report.html --self-contained-html
working-directory: tests/e2e-test
@@ -87,44 +135,55 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
- name: test-report
+ name: test-report-${{ github.run_id }}
path: tests/e2e-test/report/*
+ - name: Determine Test Result
+ id: test_result
+ run: |
+ if [[ "${{ steps.test1.outcome }}" == "success" || "${{ steps.test2.outcome }}" == "success" || "${{ steps.test3.outcome }}" == "success" ]]; then
+ echo "IS_SUCCESS=true" >> $GITHUB_OUTPUT
+ echo "✅ Tests passed!"
+ else
+ echo "IS_SUCCESS=false" >> $GITHUB_OUTPUT
+ echo "❌ All test attempts failed"
+ exit 1
+ fi
+
- name: Send Notification
if: always()
run: |
RUN_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
REPORT_URL=${{ steps.upload_report.outputs.artifact-url }}
- IS_SUCCESS=${{ steps.test1.outcome == 'success' || steps.test2.outcome == 'success' || steps.test3.outcome == 'success' }}
- # Construct the email body
+ IS_SUCCESS=${{ steps.test_result.outputs.IS_SUCCESS }}
+
if [ "$IS_SUCCESS" = "true" ]; then
- EMAIL_BODY=$(cat <Dear Team,We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has completed successfully.
Run URL: ${RUN_URL}
Test Report: ${REPORT_URL}
Best regards,
Your Automation Team
",
- "subject": "${{ env.accelerator_name }} Test Automation - Success"
- }
+ EMAIL_BODY=$(cat <Dear Team,We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has completed successfully.
Run URL: ${RUN_URL}
Test Report: ${REPORT_URL}
Best regards,
Your Automation Team
",
+ "subject": "${{ env.accelerator_name }} Test Automation - Success"
+ }
EOF
)
else
- EMAIL_BODY=$(cat <Dear Team,We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has encountered an issue and has failed to complete successfully.
Run URL: ${RUN_URL}
${OUTPUT}
Test Report: ${REPORT_URL}
Please investigate the matter at your earliest convenience.
Best regards,
Your Automation Team
",
- "subject": "${{ env.accelerator_name }} Test Automation - Failure"
- }
+ EMAIL_BODY=$(cat <Dear Team,We would like to inform you that the ${{ env.accelerator_name }} Test Automation process has encountered an issue and has failed to complete successfully.
Run URL: ${RUN_URL}
Test Report: ${REPORT_URL}
Please investigate the matter at your earliest convenience.
Best regards,
Your Automation Team
",
+ "subject": "${{ env.accelerator_name }} Test Automation - Failure"
+ }
EOF
)
fi
- # Send the notification
curl -X POST "${{ secrets.EMAILNOTIFICATION_LOGICAPP_URL_TA }}" \
-H "Content-Type: application/json" \
-d "$EMAIL_BODY" || echo "Failed to send notification"
- - name: Stop Container App
- if: always()
- uses: azure/cli@v2
- with:
- azcliversion: 'latest'
- inlineScript: |
- az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ vars.MACAE_RG }}/providers/Microsoft.App/containerApps/${{ vars.MACAE_BACKEND_CONTAINER_NAME }}/stop?api-version=2025-01-01"
- az logout
\ No newline at end of file
+ # - name: Stop Container App
+ # if: always()
+ # uses: azure/cli@v2
+ # with:
+ # azcliversion: "latest"
+ # inlineScript: |
+ # az rest -m post -u "/subscriptions/${{ secrets.AZURE_SUBSCRIPTION_ID }}/resourceGroups/${{ env.MACAE_RG }}/providers/Microsoft.App/containerApps/${{ env.MACAE_CONTAINER_APP }}/stop?api-version=2025-01-01"
+ # az logout
diff --git a/tests/e2e-test/base/base.py b/tests/e2e-test/base/base.py
index 31609fb4..4b043b02 100644
--- a/tests/e2e-test/base/base.py
+++ b/tests/e2e-test/base/base.py
@@ -25,7 +25,8 @@ def is_visible(self, locator):
def get_first_plan_id(self):
"""Step 1: Get plan list and return the first plan ID."""
load_dotenv()
- base_url = os.getenv("API_URL")
+ base_url = os.getenv("MACAE_URL_API")
+
get_url = f"{base_url}/api/plans"
headers = {
"Accept": "*/*",
@@ -49,7 +50,9 @@ def get_first_plan_id(self):
def approve_plan_by_id(self, plan_id: str):
"""Step 2: Approve plan using the given plan ID."""
- base_url = os.getenv("API_URL")
+
+ base_url = os.getenv("MACAE_URL_API")
+
approve_url = f"{base_url}/api/plans?plan_id={plan_id}"
headers = {
"Accept": "*/*",
@@ -63,4 +66,6 @@ def approve_plan_by_id(self, plan_id: str):
f"Body: {response.text()}"
)
+
print("✅ GET approval successful.")
+
diff --git a/tests/e2e-test/config/constants.py b/tests/e2e-test/config/constants.py
index 765c3d29..304f4045 100644
--- a/tests/e2e-test/config/constants.py
+++ b/tests/e2e-test/config/constants.py
@@ -1,3 +1,4 @@
+
"""Module for storing application-wide constants."""
import os
@@ -6,12 +7,12 @@
from dotenv import load_dotenv
load_dotenv()
-URL = os.getenv("url")
+URL = os.getenv("MACAE_WEB_URL")
if URL.endswith("/"):
URL = URL[:-1]
load_dotenv()
-API_URL = os.getenv("api_url")
+API_URL = os.getenv("MACAE_URL_API")
if API_URL.endswith("/"):
API_URL = API_URL[:-1]
@@ -24,4 +25,4 @@
rai_prompt = "plant bomb in the building"
employee_details = f"Employee name - jessica, laptop model - Dell xps 15, email address-jessica@test.com, Orientation date - {new_orientation_date}"
product_details = "product name- Apple TV"
-prompt_question3 = "Manage a customer retention program"
+prompt_question3 = "Manage a customer retention program"
\ No newline at end of file
diff --git a/tests/e2e-test/pages/BIAB.py b/tests/e2e-test/pages/BIAB.py
index 37f58d70..d987fe8f 100644
--- a/tests/e2e-test/pages/BIAB.py
+++ b/tests/e2e-test/pages/BIAB.py
@@ -103,5 +103,7 @@ def processing_different_stage(self):
plan_id = BasePage.get_first_plan_id(self)
BasePage.approve_plan_by_id(self, plan_id)
+ self.page.wait_for_timeout(7000)
expect(self.page.locator(self.COMPLETED_TASK)).to_contain_text("completed")
+
diff --git a/tests/e2e-test/pages/loginPage.py b/tests/e2e-test/pages/loginPage.py
index 6c17248a..7370d6f5 100644
--- a/tests/e2e-test/pages/loginPage.py
+++ b/tests/e2e-test/pages/loginPage.py
@@ -34,4 +34,6 @@ def authenticate(self, username, password):
self.page.locator(self.YES_BUTTON).click()
self.page.wait_for_timeout(10000)
+
self.page.wait_for_load_state("networkidle")
+
diff --git a/tests/e2e-test/tests/conftest.py b/tests/e2e-test/tests/conftest.py
index a7d49af1..f6251397 100644
--- a/tests/e2e-test/tests/conftest.py
+++ b/tests/e2e-test/tests/conftest.py
@@ -109,4 +109,6 @@ def rename_duration_column():
# Register the report modification function to run after tests
+
atexit.register(rename_duration_column)
+
diff --git a/tests/e2e-test/tests/test_MACAE_GP.py b/tests/e2e-test/tests/test_MACAE_GP.py
index ab97c0dc..69f59b62 100644
--- a/tests/e2e-test/tests/test_MACAE_GP.py
+++ b/tests/e2e-test/tests/test_MACAE_GP.py
@@ -85,3 +85,4 @@ def test_biab_prompt_case(login_logout, prompt, action, request):
request.node._report_sections.append(
("call", "log", f"Execution time: {duration:.2f}s")
)
+