feat: enhance APIRequestComponent with new output methods (#7148)
* ✨ (Research Translation Loop.spec.ts): Increase timeout value by a factor of 3 for better reliability in waiting for element to appear ✨ (chatInputOutputUser-shard-1.spec.ts): Increase timeout value by a factor of 3 for better reliability in waiting for element to appear * 🐛 (typescript_test.yml): adjust the maximum shard count to 10 to prevent exceeding the limit and optimize test execution. * 🐛 (chatInputOutputUser-shard-1.spec.ts): increase timeout for waiting for "built successfully" text to improve test reliability * ⬆️ (typescript_test.yml): increase maximum shard count to 15 for better test distribution ♻️ (Portfolio Website Code Generator.spec.ts): refactor test assertions to improve readability and maintainability * 🐛 (typescript_test.yml): adjust the maximum shard count to 10 to prevent exceeding the limit of parallel test executions * 🔧 (typescript_test.yml): Increase maximum shard count to 15 for better test distribution efficiency 🐛 (chatInputOutputUser-shard-1.spec.ts): Update timeout values for page element waits to prevent premature failures due to timing issues * templates adjustments * travel planning fix * Update Travel Planning Agents.json * fix templates * ♻️ (Youtube Analysis.spec.ts): remove unused imports and cleanup code for better readability and maintainability * json fix * fix: update simple agent template (#7081) * Update Simple Agent.json * Update Simple Agent.json * feat: update search agent template agent component (#7082) * update agent component with the latest changes * Update Search agent.json * Update Search agent.json * feat: enhance APIRequestComponent with new output methods - Refactored output methods to include `as_data` and `as_message` for better data handling. - Updated existing output method from `make_requests` to `as_data` for consistency. - Improved metadata handling by merging dictionary results and storing non-dict results as 'data'. - Added detailed docstrings for new methods to clarify their functionality. * added the updated test class * [autofix.ci] apply automated fixes * 📝 (ContentBlockDisplay.tsx): wrap headerIcon element in a span with data-testid attribute for better accessibility 📝 (DurationDisplay.tsx): add data-testid attribute to the duration display element for testing purposes 📝 (Simple Agent.spec.ts, Social Media Agent.spec.ts, generalBugs-shard-9.spec.ts): update test assertions to improve readability and accuracy 📝 (chatInputOutput.spec.ts): add a skip test annotation and a todo comment for further investigation * ✨ (typescript_test.yml): Add support for a new development suite in the test workflow ✨ (frontend): Add support for a new development suite in multiple test files * 🔧 (.github/workflows/typescript_test.yml): ensure that the SUITES variable is valid JSON format to prevent errors and improve reliability * ✨ (inputFileComponent/index.tsx): Refactor InputFileComponent to wrap Button component in a div for better structure and readability 🔧 (Vector Store.spec.ts): Add initialGPTsetup function to set up GPT environment variables for tests 🔧 (Vector Store.spec.ts): Refactor test to use initialGPTsetup function and improve readability 🔧 (add-new-api-keys.ts): Refactor addNewApiKeys function to handle multiple openai_api_key inputs 🔧 (remove-old-api-keys.ts): Refactor removeOldApiKeys function to click on the correct remove-icon-badge element * ✨ Add support for running tests in serial mode with a delay between each test 🔧 Configure tests to run with a 3-second delay between each test run 🔧 Add a 7-second delay before starting tests in userSettings.spec.ts 🔧 Add a 3-second delay before the second event delivery mode test in withEventDeliveryModes.ts * 📝 (userSettings.spec.ts): remove unnecessary console log message to improve test readability and maintainability * 📝 (deploy-dropdown.tsx): Add data-testid attribute to shareable-playground element ✨ (index.tsx): Add useGetTypes hook to fetch types data when component is fetched 🔧 (publish-flow.spec.ts): Increase timeout for page.waitForSelector and page.waitForTimeout 🔧 (Vector Store.spec.ts): Refactor code to wait for dropdown to appear and be visible 🔧 (files-page.spec.ts): Refactor tests to run serially with a delay between each test and add comments to improve readability * ✨ Add useGetTypes hook to fetch types data and support caching with checkCache option 🔧 Refactor useGetTypes hook to accept options object with checkCache property 🔧 Refactor useGetTypes hook to conditionally return cached data if available 🔧 Refactor useGetTypes hook to fetch types data with force_refresh query parameter 🔧 Refactor useGetTypes hook to handle errors and set types data 🔧 Refactor useGetTypes hook to improve query function and options handling 🔧 Refactor useGetTypes hook to optimize query function and options handling 🔧 Refactor useGetTypes hook to improve caching logic and error handling 🔧 Refactor useGetTypes hook to enhance caching mechanism and error handling 🔧 Refactor useGetTypes hook to improve data fetching and error handling 🔧 Refactor useGetTypes hook to optimize data fetching and error handling * ✨ (Vector Store.spec.ts): Remove unnecessary loadingOptions check and expectation ♻️ (withEventDeliveryModes.ts): Refactor withEventDeliveryModes function to accept a timeout parameter for better flexibility * ⚡️ (Vector Store.spec.ts): increase timeout for page.waitForTimeout from 2000ms to 10000ms to improve test stability and reliability * update pokedex agent template * ✨ (publish-flow.spec.ts): Remove unnecessary development tag from test description ✨ (Simple Agent.spec.ts, Social Media Agent.spec.ts): Remove unnecessary development tag from test description ✨ (Vector Store.spec.ts): Change withEventDeliveryModes to test for better test organization 🔧 (chatInputOutput.spec.ts): Refactor test description and remove unnecessary development tag ✨ (files-page.spec.ts): Remove unnecessary development tag from test descriptions ✨ (userSettings.spec.ts): Remove unnecessary development tag from test description * formatting json * ✨ (Vector Store.spec.ts): Add new integration test withEventDeliveryModes for Vector Store RAG 🔧 (Vector Store.spec.ts): Update timeout values in test functions to improve test performance and reliability * 📝 (Text Sentiment Analysis.json): Update JSON file to have consistent formatting and structure for output_types and inputTypes arrays 📝 (Text Sentiment Analysis.spec.ts): Refactor integration test for Text Sentiment Analysis to improve readability and maintainability * ✨ (PageComponent/index.tsx): Update minZoom and maxZoom values for better user experience 🐛 (upload-file.ts): Fix missing await keyword before clicking on an element * 🐛 (PageComponent/index.tsx): fix minZoom value to 0.2 for consistency with fitViewOptions and improve user experience * ✨ (dropdownComponent.spec.ts): add delay before checking dropdown value to ensure it has updated properly ✨ (dropdownComponent.spec.ts): add delay before interacting with more options modal to ensure it has loaded ✨ (floatComponent.spec.ts): add delay after clicking add button to wait for API request to complete --------- Co-authored-by: cristhianzl <cristhian.lousa@gmail.com> Co-authored-by: Edwin Jose <edwin.jose@datastax.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
ec78119b3a
commit
44254206b8
30 changed files with 1183 additions and 727 deletions
25
.github/workflows/typescript_test.yml
vendored
25
.github/workflows/typescript_test.yml
vendored
|
|
@ -99,6 +99,7 @@ jobs:
|
|||
# If input suites were not provided, determine based on changes
|
||||
if [[ "$SUITES" == "[]" ]]; then
|
||||
echo "No input suites provided - determining from changes"
|
||||
SUITES='[]' # Ensure we start with a valid JSON array
|
||||
TAGS=()
|
||||
# Add suites and tags based on changed files
|
||||
if [[ "${{ steps.filter.outputs.components }}" == "true" ]]; then
|
||||
|
|
@ -126,6 +127,11 @@ jobs:
|
|||
TAGS+=("@database")
|
||||
echo "Added database suite"
|
||||
fi
|
||||
if [[ "${{ steps.filter.outputs.development }}" == "true" ]]; then
|
||||
SUITES=$(echo $SUITES | jq -c '. += ["development"]')
|
||||
TAGS+=("@development")
|
||||
echo "Added development suite"
|
||||
fi
|
||||
|
||||
# Create grep pattern if we have tags
|
||||
if [ ${#TAGS[@]} -gt 0 ]; then
|
||||
|
|
@ -135,6 +141,21 @@ jobs:
|
|||
fi
|
||||
else
|
||||
# Process input suites to tags
|
||||
# First ensure SUITES is valid JSON
|
||||
if ! echo "$SUITES" | jq -e . > /dev/null 2>&1; then
|
||||
echo "Warning: Input suites is not valid JSON, attempting to fix"
|
||||
# Try to fix common issues like missing quotes
|
||||
if [[ "$SUITES" == "[development]" ]]; then
|
||||
SUITES='["development"]'
|
||||
elif [[ "$SUITES" =~ ^\[(.*)\]$ ]]; then
|
||||
# Extract items and add quotes
|
||||
ITEMS="${BASH_REMATCH[1]}"
|
||||
QUOTED_ITEMS=$(echo "$ITEMS" | sed 's/\([^,]*\)/"\1"/g')
|
||||
SUITES="[$QUOTED_ITEMS]"
|
||||
fi
|
||||
echo "Fixed suites: $SUITES"
|
||||
fi
|
||||
|
||||
TAGS=()
|
||||
if echo "$SUITES" | jq -e 'contains(["components"])' > /dev/null; then
|
||||
TAGS+=("@components")
|
||||
|
|
@ -151,6 +172,9 @@ jobs:
|
|||
if echo "$SUITES" | jq -e 'contains(["database"])' > /dev/null; then
|
||||
TAGS+=("@database")
|
||||
fi
|
||||
if echo "$SUITES" | jq -e 'contains(["development"])' > /dev/null; then
|
||||
TAGS+=("@development")
|
||||
fi
|
||||
|
||||
if [ ${#TAGS[@]} -gt 0 ]; then
|
||||
# Join tags with | for OR logic
|
||||
|
|
@ -168,6 +192,7 @@ jobs:
|
|||
# Ensure proper JSON formatting for matrix output
|
||||
echo "matrix=$(echo $SUITES | jq -c .)" >> $GITHUB_OUTPUT
|
||||
echo "test_grep=$TEST_GREP" >> $GITHUB_OUTPUT
|
||||
echo "suites=$SUITES" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup Node ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@v4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue