Skip to content

Commit

Permalink
test: add multiselect tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wusteven815 committed Jan 19, 2024
1 parent 010a104 commit 1ab8a7d
Show file tree
Hide file tree
Showing 55 changed files with 234 additions and 0 deletions.
234 changes: 234 additions & 0 deletions tests/table-multiselect.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,234 @@
import { test, expect, Page } from '@playwright/test';
import { pasteInMonaco } from './utils';

const rowHeight = 19;
const columnHeaderHeight = 60;

async function waitForLoadingDone(page: Page) {
await expect(
page.locator('.iris-grid .iris-grid-loading-status')
).toHaveCount(0);
}

async function createTable(page: Page, cmd: string) {
const consoleInput = page.locator('.console-input');
await pasteInMonaco(consoleInput, cmd);
await page.keyboard.press('Enter');

// wait for panel to show, finish loading, and data to be loaded
await expect(page.locator('.iris-grid-panel')).toHaveCount(1);
await expect(page.locator('.iris-grid-panel .loading-spinner')).toHaveCount(
0
);
await waitForLoadingDone(page);
}

async function filterAndScreenshot(
page: Page,
gridLocation: {
x: number;
y: number;
width: number;
height: number;
},
filterType: string,
screenshotName: string
) {
// select the first 3 rows
await page.mouse.move(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight
);
await page.mouse.down();
await page.mouse.move(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight + rowHeight * 2
);
await page.mouse.up();
await page.mouse.click(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight + rowHeight * 2,
{ button: 'right' }
);
// apply filter
await page.getByRole('button', { name: 'Filter by Values' }).hover();
await page.getByRole('button', { name: filterType, exact: true }).click();
await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot(

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[chromium] › table-multiselect.spec.ts:74:7 › multiselect string filters

1) [chromium] › table-multiselect.spec.ts:74:7 › multiselect string filters ────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-string-1-is.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-string-1-is-chromium-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-chromium/multi-string-1-is-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-chromium/multi-string-1-is-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[chromium] › table-multiselect.spec.ts:74:7 › multiselect string filters

1) [chromium] › table-multiselect.spec.ts:74:7 › multiselect string filters ────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-string-1-is.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-string-1-is-chromium-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-chromium-retry1/multi-string-1-is-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-chromium-retry1/multi-string-1-is-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[chromium] › table-multiselect.spec.ts:74:7 › multiselect number filters

2) [chromium] › table-multiselect.spec.ts:74:7 › multiselect number filters ────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-number-1-equal.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-number-1-equal-chromium-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-chromium/multi-number-1-equal-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-chromium/multi-number-1-equal-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[chromium] › table-multiselect.spec.ts:74:7 › multiselect number filters

2) [chromium] › table-multiselect.spec.ts:74:7 › multiselect number filters ────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-number-1-equal.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-number-1-equal-chromium-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-chromium-retry1/multi-number-1-equal-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-chromium-retry1/multi-number-1-equal-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[chromium] › table-multiselect.spec.ts:74:7 › multiselect date filters

3) [chromium] › table-multiselect.spec.ts:74:7 › multiselect date filters ──────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-date-1-is.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-date-1-is-chromium-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-date-filters-chromium/multi-date-1-is-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-date-filters-chromium/multi-date-1-is-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[chromium] › table-multiselect.spec.ts:74:7 › multiselect date filters

3) [chromium] › table-multiselect.spec.ts:74:7 › multiselect date filters ──────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-date-1-is.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-date-1-is-chromium-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-date-filters-chromium-retry1/multi-date-1-is-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-date-filters-chromium-retry1/multi-date-1-is-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[firefox] › table-multiselect.spec.ts:74:7 › multiselect string filters

4) [firefox] › table-multiselect.spec.ts:74:7 › multiselect string filters ─────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-string-1-is.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-string-1-is-firefox-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-firefox/multi-string-1-is-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-firefox/multi-string-1-is-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[firefox] › table-multiselect.spec.ts:74:7 › multiselect string filters

4) [firefox] › table-multiselect.spec.ts:74:7 › multiselect string filters ─────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-string-1-is.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-string-1-is-firefox-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-firefox-retry1/multi-string-1-is-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-string-filters-firefox-retry1/multi-string-1-is-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[firefox] › table-multiselect.spec.ts:74:7 › multiselect number filters

5) [firefox] › table-multiselect.spec.ts:74:7 › multiselect number filters ─────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-number-1-equal.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-number-1-equal-firefox-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-firefox/multi-number-1-equal-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-firefox/multi-number-1-equal-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7

Check failure on line 57 in tests/table-multiselect.spec.ts

View workflow job for this annotation

GitHub Actions / build

[firefox] › table-multiselect.spec.ts:74:7 › multiselect number filters

5) [firefox] › table-multiselect.spec.ts:74:7 › multiselect number filters ─────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: Screenshot comparison failed: 96 pixels (ratio 0.01 of all image pixels) are different. Call log: - expect.toHaveScreenshot(multi-number-1-equal.png) with timeout 15000ms - verifying given screenshot expectation - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - 96 pixels (ratio 0.01 of all image pixels) are different. - waiting 100ms before taking screenshot - waiting for locator('.iris-grid-column') - locator resolved to <div class="iris-grid-column">…</div> - taking element screenshot - disabled all CSS animations - waiting for element to be visible and stable - element is visible and stable - captured a stable screenshot - 96 pixels (ratio 0.01 of all image pixels) are different. Expected: /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts-snapshots/multi-number-1-equal-firefox-linux.png Received: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-firefox-retry1/multi-number-1-equal-actual.png Diff: /home/runner/work/web-client-ui/web-client-ui/test-results/table-multiselect-multiselect-number-filters-firefox-retry1/multi-number-1-equal-diff.png 55 | await page.getByRole('button', { name: filterType, exact: true }).click(); 56 | await waitForLoadingDone(page); > 57 | await expect(page.locator('.iris-grid-column')).toHaveScreenshot( | ^ 58 | screenshotName 59 | ); 60 | at filterAndScreenshot (/home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:57:51) at /home/runner/work/web-client-ui/web-client-ui/tests/table-multiselect.spec.ts:91:7
screenshotName
);

