Add simple terminal sticky scroll smoke test

This commit is contained in:
Daniel Imms 2023-11-08 05:23:01 -08:00
parent 0bbbea7680
commit 64ac05a2e9
No known key found for this signature in database
GPG Key ID: E5CF412B63651C69
2 changed files with 40 additions and 0 deletions

View File

@ -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);
});
});
}

View File

@ -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();
}