refactor(urlcomponent): rename output display names and method references (#8448)
* Update url.py * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * template updates * [autofix.ci] apply automated fixes * increase shards for testing * update name * fix-frontend-tests-url-component --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
60ccdb500f
commit
1dbc8d9b1d
7 changed files with 24 additions and 19 deletions
|
|
@ -18,7 +18,12 @@ DEFAULT_TIMEOUT = 30
|
|||
DEFAULT_MAX_DEPTH = 1
|
||||
DEFAULT_FORMAT = "Text"
|
||||
URL_REGEX = re.compile(
|
||||
r"^(https?:\/\/)?" r"(www\.)?" r"([a-zA-Z0-9.-]+)" r"(\.[a-zA-Z]{2,})?" r"(:\d+)?" r"(\/[^\s]*)?$",
|
||||
r"^(https?:\/\/)?"
|
||||
r"(www\.)?"
|
||||
r"([a-zA-Z0-9.-]+)"
|
||||
r"(\.[a-zA-Z]{2,})?"
|
||||
r"(:\d+)?"
|
||||
r"(\/[^\s]*)?$",
|
||||
re.IGNORECASE,
|
||||
)
|
||||
|
||||
|
|
@ -164,8 +169,8 @@ class URLComponent(Component):
|
|||
]
|
||||
|
||||
outputs = [
|
||||
Output(display_name="Result", name="page_results", method="fetch_content"),
|
||||
Output(display_name="Raw Result", name="raw_results", method="as_message"),
|
||||
Output(display_name="Extracted Pages", name="page_results", method="fetch_content"),
|
||||
Output(display_name="Raw Content", name="raw_results", method="fetch_content_as_message"),
|
||||
]
|
||||
|
||||
@staticmethod
|
||||
|
|
@ -292,7 +297,7 @@ class URLComponent(Component):
|
|||
"""Convert the documents to a DataFrame."""
|
||||
return DataFrame(data=self.fetch_url_contents())
|
||||
|
||||
def as_message(self) -> Message:
|
||||
def fetch_content_as_message(self) -> Message:
|
||||
"""Convert the documents to a Message."""
|
||||
url_contents = self.fetch_url_contents()
|
||||
return Message(text="\n\n".join([x["text"] for x in url_contents]), data={"data": url_contents})
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -114,7 +114,7 @@ test(
|
|||
|
||||
//connection 1
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-result-right")
|
||||
.getByTestId("handle-urlcomponent-shownode-extracted pages-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ test(
|
|||
await zoomOut(page, 2);
|
||||
|
||||
//connection 1
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-extracted pages-right").click();
|
||||
await page
|
||||
.getByTestId("handle-splittext-shownode-data or dataframe-left")
|
||||
.click();
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ test(
|
|||
|
||||
// URL -> Loop Data
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-result-right")
|
||||
.getByTestId("handle-urlcomponent-shownode-extracted pages-right")
|
||||
.first()
|
||||
.click();
|
||||
await page
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ test(
|
|||
.getByTestId("inputlist_str_urls_0")
|
||||
.fill("https://www.example.com");
|
||||
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-extracted pages-right").click();
|
||||
|
||||
await page.waitForTimeout(600);
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ test(
|
|||
exact: true,
|
||||
});
|
||||
await page.getByText("Close").first().click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-extracted pages-right").click();
|
||||
await page
|
||||
.getByTestId("handle-chatoutput-noshownode-inputs-target")
|
||||
.nth(1)
|
||||
|
|
@ -141,12 +141,12 @@ test(
|
|||
timeout: 30000 * 3,
|
||||
});
|
||||
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-extracted pages-right").click();
|
||||
await page.waitForTimeout(600);
|
||||
await page.getByTestId("handle-urlcomponent-shownode-result-right").click();
|
||||
await page.getByTestId("handle-urlcomponent-shownode-extracted pages-right").click();
|
||||
|
||||
await page
|
||||
.getByTestId("output-inspection-result-urlcomponent")
|
||||
.getByTestId("output-inspection-extracted pages-urlcomponent")
|
||||
.nth(0)
|
||||
.click();
|
||||
|
||||
|
|
@ -161,7 +161,7 @@ test(
|
|||
await page.waitForTimeout(600);
|
||||
|
||||
await page
|
||||
.getByTestId("handle-urlcomponent-shownode-result-right")
|
||||
.getByTestId("handle-urlcomponent-shownode-extracted pages-right")
|
||||
.nth(0)
|
||||
.click();
|
||||
|
||||
|
|
@ -176,7 +176,7 @@ test(
|
|||
timeout: 30000 * 3,
|
||||
});
|
||||
await page.waitForTimeout(600);
|
||||
await page.getByTestId("output-inspection-result-urlcomponent").click();
|
||||
await page.getByTestId("output-inspection-extracted pages-urlcomponent").click();
|
||||
await page.getByText(`Inspect the output of the component below.`, {
|
||||
exact: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ test(
|
|||
timeout: 30000,
|
||||
});
|
||||
|
||||
await page.getByTestId("output-inspection-result-urlcomponent").click();
|
||||
await page.getByTestId("output-inspection-extracted pages-urlcomponent").click();
|
||||
|
||||
await page.getByText(`Inspect the output of the component below.`, {
|
||||
exact: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue