feat: Enhance FlowMenu name editing experience (#5729)

* ✨ (FlowMenu/index.tsx): improve user experience by enhancing the flow name editing functionality in the appHeaderComponent's FlowMenu component

* ✨ (FlowMenu/index.tsx): add data-testid attribute to span element for flow name in MenuBar component
🐛 (edit-flow-name.spec.ts): fix test cases to use correct data-testid value for input element in edit-flow-name feature

* ✨ (store-shard-2.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
✨ (edit-flow-name.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
✨ (flowSettings.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
✨ (general-bugs-move-flow-from-folder.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability

* ✨ (FlowMenu/index.tsx): add useEffect hook to set flow name when currentFlow is present and not editing name

* fix errors

* ✅ (youtube-transcripts.spec.ts): update timeout values for page.waitForSelector to improve test performance and reliability

* ✨ (sliderComponent): Add cn utility function to improve classnames handling in SliderComponent
📝 (floatComponent.spec.ts): Update test descriptions and values for NVIDIA related components
♻️ (sliderComponent.spec.ts): Refactor code to replace FloatInput with SliderInput and update import statements and values for temperature slider

* ✅ (youtube-transcripts.spec.ts): skip the test for youtube transcripts component to prevent it from running during test suite execution
This commit is contained in:
Cristhian Zanforlin Lousa 2025-01-20 16:41:49 -03:00 • committed by GitHub
commit d9a52d5cb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 96 additions and 136 deletions

View file

@ -13,77 +13,49 @@ test(
});
await page.getByTestId("blank-flow").click();
await page.getByTestId("sidebar-search-input").click();
await page.getByTestId("sidebar-search-input").fill("ollama");
await page.getByTestId("sidebar-search-input").fill("nvidia");
await page.waitForSelector('[data-testid="modelsOllama"]', {
await page.waitForSelector('[data-testid="modelsNVIDIA"]', {
timeout: 30000,
});
await page
.getByTestId("modelsOllama")
.dragTo(page.locator('//*[@id="react-flow-id"]'));
await page.mouse.up();
await page.mouse.down();
await adjustScreenView(page);
.getByTestId("modelsNVIDIA")
.hover()
.then(async () => {
await page.getByTestId("add-component-button-nvidia").click();
});
await page.locator('//*[@id="float_float_temperature"]').click();
await page.locator('//*[@id="float_float_temperature"]').fill("");
await page.locator('//*[@id="float_float_temperature"]').fill("3");
await page.getByTestId("title-NVIDIA").click();
let value = await page
.locator('//*[@id="float_float_temperature"]')
.inputValue();
await page.getByTestId("edit-button-modal").click();
expect(value).toBe("2");
await page.getByTestId("showseed").click();
await page.locator('//*[@id="float_float_temperature"]').click();
await page.locator('//*[@id="float_float_temperature"]').fill("");
await page.locator('//*[@id="float_float_temperature"]').fill("-3");
await page.getByText("Close").last().click();
value = await page
.locator('//*[@id="float_float_temperature"]')
.inputValue();
await page.locator('//*[@id="int_int_seed"]').click();
await page.locator('//*[@id="int_int_seed"]').fill("");
await page.locator('//*[@id="int_int_seed"]').fill("3");
expect(value).toBe("-2");
let value = await page.locator('//*[@id="int_int_seed"]').inputValue();
expect(value).toBe("3");
await page.locator('//*[@id="int_int_seed"]').click();
await page.locator('//*[@id="int_int_seed"]').fill("");
await page.locator('//*[@id="int_int_seed"]').fill("-3");
value = await page.locator('//*[@id="int_int_seed"]').inputValue();
expect(value).toBe("-3");
await page.getByTestId("more-options-modal").click();
await page.getByTestId("advanced-button-modal").click();
await page.getByTestId("showmirostat_eta").click();
expect(
await page.locator('//*[@id="showmirostat_eta"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showmirostat_eta").click();
expect(
await page.locator('//*[@id="showmirostat_eta"]').isChecked(),
).toBeFalsy();
await page.getByTestId("showmirostat_eta").click();
expect(
await page.locator('//*[@id="showmirostat_eta"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showmirostat_eta").click();
expect(
await page.locator('//*[@id="showmirostat_eta"]').isChecked(),
).toBeFalsy();
await page.getByTestId("showmirostat_tau").click();
expect(
await page.locator('//*[@id="showmirostat_tau"]').isChecked(),
).toBeTruthy();
await page.getByTestId("showmirostat_tau").click();
expect(
await page.locator('//*[@id="showmirostat_tau"]').isChecked(),
).toBeFalsy();
await page.getByText("Close").last().click();
const plusButtonLocator = page.locator(
'//*[@id="float_float_temperature"]',
);
const plusButtonLocator = page.locator('//*[@id="int_int_edit_seed"]');
const elementCount = await plusButtonLocator?.count();
if (elementCount === 0) {
expect(true).toBeTruthy();
@ -91,34 +63,24 @@ test(
await page.getByTestId("more-options-modal").click();
await page.getByTestId("advanced-button-modal").click();
// showtemperature
await page.locator('//*[@id="showtemperature"]').click();
expect(
await page.locator('//*[@id="showtemperature"]').isChecked(),
).toBeTruthy();
await page.getByText("Close").last().click();
await page.locator('//*[@id="float_float_temperature"]').click();
await page.getByTestId("float_float_temperature").fill("");
await page.locator('//*[@id="int_int_seed"]').click();
await page.getByTestId("int_int_seed").fill("");
await page.locator('//*[@id="float_float_temperature"]').fill("3");
await page.locator('//*[@id="int_int_seed"]').fill("3");
let value = await page
.locator('//*[@id="float_float_temperature"]')
.inputValue();
let value = await page.locator('//*[@id="int_int_seed"]').inputValue();
expect(value).toBe("1");
expect(value).toBe("3");
await page.locator('//*[@id="float_float_temperature"]').click();
await page.getByTestId("float_float_temperature").fill("");
await page.locator('//*[@id="int_int_seed"]').click();
await page.getByTestId("int_int_seed").fill("");
await page.locator('//*[@id="float_float_temperature"]').fill("-3");
await page.locator('//*[@id="int_int_seed"]').fill("-3");
value = await page
.locator('//*[@id="float_float_temperature"]')
.inputValue();
value = await page.locator('//*[@id="int_int_seed"]').inputValue();
expect(value).toBe("-1");
expect(value).toBe("-3");
}
},
);