node.spec.ts 876 B

12345678910111213141516171819202122232425262728
  1. import { test, expect } from '@playwright/test';
  2. import PageModel from './models';
  3. test.describe('node operations', () => {
  4. let editorPage: PageModel;
  5. test.beforeEach(async ({ page }) => {
  6. editorPage = new PageModel(page);
  7. await page.goto('http://localhost:3000');
  8. });
  9. test('node preview', async () => {
  10. const startCount = await editorPage.isStartNodeExist();
  11. const endCount = await editorPage.isEndNodeExist();
  12. const conditionCount = await editorPage.isConditionNodeExist();
  13. expect(startCount).toEqual(1);
  14. expect(endCount).toEqual(1);
  15. expect(conditionCount).toEqual(1);
  16. });
  17. test('add node', async () => {
  18. const prevCount = await editorPage.getNodeCount();
  19. await editorPage.addConditionNode();
  20. const defaultNodeCount = await editorPage.getNodeCount();
  21. expect(defaultNodeCount).toEqual(prevCount + 1);
  22. });
  23. });