diff --git a/ui-tests/tests/cell_operations.spec.ts b/ui-tests/tests/cell_operations.spec.ts index c84d727..a9736ac 100644 --- a/ui-tests/tests/cell_operations.spec.ts +++ b/ui-tests/tests/cell_operations.spec.ts @@ -1,14 +1,19 @@ -import { expect, galata, test } from '@jupyterlab/galata'; -import { openNotebook, cleanup, watchTimeIncrease } from './utils'; +import { expect, test } from '@jupyterlab/galata'; +import { + DEFAULT_SETTINGS, + openNotebook, + cleanup, + watchTimeIncrease, +} from './utils'; const NOTEBOOK_ID = '@jupyterlab/notebook-extension:tracker'; test.describe('Cell operations', () => { test.use({ mockSettings: { - ...galata.DEFAULT_SETTINGS, + ...DEFAULT_SETTINGS, [NOTEBOOK_ID]: { - ...galata.DEFAULT_SETTINGS[NOTEBOOK_ID], + ...DEFAULT_SETTINGS[NOTEBOOK_ID], windowingMode: 'defer', }, }, diff --git a/ui-tests/tests/settings_editor.spec.ts b/ui-tests/tests/settings_editor.spec.ts index d50eee3..10e27b1 100644 --- a/ui-tests/tests/settings_editor.spec.ts +++ b/ui-tests/tests/settings_editor.spec.ts @@ -9,6 +9,7 @@ test.describe('Settings Editor', () => { '.jp-PluginList .jp-PluginList-entry >> text="Execute Time"' ); + await plugin.waitFor(); expect(plugin).toHaveCount(1); }); }); diff --git a/ui-tests/tests/timing_outcomes.spec.ts b/ui-tests/tests/timing_outcomes.spec.ts index bb14d4a..8eda055 100644 --- a/ui-tests/tests/timing_outcomes.spec.ts +++ b/ui-tests/tests/timing_outcomes.spec.ts @@ -1,5 +1,11 @@ -import { expect, galata, test } from '@jupyterlab/galata'; -import { openNotebook, cleanup, acceptDialog, maskedScreenshot } from './utils'; +import { expect, test } from '@jupyterlab/galata'; +import { + DEFAULT_SETTINGS, + openNotebook, + cleanup, + acceptDialog, + maskedScreenshot, +} from './utils'; const SETTINGS_ID = 'jupyterlab-execute-time:settings'; @@ -9,9 +15,9 @@ test.describe('Timing outcomes', () => { // Disable flashing highlight for screenshot consistency test.use({ mockSettings: { - ...galata.DEFAULT_SETTINGS, + ...DEFAULT_SETTINGS, [SETTINGS_ID]: { - ...galata.DEFAULT_SETTINGS[SETTINGS_ID], + ...DEFAULT_SETTINGS[SETTINGS_ID], highlight: false, }, }, diff --git a/ui-tests/tests/timing_outputs_outcomes.spec.ts b/ui-tests/tests/timing_outputs_outcomes.spec.ts index 7fea776..5c3a1e7 100644 --- a/ui-tests/tests/timing_outputs_outcomes.spec.ts +++ b/ui-tests/tests/timing_outputs_outcomes.spec.ts @@ -1,5 +1,10 @@ -import { expect, galata, test } from '@jupyterlab/galata'; -import { openNotebook, cleanup, maskedScreenshot } from './utils'; +import { expect, test } from '@jupyterlab/galata'; +import { + DEFAULT_SETTINGS, + openNotebook, + cleanup, + maskedScreenshot, +} from './utils'; const SETTINGS_ID = 'jupyterlab-execute-time:settings'; @@ -9,9 +14,9 @@ test.describe('Timing outcomes with ', () => { // Disable flashing highlight for screenshot consistency test.use({ mockSettings: { - ...galata.DEFAULT_SETTINGS, + ...DEFAULT_SETTINGS, [SETTINGS_ID]: { - ...galata.DEFAULT_SETTINGS[SETTINGS_ID], + ...DEFAULT_SETTINGS[SETTINGS_ID], highlight: false, showOutputsPerSecond: true, }, diff --git a/ui-tests/tests/utils.ts b/ui-tests/tests/utils.ts index b96806e..7c0a721 100644 --- a/ui-tests/tests/utils.ts +++ b/ui-tests/tests/utils.ts @@ -1,6 +1,17 @@ +import { galata } from '@jupyterlab/galata'; import { Page, ElementHandle, Locator } from 'playwright'; import * as path from 'path'; +const NOTEBOOK_ID = '@jupyterlab/notebook-extension:tracker'; + +export const DEFAULT_SETTINGS = { + ...galata.DEFAULT_SETTINGS, + [NOTEBOOK_ID]: { + ...galata.DEFAULT_SETTINGS[NOTEBOOK_ID], + recordTiming: true, + }, +}; + /** * Upload and open given notebook. */ diff --git a/ui-tests/tests/windowed_notebook.spec.ts b/ui-tests/tests/windowed_notebook.spec.ts index 2efd517..da9307f 100644 --- a/ui-tests/tests/windowed_notebook.spec.ts +++ b/ui-tests/tests/windowed_notebook.spec.ts @@ -1,5 +1,5 @@ -import { expect, galata, test } from '@jupyterlab/galata'; -import { openNotebook, acceptDialog, cleanup } from './utils'; +import { expect, test } from '@jupyterlab/galata'; +import { DEFAULT_SETTINGS, openNotebook, acceptDialog, cleanup } from './utils'; const SETTINGS_ID = 'jupyterlab-execute-time:settings'; const NOTEBOOK_ID = '@jupyterlab/notebook-extension:tracker'; @@ -7,9 +7,9 @@ const NOTEBOOK_ID = '@jupyterlab/notebook-extension:tracker'; test.describe('Windowed notebook', () => { test.use({ mockSettings: { - ...galata.DEFAULT_SETTINGS, + ...DEFAULT_SETTINGS, [NOTEBOOK_ID]: { - ...galata.DEFAULT_SETTINGS[NOTEBOOK_ID], + ...DEFAULT_SETTINGS[NOTEBOOK_ID], windowingMode: 'full', }, }, @@ -40,13 +40,13 @@ test.describe('Windowed notebook/hover', () => { // because in this mode execution does not move the notebook window. test.use({ mockSettings: { - ...galata.DEFAULT_SETTINGS, + ...DEFAULT_SETTINGS, [NOTEBOOK_ID]: { - ...galata.DEFAULT_SETTINGS[NOTEBOOK_ID], + ...DEFAULT_SETTINGS[NOTEBOOK_ID], windowingMode: 'full', }, [SETTINGS_ID]: { - ...galata.DEFAULT_SETTINGS[SETTINGS_ID], + ...DEFAULT_SETTINGS[SETTINGS_ID], positioning: 'hover', }, },