feat: Enhance API request component (#8070)

* update the api request component

* [autofix.ci] apply automated fixes

* update the component

* Update test_api_request_component.py

* [autofix.ci] apply automated fixes

* remove MODE_CONFIG unused variable

* [autofix.ci] apply automated fixes

* use normalize function

* Update template

* Update test_api_request_component.py

* UI test fix

* selector fix

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
This commit is contained in:
Edwin Jose 2025-05-22 11:41:19 -04:00 • committed by GitHub
commit ba92fc1e78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 256 additions and 351 deletions

View file

@ -32,12 +32,12 @@ test(
await adjustScreenView(page);
await page.waitForSelector(
'[data-testid="handle-apirequest-shownode-urls-left"]',
'[data-testid="handle-apirequest-shownode-url-left"]',
{
timeout: 3000,
},
);
await page.getByTestId("handle-apirequest-shownode-urls-left").click();
await page.getByTestId("handle-apirequest-shownode-url-left").click();
await page.waitForTimeout(500);

View file

@ -9,17 +9,17 @@ test(
await page.getByTestId("blank-flow").click();
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("api request");
await page.getByTestId("sidebar-search-input").fill("url");
await page.waitForSelector('[data-testid="dataAPI Request"]', {
await page.waitForSelector('[data-testid="dataURL"]', {
timeout: 3000,
});
await page
.getByTestId("dataAPI Request")
.getByTestId("dataURL")
.hover()
.then(async () => {
await page.getByTestId("add-component-button-api-request").click();
await page.getByTestId("add-component-button-url").click();
});
await page.waitForSelector(
@ -44,7 +44,7 @@ test(
await page.getByTestId("button_open_actions").click();
await page.waitForSelector("text=API Request", { timeout: 30000 });
await page.waitForSelector("text=URL", { timeout: 30000 });
const rowsCount = await page.getByRole("gridcell").count();
@ -200,7 +200,11 @@ test(
await page.getByText("Close").last().click();
expect(
await page.locator('[data-testid="tool_make_requests"]').isVisible(),
await page.locator('[data-testid="tool_fetch_content"]').isVisible(),
).toBe(true);
expect(
await page.locator('[data-testid="tool_as_dataframe"]').isVisible(),
).toBe(true);
},
);