Skip to content

Commit

Permalink
Set confirmExit preference to never in plugin tests (#21531)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkorikSergey authored Jul 5, 2022
1 parent f909021 commit 6ab619d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 7 additions & 0 deletions tests/e2e/tests/plugins/VscodeXmlPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ import { Editor } from '../../pageobjects/ide/Editor';
import { TestConstants } from '../../TestConstants';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { PreferencesHandler } from '../../utils/PreferencesHandler';
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';

const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.ProjectAndFileTests);
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
const editor: Editor = e2eContainer.get(CLASSES.Editor);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);

const devfileUrl: string = TestConstants.TS_TEST_WORKSPACE_DEVFILE_REPO || 'https://github.com/che-samples/web-nodejs-sample/tree/xml-plugin';
const factoryUrl: string = `${TestConstants.TS_SELENIUM_BASE_URL}/f?url=${devfileUrl}`;
const projectName: string = 'web-nodejs-sample';
Expand All @@ -42,6 +45,10 @@ suite('The "VscodeXmlPlugin" userstory', async () => {
});

suite('Check the "vscode-xml" plugin', async () => {
test('Set confirmExit preference to never', async () => {
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});

test('Check autocomplete', async () => {
await projectTree.expandPathAndOpenFile(pathToFile, xmlFileName);
await editor.waitSuggestion(xmlFileName, 'rollback', 60000, 16, 4);
Expand Down
4 changes: 4 additions & 0 deletions tests/e2e/tests/plugins/VscodeYamlPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ suite('The "VscodeYamlPlugin" userstory', async () => {
});

suite('Check the "vscode-yaml" plugin', async () => {
test('Set confirmExit preference to never', async () => {
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});

test('Set the yaml schema path', async () => {
await preferencesHandler.setPreferenceUsingUI('yaml.schemas', yamlSchema);
});
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/testsLibrary/CodeExecutionTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export class CodeExecutionTests {
test(`Run command '${taskName}' expecting notification`, async () => {
await this.runTaskUsingQuickOpenContainer(taskName);
await this.ide.waitNotification(notificationText, timeout);
// Need delay because a test application is not accessible immediately - it needs time.
// Later can be improved (we can get and request the app. URL with axios until it is available)
// need delay because a test application is not accessible immediately - it needs time.
// later can be improved (we can get and request the app. URL with axios until it is available)
// 7 sec is approximate value for most cases
await this.driverHelper.wait(7_000);
this.workspaceHandlingTests.setWindowHandle(await this.browserTabsUtil.getCurrentWindowHandle());
Expand Down

0 comments on commit 6ab619d

Please sign in to comment.