drawer.spec.ts 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { test, expect } from '@playwright/test';
  6. import PageModel from './models';
  7. test.describe('test llm drawer', () => {
  8. let editorPage: PageModel;
  9. test.beforeEach(async ({ page }) => {
  10. editorPage = new PageModel(page);
  11. await page.goto('http://localhost:3000');
  12. await page.waitForTimeout(1000);
  13. });
  14. test('sync data', async ({ page }) => {
  15. // 确保 llm drawer 更改表单数据,数据同步
  16. const LLM_NODE_ID = 'llm_0';
  17. const DRAWER_CLASSNAME = 'gedit-flow-panel-wrap';
  18. const TEST_FILL_VALUE = '123';
  19. const llmLocator = await page.locator(`#${LLM_NODE_ID}`);
  20. await llmLocator.click();
  21. const drawerLocator = await page.locator(`.${DRAWER_CLASSNAME}`);
  22. expect(drawerLocator).toBeVisible();
  23. const input = await drawerLocator.locator('input').first();
  24. await input.fill(TEST_FILL_VALUE);
  25. const inputValue = await llmLocator.locator('input').first().inputValue();
  26. expect(inputValue).toEqual(TEST_FILL_VALUE);
  27. });
  28. });