Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: add e2e tests for rollup rows and aggregate columns #1350

Merged
merged 41 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
12eafd5
test: add e2e test for select distinct values
ethanalvizo May 18, 2023
ddd5ed4
add missing Linux snapshots
ethanalvizo May 18, 2023
3e7a6d8
delete firefox tests
ethanalvizo May 18, 2023
3ed9396
regenerate firefox snapshots
ethanalvizo May 18, 2023
fb8443c
Merge branch 'main' into 1305-select-distinct-e2e
ethanalvizo May 19, 2023
b056e6b
test: add e2e test for organize columns
ethanalvizo May 24, 2023
e4baa90
Merge branch 'main' into 1315-organize-columns-e2e
ethanalvizo May 25, 2023
c76bc7f
Merge branch 'main' into 1315-organize-columns-e2e
ethanalvizo May 25, 2023
5706146
test: add e2e test for organize columns
ethanalvizo May 25, 2023
1fc7232
Fix/add missing snapshots
ethanalvizo May 25, 2023
61aa13d
Another snapshot fix
ethanalvizo May 25, 2023
f029445
Merge branch 'main' into 1315-organize-columns-e2e
ethanalvizo May 30, 2023
3964bce
wip PR feedback
ethanalvizo May 30, 2023
f627aac
Merge branch 'main' into 1315-organize-columns-e2e
ethanalvizo Jun 1, 2023
24a14ca
Switched to table with more columns
ethanalvizo Jun 1, 2023
a98e605
Merge branch 'main' into 1315-organize-columns-e2e
ethanalvizo Jun 1, 2023
2eaf6bc
Merge branch 'main' into 1315-organize-columns-e2e
ethanalvizo Jun 1, 2023
c2b1c46
Remove unused portions from organize columns
ethanalvizo Jun 1, 2023
cd17be5
wip
ethanalvizo Jun 2, 2023
19fd10a
test: add e2e tests for rollup rows
ethanalvizo Jun 2, 2023
42fdaa5
add aggregrate column
ethanalvizo Jun 2, 2023
1e6c469
wip
ethanalvizo Jun 5, 2023
fb3c051
linux snapshots
ethanalvizo Jun 6, 2023
7e6e82c
Merge branch 'main' into 1344-rollup-rows-e2e
ethanalvizo Jun 6, 2023
3eb238e
split into steps
ethanalvizo Jun 6, 2023
d9eacff
remove package.json change
ethanalvizo Jun 6, 2023
a0f8b7f
update organize columns snapshot
ethanalvizo Jun 6, 2023
6d1c827
ignore darwin snapshots and refactor table operations test
ethanalvizo Jun 6, 2023
9435020
regenerated linux snapshots
ethanalvizo Jun 6, 2023
e2b49dd
altered git ignore
ethanalvizo Jun 6, 2023
720eac5
default drag coordinates
ethanalvizo Jun 6, 2023
1b9c788
fix drag
ethanalvizo Jun 6, 2023
a46e29c
cond format and custom column fix
ethanalvizo Jun 6, 2023
3a6ab96
cond format fix
ethanalvizo Jun 7, 2023
c2f1f62
fixed rollup rows
ethanalvizo Jun 7, 2023
fdeedd4
drag refactor
ethanalvizo Jun 7, 2023
09a8047
custom column fix
ethanalvizo Jun 8, 2023
db9b087
third times the charm
ethanalvizo Jun 8, 2023
b838c9f
moved helper functions
ethanalvizo Jun 8, 2023
b04398f
re-enable cond format
ethanalvizo Jun 8, 2023
d6a8a4b
PR feedback
ethanalvizo Jun 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/iris-grid/src/IrisGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2319,6 +2319,7 @@ export class IrisGrid extends Component<IrisGridProps, IrisGridState> {
invertSearchColumns
);
this.setState({ searchFilter });
this.stopLoading();
ethanalvizo marked this conversation as resolved.
Show resolved Hide resolved
},
SET_FILTER_DEBOUNCE
);
Expand Down
91 changes: 90 additions & 1 deletion tests/table.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { test, expect, Page } from '@playwright/test';
import { test, expect, Page, Locator } from '@playwright/test';
import { makeTableCommand, pasteInMonaco, TableTypes } from './utils';

// Run tests serially since they all use the same table
Expand Down Expand Up @@ -31,6 +31,32 @@ async function waitForLoadingDone(page: Page) {
).toHaveCount(0);
}

async function dragComponent(
page: Page,
element: Locator,
offsetX: number,
offsetY: number,
stepNumber: number = 1000
ethanalvizo marked this conversation as resolved.
Show resolved Hide resolved
) {
// flipped the sign for offSetY since coordinates are from top-left of window
ethanalvizo marked this conversation as resolved.
Show resolved Hide resolved
const [x, y] = await element
.boundingBox()
.then(pos =>
pos && pos.x && pos.y ? [pos.x + offsetX, pos.y - offsetY] : [0, 0]
);

await element.hover();
await page.mouse.down();
await page.mouse.move(x, y, { steps: stepNumber });

const dropTargetIndicator = page.locator('.is-dropping');
expect(dropTargetIndicator).toBeVisible();

await page.mouse.up();

await waitForLoadingDone(page);
}

async function changeCondFormatComparison(
page: Page,
condition: string,
Expand Down Expand Up @@ -506,6 +532,69 @@ test.describe('tests complex table operations', () => {
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});
});

test('can rollup rows and aggregrate columns', async () => {
await page.locator('data-testid=menu-item-Rollup Rows').click();

await test.step('Rollup column', async () => {
const stringColumn = page.getByRole('button', { name: 'String' });
await dragComponent(page, stringColumn, -150, 100);

await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});

await test.step('Toggle constituents', async () => {
await page.getByText('Constituents').click();

await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});

await test.step('Toggle non-aggregated columns', async () => {
await page.getByText('Non-Aggregated Columns').click();

await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});

await test.step('Rollup another column', async () => {
const intColumn = page.getByRole('button', { name: 'Int', exact: true });
await dragComponent(page, intColumn, 150, 80);

await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});

await test.step('Aggregate columns', async () => {
await page.getByText('Constituents').click();
await page.getByText('Non-Aggregated Columns').click();

await page.getByTestId('btn-page-back').click();
await page.getByTestId('menu-item-Aggregate Columns').click();
await page.getByRole('button', { name: 'Add Aggregation' }).click();

await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});

await test.step('Edit aggregated columns', async () => {
await page
.getByRole('button', { name: 'Edit Columns', exact: true })
.click();
await page.getByText('Double', { exact: true }).click();

await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});

await test.step('Reset aggregated columns', async () => {
await page.getByRole('button', { name: 'Reset' }).click();

await waitForLoadingDone(page);
await expect(page.locator('.iris-grid-column')).toHaveScreenshot();
});
});
});

test.describe('tests simple table operations', () => {
Expand Down
ethanalvizo marked this conversation as resolved.
Show resolved Hide resolved
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.