Skip to content

Commit

Permalink
Add queryBySets test
Browse files Browse the repository at this point in the history
  • Loading branch information
JakeWags committed Feb 20, 2025
1 parent e75c2b5 commit cfbea7b
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions e2e-tests/queryBySets.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { expect, test } from '@playwright/test';
import { beforeTest } from './common';

test.beforeEach(beforeTest);

test('Query by Sets', async ({ page }) => {
await page.goto('http://localhost:3000/?workspace=Upset+Examples&table=simpsons&sessionId=193');

// open Query by sets interface
await page.getByTestId('AddIcon').locator('path').click();
// await page.getByLabel('Query By Sets').locator('rect').click();

// select first two sets as 'No', third as 'Yes'
await page.locator('g:nth-child(2) > g > circle').first().click();
await page.locator('g:nth-child(2) > g > circle:nth-child(3)').click();
await page.locator('g:nth-child(4) > g > circle:nth-child(4)').click();

// TODO: Add a test for changing the name. As is, playwright struggles to handle web dialog inputs

// Ensure that the text is correct
await page.getByText('intersections of set [Evil]').click();

// Add the query
await page.getByLabel('Add query').locator('rect').click();

// This specific query size is 5
await page.locator('text').filter({ hasText: /^5$/ }).click();

// Remove the query
await page.getByLabel('Remove query').locator('rect').click();

});

0 comments on commit cfbea7b

Please sign in to comment.