Skip to content

Commit

Permalink
test(multiselect): update for new string behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
wusteven815 committed Jan 25, 2024
1 parent 5ff2849 commit d397a4f
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions tests/table-multiselect.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { test, expect, Page } from '@playwright/test';
import { pasteInMonaco } from './utils';

const rowHeight = 19;
const columnHeaderHeight = 60;
const columnHeight = 30;
const filterHeight = 30;

async function waitForLoadingDone(page: Page) {
await expect(
Expand All @@ -17,7 +18,7 @@ async function getGridLocation(page: Page) {
return gridLocation;
}

async function createTable(page: Page, cmd: string) {
async function createSingleColumnTable(page: Page, cmd: string) {
const consoleInput = page.locator('.console-input');
await pasteInMonaco(consoleInput, cmd);
await page.keyboard.press('Enter');
Expand All @@ -44,17 +45,17 @@ async function filterAndScreenshot(
// select the first 3 rows
await page.mouse.move(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight
gridLocation.y + 1 + columnHeight + filterHeight
);
await page.mouse.down();
await page.mouse.move(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight + rowHeight * 2
gridLocation.y + 1 + columnHeight + filterHeight + rowHeight * 2
);
await page.mouse.up();
await page.mouse.click(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight + rowHeight * 2,
gridLocation.y + 1 + columnHeight + filterHeight + rowHeight * 2,
{ button: 'right' }
);
// apply filter
Expand All @@ -80,7 +81,7 @@ function runMultiselectFilter(
) {
test(testName, async ({ page }) => {
await page.goto('');
await createTable(page, cmd);
await createSingleColumnTable(page, cmd);
const gridLocation = await getGridLocation(page);
if (gridLocation === null) return;

Expand All @@ -103,21 +104,22 @@ function runMultiselectFilter(
});
}

// these are select filters that do not do multiselect
function runSpecialSelectFilter(
testName: string,
cmd: string,
expectedButtons: string[]
) {
test(testName, async ({ page }) => {
await page.goto('');
await createTable(page, cmd);
await createSingleColumnTable(page, cmd);

const gridLocation = await getGridLocation(page);
if (gridLocation === null) return;

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

Expand Down Expand Up @@ -235,7 +237,7 @@ test('char formatting, non selected right click, preview formatting', async ({
page,
}) => {
await page.goto('');
await createTable(
await createSingleColumnTable(
page,
`
from deephaven.column import char_col
Expand All @@ -252,17 +254,17 @@ my_table = new_table([
await page.keyboard.down('Control');
await page.mouse.click(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight / 2 + rowHeight
gridLocation.y + 1 + columnHeight + rowHeight
);
await page.mouse.click(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight / 2 + rowHeight * 3
gridLocation.y + 1 + columnHeight + rowHeight * 3
);
await page.keyboard.up('Control');

await page.mouse.click(
gridLocation.x + 1,
gridLocation.y + 1 + columnHeaderHeight / 2,
gridLocation.y + 1 + columnHeight,
{ button: 'right' }
);
await page.getByRole('button', { name: 'Filter by Value' }).hover();
Expand Down
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 d397a4f

Please sign in to comment.