test on Toogle, input, int
This commit is contained in:
parent
4544abe96d
commit
ecf99cf179
13 changed files with 1040 additions and 472 deletions
|
|
@ -54,6 +54,7 @@ export default function ParameterComponent({
|
||||||
optionalHandle = null,
|
optionalHandle = null,
|
||||||
info = "",
|
info = "",
|
||||||
showNode,
|
showNode,
|
||||||
|
index = "",
|
||||||
}: ParameterComponentType): JSX.Element {
|
}: ParameterComponentType): JSX.Element {
|
||||||
const ref = useRef<HTMLDivElement>(null);
|
const ref = useRef<HTMLDivElement>(null);
|
||||||
const refHtml = useRef<HTMLDivElement & ReactNode>(null);
|
const refHtml = useRef<HTMLDivElement & ReactNode>(null);
|
||||||
|
|
@ -329,6 +330,7 @@ export default function ParameterComponent({
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<InputComponent
|
<InputComponent
|
||||||
|
id={"input-" + index}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
password={data.node?.template[name].password ?? false}
|
password={data.node?.template[name].password ?? false}
|
||||||
value={data.node?.template[name].value ?? ""}
|
value={data.node?.template[name].value ?? ""}
|
||||||
|
|
@ -339,6 +341,7 @@ export default function ParameterComponent({
|
||||||
) : left === true && type === "bool" ? (
|
) : left === true && type === "bool" ? (
|
||||||
<div className="mt-2 w-full">
|
<div className="mt-2 w-full">
|
||||||
<ToggleShadComponent
|
<ToggleShadComponent
|
||||||
|
id={"toggle-" + index}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
enabled={data.node?.template[name].value ?? false}
|
enabled={data.node?.template[name].value ?? false}
|
||||||
setEnabled={(isEnabled) => {
|
setEnabled={(isEnabled) => {
|
||||||
|
|
@ -397,6 +400,7 @@ export default function ParameterComponent({
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
value={data.node?.template[name].value ?? ""}
|
value={data.node?.template[name].value ?? ""}
|
||||||
onChange={handleOnNewValue}
|
onChange={handleOnNewValue}
|
||||||
|
id={"int-input-" + index}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
) : left === true && type === "prompt" ? (
|
) : left === true && type === "prompt" ? (
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,7 @@ export default function GenericNode({
|
||||||
data.node!.template[templateField].show &&
|
data.node!.template[templateField].show &&
|
||||||
!data.node!.template[templateField].advanced && (
|
!data.node!.template[templateField].advanced && (
|
||||||
<ParameterComponent
|
<ParameterComponent
|
||||||
|
index={idx.toString()}
|
||||||
key={
|
key={
|
||||||
(data.node!.template[
|
(data.node!.template[
|
||||||
templateField
|
templateField
|
||||||
|
|
@ -348,6 +349,7 @@ export default function GenericNode({
|
||||||
{data.node!.template[templateField].show &&
|
{data.node!.template[templateField].show &&
|
||||||
!data.node!.template[templateField].advanced ? (
|
!data.node!.template[templateField].advanced ? (
|
||||||
<ParameterComponent
|
<ParameterComponent
|
||||||
|
index={idx.toString()}
|
||||||
key={
|
key={
|
||||||
(data.node!.template[templateField].input_types?.join(
|
(data.node!.template[templateField].input_types?.join(
|
||||||
";"
|
";"
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,6 @@ export default function DictComponent({
|
||||||
}, [value]);
|
}, [value]);
|
||||||
|
|
||||||
const ref = useRef(value);
|
const ref = useRef(value);
|
||||||
debugger;
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ export default function InputComponent({
|
||||||
editNode = false,
|
editNode = false,
|
||||||
placeholder = "Type something...",
|
placeholder = "Type something...",
|
||||||
className,
|
className,
|
||||||
|
id = "",
|
||||||
}: InputComponentType): JSX.Element {
|
}: InputComponentType): JSX.Element {
|
||||||
const [pwdVisible, setPwdVisible] = useState(false);
|
const [pwdVisible, setPwdVisible] = useState(false);
|
||||||
|
|
||||||
|
|
@ -30,6 +31,7 @@ export default function InputComponent({
|
||||||
{isForm ? (
|
{isForm ? (
|
||||||
<Form.Control asChild>
|
<Form.Control asChild>
|
||||||
<Input
|
<Input
|
||||||
|
id={"form-" + id}
|
||||||
type={password && !pwdVisible ? "password" : "text"}
|
type={password && !pwdVisible ? "password" : "text"}
|
||||||
value={value}
|
value={value}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|
@ -54,6 +56,7 @@ export default function InputComponent({
|
||||||
</Form.Control>
|
</Form.Control>
|
||||||
) : (
|
) : (
|
||||||
<Input
|
<Input
|
||||||
|
id={id}
|
||||||
type="text"
|
type="text"
|
||||||
value={value}
|
value={value}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ export default function IntComponent({
|
||||||
onChange,
|
onChange,
|
||||||
disabled,
|
disabled,
|
||||||
editNode = false,
|
editNode = false,
|
||||||
|
id = "",
|
||||||
}: FloatComponentType): JSX.Element {
|
}: FloatComponentType): JSX.Element {
|
||||||
const min = 0;
|
const min = 0;
|
||||||
|
|
||||||
|
|
@ -21,6 +22,7 @@ export default function IntComponent({
|
||||||
return (
|
return (
|
||||||
<div className="w-full">
|
<div className="w-full">
|
||||||
<Input
|
<Input
|
||||||
|
id={id}
|
||||||
onKeyDown={(event) => {
|
onKeyDown={(event) => {
|
||||||
if (
|
if (
|
||||||
event.key !== "Backspace" &&
|
event.key !== "Backspace" &&
|
||||||
|
|
|
||||||
|
|
@ -216,6 +216,7 @@ const EditNodeModal = forwardRef(
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<InputComponent
|
<InputComponent
|
||||||
|
id={"input-" + index}
|
||||||
editNode={true}
|
editNode={true}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
password={
|
password={
|
||||||
|
|
@ -311,6 +312,7 @@ const EditNodeModal = forwardRef(
|
||||||
<div className="ml-auto">
|
<div className="ml-auto">
|
||||||
{" "}
|
{" "}
|
||||||
<ToggleShadComponent
|
<ToggleShadComponent
|
||||||
|
id={"toggle-edit-" + index}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
enabled={
|
enabled={
|
||||||
myData.current.node.template[
|
myData.current.node.template[
|
||||||
|
|
@ -369,6 +371,7 @@ const EditNodeModal = forwardRef(
|
||||||
.type === "int" ? (
|
.type === "int" ? (
|
||||||
<div className="mx-auto">
|
<div className="mx-auto">
|
||||||
<IntComponent
|
<IntComponent
|
||||||
|
id={"int-input-" + index}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
editNode={true}
|
editNode={true}
|
||||||
value={
|
value={
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ export type InputComponentType = {
|
||||||
showPass?: boolean;
|
showPass?: boolean;
|
||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
id?: string;
|
||||||
};
|
};
|
||||||
export type ToggleComponentType = {
|
export type ToggleComponentType = {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
|
|
@ -48,6 +49,7 @@ export type ParameterComponentType = {
|
||||||
optionalHandle?: Array<String> | null;
|
optionalHandle?: Array<String> | null;
|
||||||
info?: string;
|
info?: string;
|
||||||
showNode?: boolean;
|
showNode?: boolean;
|
||||||
|
index?: string;
|
||||||
};
|
};
|
||||||
export type InputListComponentType = {
|
export type InputListComponentType = {
|
||||||
value: string[];
|
value: string[];
|
||||||
|
|
@ -131,24 +133,25 @@ export type FloatComponentType = {
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
onChange: (value: string) => void;
|
onChange: (value: string) => void;
|
||||||
editNode?: boolean;
|
editNode?: boolean;
|
||||||
|
id?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TooltipComponentType = {
|
export type TooltipComponentType = {
|
||||||
children: ReactElement;
|
children: ReactElement;
|
||||||
title: string | ReactElement;
|
title: string | ReactElement;
|
||||||
placement?:
|
placement?:
|
||||||
| "bottom-end"
|
| "bottom-end"
|
||||||
| "bottom-start"
|
| "bottom-start"
|
||||||
| "bottom"
|
| "bottom"
|
||||||
| "left-end"
|
| "left-end"
|
||||||
| "left-start"
|
| "left-start"
|
||||||
| "left"
|
| "left"
|
||||||
| "right-end"
|
| "right-end"
|
||||||
| "right-start"
|
| "right-start"
|
||||||
| "right"
|
| "right"
|
||||||
| "top-end"
|
| "top-end"
|
||||||
| "top-start"
|
| "top-start"
|
||||||
| "top";
|
| "top";
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ProgressBarType = {
|
export type ProgressBarType = {
|
||||||
|
|
|
||||||
415
src/frontend/tests/floatComponent.spec.ts
Normal file
415
src/frontend/tests/floatComponent.spec.ts
Normal file
|
|
@ -0,0 +1,415 @@
|
||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("FloatComponent", async ({ page }) => {
|
||||||
|
await page.goto("http://localhost:3000/");
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.locator('//*[@id="new-project-btn"]').click();
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.getByPlaceholder("Search").click();
|
||||||
|
await page.getByPlaceholder("Search").fill("llamacpp");
|
||||||
|
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="sideLlamaCpp"]')
|
||||||
|
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||||
|
await page.mouse.up();
|
||||||
|
await page.mouse.down();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="float-input"]').click();
|
||||||
|
await page.locator('//*[@id="float-input"]').fill("3");
|
||||||
|
|
||||||
|
let value = await page.locator('//*[@id="float-input"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "2") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="float-input"]').click();
|
||||||
|
await page.locator('//*[@id="float-input"]').fill("-3");
|
||||||
|
|
||||||
|
value = await page.locator('//*[@id="float-input"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "-2") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="editAdvancedIcon"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showcache"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showecho
|
||||||
|
await page.locator('//*[@id="showecho"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showecho"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showf16_kv
|
||||||
|
await page.locator('//*[@id="showf16_kv"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showf16_kv"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showgrammar_path
|
||||||
|
await page.locator('//*[@id="showgrammar_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showgrammar_path"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showlast_n_tokens_size
|
||||||
|
await page.locator('//*[@id="showlast_n_tokens_size"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlast_n_tokens_size"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showlogits_all
|
||||||
|
await page.locator('//*[@id="showlogits_all"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlogits_all"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showlogprobs
|
||||||
|
await page.locator('//*[@id="showlogprobs"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlogprobs"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showlora_base
|
||||||
|
await page.locator('//*[@id="showlora_base"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlora_base"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showlora_path
|
||||||
|
await page.locator('//*[@id="showlora_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlora_path"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showmax_tokens
|
||||||
|
await page.locator('//*[@id="showmax_tokens"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmax_tokens"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showmetadata
|
||||||
|
await page.locator('//*[@id="showmetadata"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmetadata"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showmodel_kwargs
|
||||||
|
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showmodel_path
|
||||||
|
await page.locator('//*[@id="showmodel_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmodel_path"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// shown_batch
|
||||||
|
await page.locator('//*[@id="shown_batch"]').click();
|
||||||
|
expect(await page.locator('//*[@id="shown_batch"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// shown_ctx
|
||||||
|
await page.locator('//*[@id="shown_ctx"]').click();
|
||||||
|
expect(await page.locator('//*[@id="shown_ctx"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// shown_gpu_layers
|
||||||
|
await page.locator('//*[@id="shown_gpu_layers"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="shown_gpu_layers"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// shown_parts
|
||||||
|
await page.locator('//*[@id="shown_parts"]').click();
|
||||||
|
expect(await page.locator('//*[@id="shown_parts"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// shown_threads
|
||||||
|
await page.locator('//*[@id="shown_threads"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="shown_threads"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showrepeat_penalty
|
||||||
|
await page.locator('//*[@id="showrepeat_penalty"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrepeat_penalty"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showrope_freq_base
|
||||||
|
await page.locator('//*[@id="showrope_freq_base"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrope_freq_base"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showrope_freq_scale
|
||||||
|
await page.locator('//*[@id="showrope_freq_scale"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrope_freq_scale"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showseed
|
||||||
|
await page.locator('//*[@id="showseed"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showseed"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showstop
|
||||||
|
await page.locator('//*[@id="showstop"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showstop"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showstreaming
|
||||||
|
await page.locator('//*[@id="showstreaming"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showstreaming"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showsuffix
|
||||||
|
await page.locator('//*[@id="showsuffix"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showsuffix"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showtags
|
||||||
|
await page.locator('//*[@id="showtags"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showtags"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showtemperature
|
||||||
|
await page.locator('//*[@id="showtemperature"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showtop_k
|
||||||
|
await page.locator('//*[@id="showtop_k"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showtop_k"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showtop_p
|
||||||
|
await page.locator('//*[@id="showtop_p"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showtop_p"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showuse_mlock
|
||||||
|
await page.locator('//*[@id="showuse_mlock"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showuse_mlock"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showuse_mmap
|
||||||
|
await page.locator('//*[@id="showuse_mmap"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showuse_mmap"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// showverbose
|
||||||
|
await page.locator('//*[@id="showverbose"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showverbose"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
// showvocab_only
|
||||||
|
await page.locator('//*[@id="showvocab_only"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showvocab_only"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showcache"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showecho
|
||||||
|
await page.locator('//*[@id="showecho"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showecho"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showf16_kv
|
||||||
|
await page.locator('//*[@id="showf16_kv"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showf16_kv"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showgrammar_path
|
||||||
|
await page.locator('//*[@id="showgrammar_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showgrammar_path"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showlast_n_tokens_size
|
||||||
|
await page.locator('//*[@id="showlast_n_tokens_size"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlast_n_tokens_size"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showlogits_all
|
||||||
|
await page.locator('//*[@id="showlogits_all"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlogits_all"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showlogprobs
|
||||||
|
await page.locator('//*[@id="showlogprobs"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showlogprobs"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showlora_base
|
||||||
|
await page.locator('//*[@id="showlora_base"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlora_base"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showlora_path
|
||||||
|
await page.locator('//*[@id="showlora_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showlora_path"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showmax_tokens
|
||||||
|
await page.locator('//*[@id="showmax_tokens"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmax_tokens"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showmetadata
|
||||||
|
await page.locator('//*[@id="showmetadata"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showmodel_kwargs
|
||||||
|
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmodel_kwargs"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showmodel_path
|
||||||
|
await page.locator('//*[@id="showmodel_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmodel_path"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
// shown_batch
|
||||||
|
await page.locator('//*[@id="shown_batch"]').click();
|
||||||
|
expect(await page.locator('//*[@id="shown_batch"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// shown_ctx
|
||||||
|
await page.locator('//*[@id="shown_ctx"]').click();
|
||||||
|
expect(await page.locator('//*[@id="shown_ctx"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// shown_gpu_layers
|
||||||
|
await page.locator('//*[@id="shown_gpu_layers"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="shown_gpu_layers"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// shown_parts
|
||||||
|
await page.locator('//*[@id="shown_parts"]').click();
|
||||||
|
expect(await page.locator('//*[@id="shown_parts"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// shown_threads
|
||||||
|
await page.locator('//*[@id="shown_threads"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="shown_threads"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showrepeat_penalty
|
||||||
|
await page.locator('//*[@id="showrepeat_penalty"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrepeat_penalty"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showrope_freq_base
|
||||||
|
await page.locator('//*[@id="showrope_freq_base"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrope_freq_base"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showrope_freq_scale
|
||||||
|
await page.locator('//*[@id="showrope_freq_scale"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrope_freq_scale"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showseed
|
||||||
|
await page.locator('//*[@id="showseed"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showseed"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showstop
|
||||||
|
await page.locator('//*[@id="showstop"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showstop"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showstreaming
|
||||||
|
await page.locator('//*[@id="showstreaming"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showstreaming"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showsuffix
|
||||||
|
await page.locator('//*[@id="showsuffix"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showsuffix"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showtags
|
||||||
|
await page.locator('//*[@id="showtags"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showtags"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showtop_k
|
||||||
|
await page.locator('//*[@id="showtop_k"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showtop_k"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showtop_p
|
||||||
|
await page.locator('//*[@id="showtop_p"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showtop_p"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showuse_mlock
|
||||||
|
await page.locator('//*[@id="showuse_mlock"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showuse_mlock"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
// showuse_mmap
|
||||||
|
await page.locator('//*[@id="showuse_mmap"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showuse_mmap"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showverbose
|
||||||
|
await page.locator('//*[@id="showverbose"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showverbose"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
// showvocab_only
|
||||||
|
await page.locator('//*[@id="showvocab_only"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showvocab_only"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
const plusButtonLocator = page.locator('//*[@id="float-input"]');
|
||||||
|
const elementCount = await plusButtonLocator.count();
|
||||||
|
if (elementCount === 0) {
|
||||||
|
expect(true).toBeTruthy();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="editAdvancedIcon"]').click();
|
||||||
|
|
||||||
|
// showtemperature
|
||||||
|
await page.locator('//*[@id="showtemperature"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showtemperature"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
await page.locator('//*[@id="float-input"]').click();
|
||||||
|
await page.locator('//*[@id="float-input"]').fill("3");
|
||||||
|
|
||||||
|
let value = await page.locator('//*[@id="float-input"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "2") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="float-input"]').click();
|
||||||
|
await page.locator('//*[@id="float-input"]').fill("-3");
|
||||||
|
|
||||||
|
value = await page.locator('//*[@id="float-input"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "-2") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
162
src/frontend/tests/inputComponent.spec.ts
Normal file
162
src/frontend/tests/inputComponent.spec.ts
Normal file
|
|
@ -0,0 +1,162 @@
|
||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("InputComponent", async ({ page }) => {
|
||||||
|
await page.goto("http://localhost:3000/");
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.locator('//*[@id="new-project-btn"]').click();
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.getByPlaceholder("Search").click();
|
||||||
|
await page.getByPlaceholder("Search").fill("Chroma");
|
||||||
|
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="sideChroma"]')
|
||||||
|
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||||
|
await page.mouse.up();
|
||||||
|
await page.mouse.down();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="input-10"]').click();
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="input-10"]')
|
||||||
|
.fill("collection_name_test_123123123!@#$&*(&%$@");
|
||||||
|
|
||||||
|
let value = await page.locator('//*[@id="input-10"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "collection_name_test_123123123!@#$&*(&%$@") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="editAdvancedIcon"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_cors_allow_origins"]').click();
|
||||||
|
expect(
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="showchroma_server_cors_allow_origins"]')
|
||||||
|
.isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_grpc_port"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_grpc_port"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_host"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_host"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_http_port"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_http_port"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showcollection_name"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showcollection_name"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showpersist"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showpersist"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showpersist_directory"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showpersist_directory"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_cors_allow_origins"]').click();
|
||||||
|
expect(
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="showchroma_server_cors_allow_origins"]')
|
||||||
|
.isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_grpc_port"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_grpc_port"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_host"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_host"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_http_port"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_http_port"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showchroma_server_ssl_enabled"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showpersist"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showpersist"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showpersist_directory"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showpersist_directory"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showsearch_kwargs"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showsearch_kwargs"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
let valueEditNode = await page.locator('//*[@id="input-5"]').inputValue();
|
||||||
|
|
||||||
|
if (valueEditNode != "collection_name_test_123123123!@#$&*(&%$@") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="input-5"]').click();
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="input-5"]')
|
||||||
|
.fill("NEW_collection_name_test_123123123!@#$&*(&%$@");
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
const plusButtonLocator = page.locator('//*[@id="input-10"]');
|
||||||
|
const elementCount = await plusButtonLocator.count();
|
||||||
|
if (elementCount === 0) {
|
||||||
|
expect(true).toBeTruthy();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="editAdvancedIcon"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showcollection_name"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showcollection_name"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
let value = await page.locator('//*[@id="input-10"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "NEW_collection_name_test_123123123!@#$&*(&%$@") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
118
src/frontend/tests/intComponent.spec.ts
Normal file
118
src/frontend/tests/intComponent.spec.ts
Normal file
|
|
@ -0,0 +1,118 @@
|
||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("IntComponent", async ({ page }) => {
|
||||||
|
await page.goto("http://localhost:3000/");
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.locator('//*[@id="new-project-btn"]').click();
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.getByPlaceholder("Search").click();
|
||||||
|
await page.getByPlaceholder("Search").fill("getrequest");
|
||||||
|
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="sideGET Request"]')
|
||||||
|
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||||
|
await page.mouse.up();
|
||||||
|
await page.mouse.down();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="int-input-2"]').click();
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="int-input-2"]')
|
||||||
|
.fill("123456789123456789123456789");
|
||||||
|
|
||||||
|
let value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "123456789123456789123456789") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="int-input-2"]').click();
|
||||||
|
await page.locator('//*[@id="int-input-2"]').fill("-3");
|
||||||
|
|
||||||
|
value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "0") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div')
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="advancedIcon"]').click();
|
||||||
|
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
||||||
|
|
||||||
|
value = await page.locator('//*[@id="int-input-1"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "0") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="int-input-1"]').click();
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="int-input-1"]')
|
||||||
|
.fill("123456789123456789123456789");
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showheaders"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showheaders"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showtimeout"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showtimeout"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showurl"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showurl"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showheaders"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showheaders"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showurl"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showurl"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
const plusButtonLocator = page.locator('//*[@id="int-input-2"]');
|
||||||
|
const elementCount = await plusButtonLocator.count();
|
||||||
|
if (elementCount === 0) {
|
||||||
|
expect(true).toBeTruthy();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div')
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="advancedIcon"]').click();
|
||||||
|
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showtimeout"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showtimeout"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
const valueEditNode = await page
|
||||||
|
.locator('//*[@id="int-input-1"]')
|
||||||
|
.inputValue();
|
||||||
|
|
||||||
|
if (valueEditNode != "123456789123456789123456789") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
await page.locator('//*[@id="int-input-2"]').click();
|
||||||
|
await page.locator('//*[@id="int-input-2"]').fill("3");
|
||||||
|
|
||||||
|
let value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "3") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="int-input-2"]').click();
|
||||||
|
await page.locator('//*[@id="int-input-2"]').fill("-3");
|
||||||
|
|
||||||
|
value = await page.locator('//*[@id="int-input-2"]').inputValue();
|
||||||
|
|
||||||
|
if (value != "0") {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
149
src/frontend/tests/keyPairListComponent.spec.ts
Normal file
149
src/frontend/tests/keyPairListComponent.spec.ts
Normal file
|
|
@ -0,0 +1,149 @@
|
||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("KeypairListComponent", async ({ page }) => {
|
||||||
|
await page.goto("http://localhost:3000/");
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.locator('//*[@id="new-project-btn"]').click();
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.getByPlaceholder("Search").click();
|
||||||
|
await page.getByPlaceholder("Search").fill("csv");
|
||||||
|
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="sideCSVLoader"]')
|
||||||
|
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||||
|
await page.mouse.up();
|
||||||
|
await page.mouse.down();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="keypair0"]').click();
|
||||||
|
await page.locator('//*[@id="keypair0"]').fill("testtesttesttest");
|
||||||
|
await page.locator('//*[@id="keypair100"]').click();
|
||||||
|
await page.locator('//*[@id="keypair100"]').fill("testtesttesttesttesttest");
|
||||||
|
|
||||||
|
const plusButtonLocatorNode = page.locator('//*[@id="plusbtn0"]');
|
||||||
|
const elementCountNode = await plusButtonLocatorNode.count();
|
||||||
|
if (elementCountNode > 0) {
|
||||||
|
await plusButtonLocatorNode.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="keypair1"]').click();
|
||||||
|
await page.locator('//*[@id="keypair1"]').fill("testtesttesttest1");
|
||||||
|
await page.locator('//*[@id="keypair101"]').click();
|
||||||
|
await page.locator('//*[@id="keypair101"]').fill("testtesttesttesttesttest1");
|
||||||
|
await page.locator('//*[@id="plusbtn1"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="keypair2"]').click();
|
||||||
|
await page.locator('//*[@id="keypair2"]').fill("testtesttesttest2");
|
||||||
|
await page.locator('//*[@id="keypair102"]').click();
|
||||||
|
await page.locator('//*[@id="keypair102"]').fill("testtesttesttesttesttest2");
|
||||||
|
|
||||||
|
await page.locator('//*[@id="minusbtn1"]').click();
|
||||||
|
|
||||||
|
const keyPairVerification = page.locator('//*[@id="keypair102"]');
|
||||||
|
const elementKeyCount = await keyPairVerification.count();
|
||||||
|
|
||||||
|
if (elementKeyCount === 0) {
|
||||||
|
expect(true).toBeTruthy();
|
||||||
|
} else {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="advancedIcon"]').click();
|
||||||
|
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showfile_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showfile_path"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
await page.locator('//*[@id="showmetadata"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeFalsy();
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
const plusButtonLocator = page.locator('//*[@id="plusbtn0"]');
|
||||||
|
const elementCount = await plusButtonLocator.count();
|
||||||
|
if (elementCount === 0) {
|
||||||
|
expect(true).toBeTruthy();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="advancedIcon"]').click();
|
||||||
|
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showfile_path"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showfile_path"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
await page.locator('//*[@id="showmetadata"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmetadata"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="keypair0"]').click();
|
||||||
|
await page.locator('//*[@id="keypair0"]').fill("testtesttesttest");
|
||||||
|
await page.locator('//*[@id="keypair100"]').click();
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="keypair100"]')
|
||||||
|
.fill("testtesttesttesttesttest");
|
||||||
|
|
||||||
|
const plusButtonLocator = page.locator('//*[@id="plusbtn0"]');
|
||||||
|
const elementCount = await plusButtonLocator.count();
|
||||||
|
if (elementCount > 0) {
|
||||||
|
await plusButtonLocator.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
await page.locator('//*[@id="keypair1"]').click();
|
||||||
|
await page.locator('//*[@id="keypair1"]').fill("testtesttesttest1");
|
||||||
|
await page.locator('//*[@id="keypair101"]').click();
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="keypair101"]')
|
||||||
|
.fill("testtesttesttesttesttest1");
|
||||||
|
await page.locator('//*[@id="plusbtn1"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="keypair2"]').click();
|
||||||
|
await page.locator('//*[@id="keypair2"]').fill("testtesttesttest2");
|
||||||
|
await page.locator('//*[@id="keypair102"]').click();
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="keypair102"]')
|
||||||
|
.fill("testtesttesttesttesttest2");
|
||||||
|
|
||||||
|
await page.locator('//*[@id="minusbtn1"]').click();
|
||||||
|
|
||||||
|
const keyPairVerification = page.locator('//*[@id="keypair102"]');
|
||||||
|
const elementKeyCount = await keyPairVerification.count();
|
||||||
|
|
||||||
|
if (elementKeyCount === 0) {
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
const key1 = await page.locator('//*[@id="keypair0"]').inputValue();
|
||||||
|
const value1 = await page.locator('//*[@id="keypair100"]').inputValue();
|
||||||
|
const key2 = await page.locator('//*[@id="keypair1"]').inputValue();
|
||||||
|
const value2 = await page.locator('//*[@id="keypair101"]').inputValue();
|
||||||
|
|
||||||
|
if (
|
||||||
|
key1 === "testtesttesttest" &&
|
||||||
|
value1 === "testtesttesttesttesttest" &&
|
||||||
|
key2 === "testtesttesttest2" &&
|
||||||
|
value2 === "testtesttesttesttesttest2"
|
||||||
|
) {
|
||||||
|
expect(true).toBeTruthy();
|
||||||
|
} else {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
expect(false).toBeTruthy();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
@ -1,459 +0,0 @@
|
||||||
import { expect, test } from "@playwright/test";
|
|
||||||
|
|
||||||
test("KeypairListComponent", async ({ page }) => {
|
|
||||||
await page.goto('http://localhost:3000/');
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
await page.locator('//*[@id="new-project-btn"]').click();
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
await page.getByPlaceholder('Search').click();
|
|
||||||
await page.getByPlaceholder('Search').fill('csv');
|
|
||||||
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
await page.locator('//*[@id="sideCSVLoader"]').dragTo(page.locator('//*[@id="react-flow-id"]'));
|
|
||||||
await page.mouse.up();
|
|
||||||
await page.mouse.down();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="keypair0"]').click();
|
|
||||||
await page.locator('//*[@id="keypair0"]').fill('testtesttesttest');
|
|
||||||
await page.locator('//*[@id="keypair100"]').click();
|
|
||||||
await page.locator('//*[@id="keypair100"]').fill('testtesttesttesttesttest');
|
|
||||||
|
|
||||||
const plusButtonLocatorNode = page.locator('//*[@id="plusbtn0"]');
|
|
||||||
const elementCountNode = await plusButtonLocatorNode.count();
|
|
||||||
if (elementCountNode > 0) {
|
|
||||||
await plusButtonLocatorNode.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.locator('//*[@id="keypair1"]').click();
|
|
||||||
await page.locator('//*[@id="keypair1"]').fill('testtesttesttest1');
|
|
||||||
await page.locator('//*[@id="keypair101"]').click();
|
|
||||||
await page.locator('//*[@id="keypair101"]').fill('testtesttesttesttesttest1');
|
|
||||||
await page.locator('//*[@id="plusbtn1"]').click();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="keypair2"]').click();
|
|
||||||
await page.locator('//*[@id="keypair2"]').fill('testtesttesttest2');
|
|
||||||
await page.locator('//*[@id="keypair102"]').click();
|
|
||||||
await page.locator('//*[@id="keypair102"]').fill('testtesttesttesttesttest2');
|
|
||||||
|
|
||||||
await page.locator('//*[@id="minusbtn1"]').click();
|
|
||||||
|
|
||||||
const keyPairVerification = page.locator('//*[@id="keypair102"]');
|
|
||||||
const elementKeyCount = await keyPairVerification.count();
|
|
||||||
|
|
||||||
if (elementKeyCount === 0) {
|
|
||||||
expect(true).toBeTruthy();
|
|
||||||
|
|
||||||
} else {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div').click();
|
|
||||||
await page.locator('//*[@id="advancedIcon"]').click();
|
|
||||||
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="showfile_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showfile_path"]').isChecked()).toBeFalsy();
|
|
||||||
await page.locator('//*[@id="showmetadata"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeFalsy();
|
|
||||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
|
||||||
|
|
||||||
const plusButtonLocator = page.locator('//*[@id="plusbtn0"]');
|
|
||||||
const elementCount = await plusButtonLocator.count();
|
|
||||||
if (elementCount === 0) {
|
|
||||||
expect(true).toBeTruthy();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div').click();
|
|
||||||
await page.locator('//*[@id="advancedIcon"]').click();
|
|
||||||
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="showfile_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showfile_path"]').isChecked()).toBeTruthy();
|
|
||||||
await page.locator('//*[@id="showmetadata"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="keypair0"]').click();
|
|
||||||
await page.locator('//*[@id="keypair0"]').fill('testtesttesttest');
|
|
||||||
await page.locator('//*[@id="keypair100"]').click();
|
|
||||||
await page.locator('//*[@id="keypair100"]').fill('testtesttesttesttesttest');
|
|
||||||
|
|
||||||
const plusButtonLocator = page.locator('//*[@id="plusbtn0"]');
|
|
||||||
const elementCount = await plusButtonLocator.count();
|
|
||||||
if (elementCount > 0) {
|
|
||||||
await plusButtonLocator.click();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.locator('//*[@id="keypair1"]').click();
|
|
||||||
await page.locator('//*[@id="keypair1"]').fill('testtesttesttest1');
|
|
||||||
await page.locator('//*[@id="keypair101"]').click();
|
|
||||||
await page.locator('//*[@id="keypair101"]').fill('testtesttesttesttesttest1');
|
|
||||||
await page.locator('//*[@id="plusbtn1"]').click();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="keypair2"]').click();
|
|
||||||
await page.locator('//*[@id="keypair2"]').fill('testtesttesttest2');
|
|
||||||
await page.locator('//*[@id="keypair102"]').click();
|
|
||||||
await page.locator('//*[@id="keypair102"]').fill('testtesttesttesttesttest2');
|
|
||||||
|
|
||||||
await page.locator('//*[@id="minusbtn1"]').click();
|
|
||||||
|
|
||||||
const keyPairVerification = page.locator('//*[@id="keypair102"]');
|
|
||||||
const elementKeyCount = await keyPairVerification.count();
|
|
||||||
|
|
||||||
if (elementKeyCount === 0) {
|
|
||||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
|
||||||
|
|
||||||
const key1 = await page.locator('//*[@id="keypair0"]').inputValue();
|
|
||||||
const value1 = await page.locator('//*[@id="keypair100"]').inputValue();
|
|
||||||
const key2 = await page.locator('//*[@id="keypair1"]').inputValue();
|
|
||||||
const value2 = await page.locator('//*[@id="keypair101"]').inputValue();
|
|
||||||
|
|
||||||
if (key1 === 'testtesttesttest' && value1 === 'testtesttesttesttesttest' && key2 === 'testtesttesttest2' && value2 === 'testtesttesttesttesttest2') {
|
|
||||||
expect(true).toBeTruthy();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
test("FloatComponent", async ({ page }) => {
|
|
||||||
await page.goto('http://localhost:3000/');
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
await page.locator('//*[@id="new-project-btn"]').click();
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
await page.getByPlaceholder('Search').click();
|
|
||||||
await page.getByPlaceholder('Search').fill('llamacpp');
|
|
||||||
|
|
||||||
await page.waitForTimeout(2000);
|
|
||||||
|
|
||||||
await page.locator('//*[@id="sideLlamaCpp"]').dragTo(page.locator('//*[@id="react-flow-id"]'));
|
|
||||||
await page.mouse.up();
|
|
||||||
await page.mouse.down();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="float-input"]').click();
|
|
||||||
await page.locator('//*[@id="float-input"]').fill('3');
|
|
||||||
|
|
||||||
let value = await page.locator('//*[@id="float-input"]').inputValue();
|
|
||||||
|
|
||||||
if (value != "2") {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.locator('//*[@id="float-input"]').click();
|
|
||||||
await page.locator('//*[@id="float-input"]').fill('-3');
|
|
||||||
|
|
||||||
value = await page.locator('//*[@id="float-input"]').inputValue();
|
|
||||||
|
|
||||||
if (value != "-2") {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
await page.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div').click();
|
|
||||||
await page.locator('//*[@id="editAdvancedIcon"]').click();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="showcache"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showecho
|
|
||||||
await page.locator('//*[@id="showecho"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showecho"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showf16_kv
|
|
||||||
await page.locator('//*[@id="showf16_kv"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showf16_kv"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showgrammar_path
|
|
||||||
await page.locator('//*[@id="showgrammar_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showgrammar_path"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showlast_n_tokens_size
|
|
||||||
await page.locator('//*[@id="showlast_n_tokens_size"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlast_n_tokens_size"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showlogits_all
|
|
||||||
await page.locator('//*[@id="showlogits_all"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlogits_all"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showlogprobs
|
|
||||||
await page.locator('//*[@id="showlogprobs"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlogprobs"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showlora_base
|
|
||||||
await page.locator('//*[@id="showlora_base"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlora_base"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showlora_path
|
|
||||||
await page.locator('//*[@id="showlora_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlora_path"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showmax_tokens
|
|
||||||
await page.locator('//*[@id="showmax_tokens"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmax_tokens"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showmetadata
|
|
||||||
await page.locator('//*[@id="showmetadata"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showmodel_kwargs
|
|
||||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmodel_kwargs"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showmodel_path
|
|
||||||
await page.locator('//*[@id="showmodel_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmodel_path"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// shown_batch
|
|
||||||
await page.locator('//*[@id="shown_batch"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_batch"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// shown_ctx
|
|
||||||
await page.locator('//*[@id="shown_ctx"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_ctx"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// shown_gpu_layers
|
|
||||||
await page.locator('//*[@id="shown_gpu_layers"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_gpu_layers"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// shown_parts
|
|
||||||
await page.locator('//*[@id="shown_parts"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_parts"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// shown_threads
|
|
||||||
await page.locator('//*[@id="shown_threads"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_threads"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showrepeat_penalty
|
|
||||||
await page.locator('//*[@id="showrepeat_penalty"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showrepeat_penalty"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showrope_freq_base
|
|
||||||
await page.locator('//*[@id="showrope_freq_base"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showrope_freq_base"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showrope_freq_scale
|
|
||||||
await page.locator('//*[@id="showrope_freq_scale"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showrope_freq_scale"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showseed
|
|
||||||
await page.locator('//*[@id="showseed"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showseed"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showstop
|
|
||||||
await page.locator('//*[@id="showstop"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showstop"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showstreaming
|
|
||||||
await page.locator('//*[@id="showstreaming"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showstreaming"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showsuffix
|
|
||||||
await page.locator('//*[@id="showsuffix"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showsuffix"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showtags
|
|
||||||
await page.locator('//*[@id="showtags"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtags"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showtemperature
|
|
||||||
await page.locator('//*[@id="showtemperature"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtemperature"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showtop_k
|
|
||||||
await page.locator('//*[@id="showtop_k"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtop_k"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showtop_p
|
|
||||||
await page.locator('//*[@id="showtop_p"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtop_p"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showuse_mlock
|
|
||||||
await page.locator('//*[@id="showuse_mlock"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showuse_mlock"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showuse_mmap
|
|
||||||
await page.locator('//*[@id="showuse_mmap"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showuse_mmap"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showverbose
|
|
||||||
await page.locator('//*[@id="showverbose"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showverbose"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// showvocab_only
|
|
||||||
await page.locator('//*[@id="showvocab_only"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showvocab_only"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await page.locator('//*[@id="showcache"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showcache"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showecho
|
|
||||||
await page.locator('//*[@id="showecho"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showecho"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showf16_kv
|
|
||||||
await page.locator('//*[@id="showf16_kv"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showf16_kv"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showgrammar_path
|
|
||||||
await page.locator('//*[@id="showgrammar_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showgrammar_path"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showlast_n_tokens_size
|
|
||||||
await page.locator('//*[@id="showlast_n_tokens_size"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlast_n_tokens_size"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showlogits_all
|
|
||||||
await page.locator('//*[@id="showlogits_all"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlogits_all"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showlogprobs
|
|
||||||
await page.locator('//*[@id="showlogprobs"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlogprobs"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showlora_base
|
|
||||||
await page.locator('//*[@id="showlora_base"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlora_base"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showlora_path
|
|
||||||
await page.locator('//*[@id="showlora_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showlora_path"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showmax_tokens
|
|
||||||
await page.locator('//*[@id="showmax_tokens"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmax_tokens"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showmetadata
|
|
||||||
await page.locator('//*[@id="showmetadata"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showmodel_kwargs
|
|
||||||
await page.locator('//*[@id="showmodel_kwargs"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmodel_kwargs"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showmodel_path
|
|
||||||
await page.locator('//*[@id="showmodel_path"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showmodel_path"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
// shown_batch
|
|
||||||
await page.locator('//*[@id="shown_batch"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_batch"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// shown_ctx
|
|
||||||
await page.locator('//*[@id="shown_ctx"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_ctx"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// shown_gpu_layers
|
|
||||||
await page.locator('//*[@id="shown_gpu_layers"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_gpu_layers"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// shown_parts
|
|
||||||
await page.locator('//*[@id="shown_parts"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_parts"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// shown_threads
|
|
||||||
await page.locator('//*[@id="shown_threads"]').click();
|
|
||||||
expect(await page.locator('//*[@id="shown_threads"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showrepeat_penalty
|
|
||||||
await page.locator('//*[@id="showrepeat_penalty"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showrepeat_penalty"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showrope_freq_base
|
|
||||||
await page.locator('//*[@id="showrope_freq_base"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showrope_freq_base"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showrope_freq_scale
|
|
||||||
await page.locator('//*[@id="showrope_freq_scale"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showrope_freq_scale"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showseed
|
|
||||||
await page.locator('//*[@id="showseed"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showseed"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showstop
|
|
||||||
await page.locator('//*[@id="showstop"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showstop"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showstreaming
|
|
||||||
await page.locator('//*[@id="showstreaming"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showstreaming"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showsuffix
|
|
||||||
await page.locator('//*[@id="showsuffix"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showsuffix"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showtags
|
|
||||||
await page.locator('//*[@id="showtags"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtags"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showtop_k
|
|
||||||
await page.locator('//*[@id="showtop_k"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtop_k"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showtop_p
|
|
||||||
await page.locator('//*[@id="showtop_p"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtop_p"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showuse_mlock
|
|
||||||
await page.locator('//*[@id="showuse_mlock"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showuse_mlock"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showuse_mmap
|
|
||||||
await page.locator('//*[@id="showuse_mmap"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showuse_mmap"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showverbose
|
|
||||||
await page.locator('//*[@id="showverbose"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showverbose"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
// showvocab_only
|
|
||||||
await page.locator('//*[@id="showvocab_only"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showvocab_only"]').isChecked()).toBeFalsy();
|
|
||||||
|
|
||||||
|
|
||||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
|
||||||
|
|
||||||
const plusButtonLocator = page.locator('//*[@id="float-input"]');
|
|
||||||
const elementCount = await plusButtonLocator.count();
|
|
||||||
if (elementCount === 0) {
|
|
||||||
expect(true).toBeTruthy();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div/div/div[1]/div/div[1]/div').click();
|
|
||||||
await page.locator('//*[@id="editAdvancedIcon"]').click();
|
|
||||||
|
|
||||||
// showtemperature
|
|
||||||
await page.locator('//*[@id="showtemperature"]').click();
|
|
||||||
expect(await page.locator('//*[@id="showtemperature"]').isChecked()).toBeTruthy();
|
|
||||||
|
|
||||||
await page.locator('//*[@id="saveChangesBtn"]').click();
|
|
||||||
await page.locator('//*[@id="float-input"]').click();
|
|
||||||
await page.locator('//*[@id="float-input"]').fill('3');
|
|
||||||
|
|
||||||
let value = await page.locator('//*[@id="float-input"]').inputValue();
|
|
||||||
|
|
||||||
if (value != "2") {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
|
|
||||||
await page.locator('//*[@id="float-input"]').click();
|
|
||||||
await page.locator('//*[@id="float-input"]').fill('-3');
|
|
||||||
|
|
||||||
value = await page.locator('//*[@id="float-input"]').inputValue();
|
|
||||||
|
|
||||||
if (value != "-2") {
|
|
||||||
expect(false).toBeTruthy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
167
src/frontend/tests/toggleComponent.spec.ts
Normal file
167
src/frontend/tests/toggleComponent.spec.ts
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
import { expect, test } from "@playwright/test";
|
||||||
|
|
||||||
|
test("ToggleComponent", async ({ page }) => {
|
||||||
|
await page.goto("http://localhost:3000/");
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.locator('//*[@id="new-project-btn"]').click();
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page.getByPlaceholder("Search").click();
|
||||||
|
await page.getByPlaceholder("Search").fill("directoryLoader");
|
||||||
|
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="sideDirectoryLoader"]')
|
||||||
|
.dragTo(page.locator('//*[@id="react-flow-id"]'));
|
||||||
|
await page.mouse.up();
|
||||||
|
await page.mouse.down();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="advancedIcon"]').click();
|
||||||
|
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showload_hidden"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showload_hidden"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator(
|
||||||
|
'//*[@id="react-flow-id"]/div[1]/div[1]/div/div/div[2]/div/div/div[1]/div'
|
||||||
|
)
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="advancedIcon"]').click();
|
||||||
|
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="toggle-edit-1"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showglob"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showglob"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showload_hidden"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showload_hidden"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showmax_concurrency"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmax_concurrency"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showmetadata"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showmetadata"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showpath"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showpath"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showrecursive"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrecursive"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showsilent_errors"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showsilent_errors"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showuse_multithreading"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showuse_multithreading"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showglob"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showglob"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showmax_concurrency"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmax_concurrency"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showmetadata"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showmetadata"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showpath"]').click();
|
||||||
|
expect(await page.locator('//*[@id="showpath"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showrecursive"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showrecursive"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showsilent_errors"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showsilent_errors"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showuse_multithreading"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showuse_multithreading"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
const plusButtonLocator = page.locator('//*[@id="toggle-1"]');
|
||||||
|
const elementCount = await plusButtonLocator.count();
|
||||||
|
if (elementCount === 0) {
|
||||||
|
expect(true).toBeTruthy();
|
||||||
|
|
||||||
|
await page
|
||||||
|
.locator('//*[@id="react-flow-id"]/div[1]/div[1]/div[1]/div/div[2]/div')
|
||||||
|
.click();
|
||||||
|
await page.locator('//*[@id="advancedIcon"]').click();
|
||||||
|
await page.locator('//*[@id="editAdvancedBtn"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="showload_hidden"]').click();
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="showload_hidden"]').isChecked()
|
||||||
|
).toBeTruthy();
|
||||||
|
|
||||||
|
expect(
|
||||||
|
await page.locator('//*[@id="toggle-edit-1"]').isChecked()
|
||||||
|
).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="saveChangesBtn"]').click();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeFalsy();
|
||||||
|
|
||||||
|
await page.locator('//*[@id="toggle-1"]').click();
|
||||||
|
expect(await page.locator('//*[@id="toggle-1"]').isChecked()).toBeTruthy();
|
||||||
|
}
|
||||||
|
});
|
||||||
Loading…
Add table
Add a link
Reference in a new issue