node.spec.ts 976 B

123456789101112131415161718192021222324252627282930313233
  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('node operations', () => {
  8. let editorPage: PageModel;
  9. test.beforeEach(async ({ page }) => {
  10. editorPage = new PageModel(page);
  11. await page.goto('http://localhost:3000');
  12. });
  13. test('node preview', async () => {
  14. const startCount = await editorPage.isStartNodeExist();
  15. const endCount = await editorPage.isEndNodeExist();
  16. const conditionCount = await editorPage.isConditionNodeExist();
  17. expect(startCount).toEqual(1);
  18. expect(endCount).toEqual(1);
  19. expect(conditionCount).toEqual(1);
  20. });
  21. test('add node', async () => {
  22. const prevCount = await editorPage.getNodeCount();
  23. await editorPage.addConditionNode();
  24. const defaultNodeCount = await editorPage.getNodeCount();
  25. expect(defaultNodeCount).toEqual(prevCount + 1);
  26. });
  27. });