forked from deephaven/deephaven-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add render tests for dialog (deephaven#1031)
closes deephaven#952
- Loading branch information
1 parent
cfd6410
commit 1d5eec9
Showing
18 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
from deephaven import ui | ||
|
||
my_modal = ui.panel( | ||
ui.dialog_trigger( | ||
ui.action_button( | ||
"Trigger Modal", | ||
), | ||
ui.dialog( | ||
ui.heading("Modal"), | ||
ui.content("This is a modal."), | ||
), | ||
is_dismissable=True, | ||
type="modal", | ||
default_open=True, | ||
) | ||
) | ||
|
||
my_popover = ui.panel( | ||
ui.dialog_trigger( | ||
ui.action_button( | ||
"Trigger Popover", | ||
), | ||
ui.dialog( | ||
ui.heading("Popover"), | ||
ui.content("This is a popover."), | ||
), | ||
type="popover", | ||
default_open=True, | ||
) | ||
) | ||
|
||
my_tray = ui.panel( | ||
ui.dialog_trigger( | ||
ui.action_button( | ||
"Trigger Tray", | ||
), | ||
ui.dialog( | ||
ui.heading("Tray"), | ||
ui.content("This is a tray."), | ||
), | ||
type="tray", | ||
default_open=True, | ||
) | ||
) | ||
|
||
my_fullscreen = ui.panel( | ||
ui.dialog_trigger( | ||
ui.action_button("Trigger Fullscreen"), | ||
ui.dialog( | ||
ui.heading("Fullscreen"), | ||
ui.content( | ||
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin sit\ | ||
amet tristique risus. In sit amet suscipit lorem. Orci varius\ | ||
natoque penatibus et magnis dis parturient montes, nascetur\ | ||
ridiculus mus. In condimentum imperdiet metus non condimentum. Duis\ | ||
eu velit et quam accumsan tempus at id velit. Duis elementum\ | ||
elementum purus, id tempus mauris posuere a. Nunc vestibulum sapien\ | ||
pellentesque lectus commodo ornare." | ||
), | ||
), | ||
type="fullscreen", | ||
default_open=True, | ||
) | ||
) | ||
|
||
|
||
my_fullscreen_takeover = ui.panel( | ||
ui.dialog_trigger( | ||
ui.action_button("Trigger Fullscreen"), | ||
ui.dialog( | ||
ui.heading("Fullscreen"), | ||
ui.content( | ||
ui.form( | ||
ui.text_field(label="Name"), | ||
ui.text_field(label="Email address"), | ||
ui.checkbox("Make profile private"), | ||
) | ||
), | ||
), | ||
type="fullscreenTakeover", | ||
default_open=True, | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { expect, test } from '@playwright/test'; | ||
import { openPanel, gotoPage, SELECTORS } from './utils'; | ||
|
||
// Tests dialog components render as expected | ||
test.describe('UI dialog components', () => { | ||
['my_popover', 'my_tray'].forEach(name => { | ||
test(name, async ({ page }) => { | ||
await gotoPage(page, ''); | ||
await openPanel(page, name, SELECTORS.REACT_PANEL_VISIBLE); | ||
|
||
await expect( | ||
page.locator(SELECTORS.REACT_PANEL_VISIBLE) | ||
).toHaveScreenshot(); | ||
}); | ||
}); | ||
|
||
['my_modal', 'my_fullscreen', 'my_fullscreen_takeover'].forEach(name => { | ||
test(name, async ({ page }) => { | ||
await gotoPage(page, ''); | ||
await openPanel(page, name, SELECTORS.REACT_PANEL_VISIBLE); | ||
|
||
await expect(page).toHaveScreenshot(); | ||
}); | ||
}); | ||
}); |
Binary file added
BIN
+24.4 KB
...ialog.spec.ts-snapshots/UI-dialog-components-my-fullscreen-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+55.1 KB
...dialog.spec.ts-snapshots/UI-dialog-components-my-fullscreen-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+24.8 KB
..._dialog.spec.ts-snapshots/UI-dialog-components-my-fullscreen-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.5 KB
...c.ts-snapshots/UI-dialog-components-my-fullscreen-takeover-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.9 KB
...ec.ts-snapshots/UI-dialog-components-my-fullscreen-takeover-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+10.7 KB
...pec.ts-snapshots/UI-dialog-components-my-fullscreen-takeover-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.2 KB
.../ui_dialog.spec.ts-snapshots/UI-dialog-components-my-modal-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+68.6 KB
...s/ui_dialog.spec.ts-snapshots/UI-dialog-components-my-modal-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+41.7 KB
tests/ui_dialog.spec.ts-snapshots/UI-dialog-components-my-modal-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.47 KB
...i_dialog.spec.ts-snapshots/UI-dialog-components-my-popover-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+17.6 KB
...ui_dialog.spec.ts-snapshots/UI-dialog-components-my-popover-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+7.18 KB
.../ui_dialog.spec.ts-snapshots/UI-dialog-components-my-popover-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.48 KB
...s/ui_dialog.spec.ts-snapshots/UI-dialog-components-my-tray-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+13.9 KB
tests/ui_dialog.spec.ts-snapshots/UI-dialog-components-my-tray-1-firefox-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.54 KB
tests/ui_dialog.spec.ts-snapshots/UI-dialog-components-my-tray-1-webkit-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.