variable.spec.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /**
  2. * Copyright (c) 2025 Bytedance Ltd. and/or its affiliates
  3. * SPDX-License-Identifier: MIT
  4. */
  5. import { expect, test } from '@playwright/test';
  6. import PageModel from './models';
  7. test.describe('test variable', () => {
  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('test variable type', async ({ page }) => {
  15. const llmNode = page.locator('#llm_0');
  16. const trigger = llmNode.locator('.semi-icon-setting').first();
  17. await trigger.click();
  18. const selectionBefore = llmNode.locator('.semi-tree-option-level-2');
  19. await expect(selectionBefore).not.toBeVisible();
  20. const semiTreeWrapper = llmNode.locator('.semi-tree-wrapper');
  21. const dropdown = semiTreeWrapper.locator('.semi-tree-option-expand-icon').first();
  22. await dropdown.click({
  23. force: true,
  24. });
  25. const selection = llmNode.locator('.semi-tree-option-level-2');
  26. await expect(selection).toBeVisible({
  27. timeout: 10000,
  28. });
  29. const selectionCount = await selection.count();
  30. expect(selectionCount).toEqual(1);
  31. });
  32. });