Refactor: inputListComponent.spec.ts to improve test reliability and performance (#4859)
* Refactor inputListComponent.spec.ts to improve test reliability and performance * Refactor: update intComponent tests for improved reliability and performance (#4860) * Refactor inputListComponent.spec.ts to improve test reliability and performance * Refactor IntComponent test to improve search reliability and performance * Refactor test grep pattern to fix syntax error * debuging ci * Refactor test grep pattern to fix syntax error and improve test reliability and performance
This commit is contained in:
parent
cf30b88a91
commit
5d2de860e5
3 changed files with 18 additions and 8 deletions
9
.github/workflows/typescript_test.yml
vendored
9
.github/workflows/typescript_test.yml
vendored
|
|
@ -149,7 +149,7 @@ jobs:
|
||||||
if [ ${#TAGS[@]} -gt 0 ]; then
|
if [ ${#TAGS[@]} -gt 0 ]; then
|
||||||
# Join tags with | for OR logic
|
# Join tags with | for OR logic
|
||||||
REGEX_PATTERN=$(IFS='|'; echo "${TAGS[*]}")
|
REGEX_PATTERN=$(IFS='|'; echo "${TAGS[*]}")
|
||||||
TEST_GREP="--grep=\"${REGEX_PATTERN}\""
|
TEST_GREP="--grep \"${REGEX_PATTERN}\""
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -270,8 +270,11 @@ jobs:
|
||||||
command: |
|
command: |
|
||||||
cd src/frontend
|
cd src/frontend
|
||||||
echo 'Running tests with pattern: ${{ needs.determine-test-suite.outputs.test_grep }}'
|
echo 'Running tests with pattern: ${{ needs.determine-test-suite.outputs.test_grep }}'
|
||||||
npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --shard ${{ matrix.shardIndex }} --list
|
npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --list
|
||||||
npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }} --workers 2
|
# echo command before running
|
||||||
|
echo "npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2"
|
||||||
|
|
||||||
|
npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --trace on --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --workers 2
|
||||||
|
|
||||||
- name: Upload blob report to GitHub Actions Artifacts
|
- name: Upload blob report to GitHub Actions Artifacts
|
||||||
if: always()
|
if: always()
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ test(
|
||||||
{ tag: ["@release", "@workspace"] },
|
{ tag: ["@release", "@workspace"] },
|
||||||
async ({ page }) => {
|
async ({ page }) => {
|
||||||
await page.goto("/");
|
await page.goto("/");
|
||||||
await page.waitForTimeout(1000);
|
|
||||||
|
|
||||||
let modalCount = 0;
|
let modalCount = 0;
|
||||||
try {
|
try {
|
||||||
|
|
@ -19,7 +18,9 @@ test(
|
||||||
|
|
||||||
while (modalCount === 0) {
|
while (modalCount === 0) {
|
||||||
await page.getByText("New Flow", { exact: true }).click();
|
await page.getByText("New Flow", { exact: true }).click();
|
||||||
await page.waitForTimeout(3000);
|
await page.waitForSelector('[data-testid="modal-title"]', {
|
||||||
|
timeout: 3000,
|
||||||
|
});
|
||||||
modalCount = await page.getByTestId("modal-title")?.count();
|
modalCount = await page.getByTestId("modal-title")?.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -27,7 +28,9 @@ test(
|
||||||
await page.getByTestId("sidebar-search-input").click();
|
await page.getByTestId("sidebar-search-input").click();
|
||||||
await page.getByTestId("sidebar-search-input").fill("url");
|
await page.getByTestId("sidebar-search-input").fill("url");
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForSelector('[data-testid="dataURL"]', {
|
||||||
|
timeout: 3000,
|
||||||
|
});
|
||||||
await page
|
await page
|
||||||
.getByTestId("dataURL")
|
.getByTestId("dataURL")
|
||||||
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,9 @@ test("IntComponent", { tag: ["@release", "@workspace"] }, async ({ page }) => {
|
||||||
|
|
||||||
while (modalCount === 0) {
|
while (modalCount === 0) {
|
||||||
await page.getByText("New Flow", { exact: true }).click();
|
await page.getByText("New Flow", { exact: true }).click();
|
||||||
await page.waitForTimeout(3000);
|
await page.waitForSelector('[data-testid="modal-title"]', {
|
||||||
|
timeout: 3000,
|
||||||
|
});
|
||||||
modalCount = await page.getByTestId("modal-title")?.count();
|
modalCount = await page.getByTestId("modal-title")?.count();
|
||||||
}
|
}
|
||||||
await page.waitForSelector('[data-testid="blank-flow"]', {
|
await page.waitForSelector('[data-testid="blank-flow"]', {
|
||||||
|
|
@ -32,7 +34,9 @@ test("IntComponent", { tag: ["@release", "@workspace"] }, async ({ page }) => {
|
||||||
await page.getByTestId("sidebar-search-input").click();
|
await page.getByTestId("sidebar-search-input").click();
|
||||||
await page.getByTestId("sidebar-search-input").fill("openai");
|
await page.getByTestId("sidebar-search-input").fill("openai");
|
||||||
|
|
||||||
await page.waitForTimeout(1000);
|
await page.waitForSelector('[data-testid="modelsOpenAI"]', {
|
||||||
|
timeout: 3000,
|
||||||
|
});
|
||||||
|
|
||||||
await page
|
await page
|
||||||
.getByTestId("modelsOpenAI")
|
.getByTestId("modelsOpenAI")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue