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:
anovazzi1 2024-11-26 19:06:28 -03:00 committed by GitHub
commit 5d2de860e5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 8 deletions

View file

@ -149,7 +149,7 @@ jobs:
if [ ${#TAGS[@]} -gt 0 ]; then
# Join tags with | for OR logic
REGEX_PATTERN=$(IFS='|'; echo "${TAGS[*]}")
TEST_GREP="--grep=\"${REGEX_PATTERN}\""
TEST_GREP="--grep \"${REGEX_PATTERN}\""
fi
fi
fi
@ -270,8 +270,11 @@ jobs:
command: |
cd src/frontend
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 }} --trace on --shard ${{ matrix.shardIndex }} --workers 2
npx playwright test ${{ inputs.tests_folder }} ${{ needs.determine-test-suite.outputs.test_grep }} --shard ${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --list
# 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
if: always()

View file

@ -5,7 +5,6 @@ test(
{ tag: ["@release", "@workspace"] },
async ({ page }) => {
await page.goto("/");
await page.waitForTimeout(1000);
let modalCount = 0;
try {
@ -19,7 +18,9 @@ test(
while (modalCount === 0) {
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();
}
@ -27,7 +28,9 @@ test(
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("url");
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="dataURL"]', {
timeout: 3000,
});
await page
.getByTestId("dataURL")
.dragTo(page.locator('//*[@id="react-flow-id"]'));

View file

@ -22,7 +22,9 @@ test("IntComponent", { tag: ["@release", "@workspace"] }, async ({ page }) => {
while (modalCount === 0) {
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();
}
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").fill("openai");
await page.waitForTimeout(1000);
await page.waitForSelector('[data-testid="modelsOpenAI"]', {
timeout: 3000,
});
await page
.getByTestId("modelsOpenAI")