Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion playwright.base.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default defineConfig({
workers: 1,
forbidOnly: !!process.env.CI, // Fail the build on CI if you accidentally left test.only in the source code
retries: 2,
reporter: 'html', // We use blob on CI to enable sharding
reporter: [['html', { open: 'on-failure', host: '0.0.0.0', port: 9323 }]],
Comment thread
ricopinazo marked this conversation as resolved.
use: {
timezoneId: 'Europe/London',
locale: 'en-US',
Expand Down
13 changes: 12 additions & 1 deletion test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,18 @@ def second_filler_graph(graph):
)

graph.add_node(
60, "Rabbit Inc", {"industry": "Agriculture", "founded": 2019}, "Company"
60, "Rabbit Inc", {
"industry": "Agriculture",
"founded": 2019,
"description":
"""Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet nibh tellus, et sagittis ex pulvinar nec. Aliquam pellentesque dolor a gravida tempus. Fusce tristique venenatis eros quis molestie. Phasellus nec sapien non orci pellentesque porta. Donec eu odio a mauris vestibulum porta. Praesent vitae nisl vitae sem interdum volutpat. Phasellus vitae dignissim neque, vulputate molestie justo. Mauris interdum, dui sed pharetra mollis, lacus tellus dapibus magna, nec porttitor felis justo ac lorem. Curabitur volutpat arcu risus, quis semper dolor accumsan id. Orci varius natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.
Etiam eu neque ligula. Nam blandit ante vitae tellus ullamcorper, ornare iaculis tortor dictum. Curabitur quis pulvinar ante. Nulla in rutrum lorem. Vivamus aliquet lectus massa, eu scelerisque tellus cursus vitae. Donec eget diam sapien. Nulla nisi dolor, molestie non interdum et, ultrices sed dui. Suspendisse vehicula, velit at mollis fringilla, sem enim congue neque, et viverra lectus nunc at massa. Etiam gravida risus non quam pellentesque pulvinar. Nulla rutrum turpis eros, sit amet sodales urna elementum sit amet. Nunc pulvinar nibh et velit congue, eget posuere augue iaculis. Vivamus turpis sem, consectetur ut dictum congue, volutpat eu sapien.
Interdum et malesuada fames ac ante ipsum primis in faucibus. Integer placerat dui ipsum, placerat molestie tellus blandit eget. Fusce malesuada ex ut mauris semper, nec rhoncus est pharetra. Donec ut velit quis diam dignissim tincidunt sed nec lectus. In bibendum mollis dolor id ultricies. Sed turpis justo, scelerisque sed erat non, volutpat consectetur ex. Etiam luctus bibendum pharetra. Maecenas eros dui, auctor a cursus eu, commodo et nisi. Etiam malesuada lacus ac suscipit mattis. Sed erat augue, bibendum at nisi vel, scelerisque volutpat lacus. Vivamus neque dui, sodales non leo quis, faucibus ultricies ex.
Vestibulum risus nulla, viverra dapibus lorem vel, euismod dignissim lectus. Sed molestie nisi a libero congue, nec lobortis diam suscipit. Donec consectetur sollicitudin imperdiet. Fusce vitae mollis erat, at placerat augue. Suspendisse eu placerat eros. Sed eros nulla, rhoncus non rutrum ut, rutrum dignissim dui. Cras hendrerit interdum velit, ornare pulvinar ipsum volutpat at.
Aliquam diam ipsum, feugiat eu ligula at, dignissim efficitur sapien. Vestibulum posuere iaculis egestas. Nunc non auctor dolor. Aenean ipsum nunc, imperdiet sit amet dolor a, vestibulum posuere nulla. Proin neque ligula, semper nec mi ut, sagittis placerat mauris. Nam sodales viverra dolor feugiat lobortis. Fusce scelerisque dui egestas, scelerisque lectus eget, dignissim mauris. Morbi eu orci at dolor bibendum volutpat. Duis congue, tellus quis euismod bibendum, mi justo posuere mauris, at sodales ante lorem sit amet nisl. Phasellus cursus pulvinar nunc sed suscipit. Ut lobortis gravida augue, vel gravida diam mollis vel. Maecenas ut libero viverra, ullamcorper nunc quis, volutpat neque. Ut accumsan suscipit justo, vitae ultrices sapien tincidunt non. In hac habitasse platea dictumst.
"""
},
"Company"
)

graph.add_edge(
Expand Down
77 changes: 77 additions & 0 deletions tests/e2e/graph.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ const CANVAS_ELEMENT_POSITIONS = {
},
},
'new_folder/persistent_second_filler': {
'Rabbit Inc': {
x: 430,
y: 95,
},
'Judy->Rabbit Inc': {
x: 459,
y: 151,
Expand Down Expand Up @@ -472,6 +476,38 @@ test('Click and deselect by floating actions', async ({ page }) => {
});
});

test('Select all from menu and via shortcut', async ({ page }) => {
await navigateToSavedGraphBySavedGraphsTable(page, 'vanilla', 'persistent');
await page.waitForTimeout(500);
await page.locator('canvas').nth(1).click();
await page.waitForTimeout(100);
await page.keyboard.down('Control');
await page.waitForTimeout(100);
await page.locator('canvas').nth(1).press('a');
await page.waitForTimeout(100);
await page.keyboard.up('Control');
await page.waitForTimeout(500);
expect(await page.locator('canvas').nth(1).screenshot()).toMatchSnapshot(
'select-all-via-shortcut.png',
);
await page.getByRole('button', { name: 'Selection' }).click();
await page
.getByRole('menuitem', { name: 'Deselect all nodes', exact: true })
.click();
await waitForLayoutToFinish(page);
expect(await page.locator('canvas').nth(1).screenshot()).toMatchSnapshot(
'select-all-then-deselect-all.png',
);
await page.getByRole('button', { name: 'Selection' }).click();
await page
.getByRole('menuitem', { name: 'Select all nodes', exact: true })
.click();
await waitForLayoutToFinish(page);
expect(await page.locator('canvas').nth(1).screenshot()).toMatchSnapshot(
'select-all-via-menu.png',
);
});

test('Click backspace to delete nodes', async ({ page }) => {
await navigateToGraphPageBySearch(page, {
type: 'node',
Expand All @@ -494,6 +530,27 @@ test('Click backspace to delete nodes', async ({ page }) => {
await expect(page.getByText('Ben')).toBeVisible();
});

test('RHS Selected properties has max height for table cells', async ({
page,
}) => {
await navigateToSavedGraphBySavedGraphsTable(
page,
'new_folder',
'persistent_second_filler',
);
await changeTab(page, 'Selected');
await page.locator('canvas').nth(1).click({
position:
CANVAS_ELEMENT_POSITIONS['new_folder/persistent_second_filler'][
'Rabbit Inc'
],
});
// Expect that table cells have a max height that hides the majority of the
// text such that you can still see elements below the properties, such as
// Direct Connections.
await expect(page.getByText('Direct Connections')).toBeVisible();
});

test('Change colour and size of node', async ({ page }) => {
await navigateToSavedGraphBySavedGraphsTable(
page,
Expand Down Expand Up @@ -926,6 +983,26 @@ test('Layout Customizer can use dagre for pre-layout', async ({ page }) => {
);
});

test('Brush select on main canvas works from first click', async ({ page }) => {
await navigateToSavedGraphBySavedGraphsTable(
page,
'vanilla',
'persistent_filler',
);

await page.keyboard.down('Shift');
await page.mouse.move(630, 100);
await page.mouse.down();
await page.waitForTimeout(100);
await page.mouse.move(120, 330);
await page.mouse.up();
await page.keyboard.up('Shift');

expect(await page.locator('canvas').nth(1).screenshot()).toMatchSnapshot(
'brush-select-first-click.png',
);
});

test('catch console logs and errors', async ({ page }) => {
const consoleErrors: string[] = [];
const consoleLogs: string[] = [];
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.