Skip to content

Commit

Permalink
adapt XmlPlugin test to works with devfile v2 (#21375)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkorikSergey authored May 10, 2022
1 parent 150390b commit 29d4f0d
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions tests/e2e/tests/plugins/VscodeXmlPlugin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,52 +10,44 @@

import { Key } from 'selenium-webdriver';
import { e2eContainer } from '../../inversify.config';
import { WorkspaceNameHandler } from '../../utils/WorkspaceNameHandler';
import { Ide } from '../../pageobjects/ide/Ide';
import { CLASSES } from '../../inversify.types';
import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
import { Editor } from '../../pageobjects/ide/Editor';
import { TestConstants } from '../../TestConstants';
import { TimeoutConstants } from '../../TimeoutConstants';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import { Logger } from '../../utils/Logger';
import { WorkspaceHandlingTests } from '../../testsLibrary/WorkspaceHandlingTests';
import CheReporter from '../../driver/CheReporter';
import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil';
import { PreferencesHandler } from '../../utils/PreferencesHandler';
import { ProjectAndFileTests } from '../../testsLibrary/ProjectAndFileTests';

const ide: Ide = e2eContainer.get(CLASSES.Ide);
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 workspaceNameHandler: WorkspaceNameHandler = e2eContainer.get(CLASSES.WorkspaceNameHandler);
const preferencesHandler: PreferencesHandler = e2eContainer.get(CLASSES.PreferencesHandler);

const devfileUrl: string = 'https://raw.githubusercontent.com/eclipse/che/main/tests/e2e/files/devfiles/plugins/VscodeXmlPlugin.yaml';
const devfileUrl: string = '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 = 'nodejs-web-app';
const projectName: string = 'web-nodejs-sample';
const pathToFile: string = `${projectName}`;
const xmlFileName: string = 'hello.xml';
let workspaceName: string = '';
const subRootFolder: string = 'app';
let workspaceName: string = 'xml-plugin';

suite('The "VscodeXmlPlugin" userstory', async () => {
suite('Create workspace', async () => {
test('Create workspace using factory', async () => {
await browserTabsUtil.navigateTo(factoryUrl);
});

projectAndFileTests.waitWorkspaceReadiness(projectName, subRootFolder);

test('Wait until created workspace is started', async () => {
await ide.waitAndSwitchToIdeFrame();
workspaceName = await workspaceNameHandler.getNameFromUrl();
CheReporter.registerRunningWorkspace(workspaceName);

await ide.waitIde(TimeoutConstants.TS_SELENIUM_START_WORKSPACE_TIMEOUT);
await ide.waitNotificationAndClickOnButton('Do you trust the authors of', 'Yes, I trust', 60_000);
});
});

suite('Check workspace readiness to work', async () => {
test('Wait until project is imported', async () => {
await projectTree.openProjectTreeContainer();
await projectTree.waitProjectImported(projectName, 'app');
await preferencesHandler.setPreferenceUsingUI('application.confirmExit', 'never');
});
});

Expand Down

0 comments on commit 29d4f0d

Please sign in to comment.