diff --git a/test/smoke/src/areas/terminal/terminal-stickyScroll.test.ts b/test/smoke/src/areas/terminal/terminal-stickyScroll.test.ts new file mode 100644 index 00000000000..b4872aed9f5 --- /dev/null +++ b/test/smoke/src/areas/terminal/terminal-stickyScroll.test.ts @@ -0,0 +1,38 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +import { Application, Terminal, SettingsEditor } from '../../../../automation'; +import { setTerminalTestSettings } from './terminal-helpers'; + +export function setup() { + describe('Terminal stickyScroll', () => { + // Acquire automation API + let app: Application; + let terminal: Terminal; + let settingsEditor: SettingsEditor; + before(async function () { + app = this.app as Application; + terminal = app.workbench.terminal; + settingsEditor = app.workbench.settingsEditor; + await setTerminalTestSettings(app, [ + ['terminal.integrated.enableStickyScroll', 'true'] + ]); + }); + + after(async function () { + await settingsEditor.clearUserSettings(); + }); + + it('should inherit cwd when split and update the tab description - alt click', async () => { + // There should not be a visible sticky scroll element initially + await terminal.createTerminal(); + await app.code.waitForElements('.terminal-sticky-scroll', false, elements => elements.length === 0); + + // Running ls should show the sticky scroll element + await terminal.runCommandInTerminal(`ls`); + await app.code.waitForElements('.terminal-sticky-scroll', false, elements => elements.length === 1 && elements[0].textContent.indexOf('ls') >= 0); + }); + }); +} diff --git a/test/smoke/src/areas/terminal/terminal.test.ts b/test/smoke/src/areas/terminal/terminal.test.ts index 6adab38986a..97dcb060b88 100644 --- a/test/smoke/src/areas/terminal/terminal.test.ts +++ b/test/smoke/src/areas/terminal/terminal.test.ts @@ -11,6 +11,7 @@ import { setup as setupTerminalPersistenceTests } from './terminal-persistence.t import { setup as setupTerminalProfileTests } from './terminal-profiles.test'; import { setup as setupTerminalTabsTests } from './terminal-tabs.test'; import { setup as setupTerminalSplitCwdTests } from './terminal-splitCwd.test'; +import { setup as setupTerminalStickyScrollTests } from './terminal-stickyScroll.test'; import { setup as setupTerminalShellIntegrationTests } from './terminal-shellIntegration.test'; export function setup(logger: Logger) { @@ -41,6 +42,7 @@ export function setup(logger: Logger) { setupTerminalProfileTests(); setupTerminalTabsTests(); setupTerminalShellIntegrationTests(); + setupTerminalStickyScrollTests(); if (!process.platform.startsWith('win')) { setupTerminalSplitCwdTests(); }