// reset
await page.keyboard.down('Control');
await page.keyboard.press('E');
await page.keyboard.up('Control');
await waitForLoadingDone(page);
}

function runMultiselectFilter(
testName: string,
testFilePrefix: string,
cmd: string,
filters: { filter: string; name: string }[]
) {
test(testName, async ({ page }) => {
await page.goto('');
await createTable(page, cmd);

const grid = await page.locator('.iris-grid-panel .iris-grid');
const gridLocation = await grid.boundingBox();
expect(gridLocation).not.toBeNull();
if (gridLocation === null) return;

// activate the quick filter to get that text as well
await page.mouse.click(gridLocation.x + 805, gridLocation.y + 1);
await page.keyboard.down('Control');
await page.keyboard.press('F');
await page.keyboard.up('Control');

/* eslint-disable no-await-in-loop */
for (let i = 0; i < filters.length; i += 1) {
await filterAndScreenshot(
page,
gridLocation,
filters[i].filter,
`multi-${testFilePrefix}-${i + 1}-${filters[i].name}.png`
);
}
/* eslint-enable no-await-in-loop */
});
}

function runSpecialSelectFilter(
testName: string,
cmd: string,
expectedButtons: string[]
) {
test(testName, async ({ page }) => {
await page.goto('');
await createTable(page, cmd);

const grid = await page.locator('.iris-grid-panel .iris-grid');
const gridLocation = await grid.boundingBox();
expect(gridLocation).not.toBeNull();
if (gridLocation === null) return;

await page.mouse.click(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight / 2,
{ button: 'right' }
);

await page.getByRole('button', { name: 'Filter by Value' }).hover();
await Promise.all(
expectedButtons.map(async button => {
await expect(page.getByRole('button', { name: button })).toBeVisible();
})
);
// await expect(
// page.getByRole('button', { name: expectedButton })
// ).toBeVisible();
});
}

runSpecialSelectFilter(
'null select filter',
`
from deephaven.column import string_col
from deephaven import new_table
my_table = new_table([
string_col("MultiselectTestData", [None])
])`,
['is null', 'is not null']
);

runSpecialSelectFilter(
'empty string select filter',
`
from deephaven.column import string_col
from deephaven import new_table
my_table = new_table([
string_col("MultiselectTestData", [""])
])`,
['is empty string', 'is not empty string']
);

runSpecialSelectFilter(
'bool select filter',
`
from deephaven.column import bool_col
from deephaven import new_table
my_table = new_table([
bool_col("MultiselectTestData", [True])
])`,
['true', 'false', 'is null', 'is not null']
);

runMultiselectFilter(
'multiselect string filters',
'string',
`
from deephaven.column import string_col
from deephaven import new_table
my_table = new_table([
string_col("MultiselectTestData", ["A", "ABA", None, "ABABA", "AA", "ABAA", "AABA", "a", "aba", "ababa", "aa", "abaa", "aaba"])
])`,
[
{ name: 'is', filter: 'text is exactly' },
{ name: 'not-is', filter: 'text is not exactly' },
{ name: 'contains', filter: 'text contains' },
{ name: 'not-contains', filter: 'text does not contain' },
{ name: 'starts', filter: 'text starts with' },
{ name: 'ends', filter: 'text ends with' },
]
);

runMultiselectFilter(
'multiselect number filters',
'number',
`
from deephaven.column import double_col
from deephaven import new_table
my_table = new_table([
double_col("MultiselectTestData", [1, 2, None, 3, 4, 0, -1.1, 1.1])
])`,
[
{ name: 'equal', filter: 'is equal to' },
{ name: 'not-equal', filter: 'is not equal to' },
{ name: 'greater', filter: 'greater than' },
{ name: 'greater-eq', filter: 'greater than or equal to' },
{ name: 'less', filter: 'less than' },
{ name: 'less-eq', filter: 'less than or equal to' },
]
);

runMultiselectFilter(
'multiselect date filters',
'date',
`
from deephaven.time import to_j_instant
from deephaven import new_table
from deephaven.column import datetime_col
t1 = to_j_instant("2021-06-02T08:00:02 ET")
t2 = to_j_instant("2021-06-03T08:00:03 ET")
t3 = to_j_instant("2021-06-04T08:00:04 ET")
t4 = to_j_instant("2021-06-01T08:00:01 ET")
result = new_table([
datetime_col("MultiselectTestData", [t1, t2, None, t3, t4])
])`,
[
{ name: 'is', filter: 'date is' },
{ name: 'not-is', filter: 'date is not' },
{ name: 'before', filter: 'date is before' },
{ name: 'before-eq', filter: 'date is before or equal' },
{ name: 'after', filter: 'date is after' },
{ name: 'after-eq', filter: 'date is after or equal' },
]
);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 1ab8a7d

Please sign in to comment.