[E2E] Update typescript tests according to workspace creation changes (#13544)
Signed-off-by: Ihor Okhrimenko <iokhrime@redhat.com>7.20.x
parent
fba31ee8f8
commit
a8bb74bbbf
|
|
@ -15,9 +15,8 @@ import { By } from 'selenium-webdriver';
|
|||
import 'reflect-metadata';
|
||||
import { Dashboard } from './Dashboard';
|
||||
import { Workspaces } from './Workspaces';
|
||||
import { Ide } from '../ide/Ide';
|
||||
import { TestWorkspaceUtil, WorkspaceStatus } from '../../utils/workspace/TestWorkspaceUtil';
|
||||
import { WorkspaceDetails } from './workspace-details/WorkspaceDetails';
|
||||
import { TestWorkspaceUtil, Ide, WorkspaceStatus } from '../..';
|
||||
|
||||
|
||||
@injectable()
|
||||
|
|
@ -44,10 +43,16 @@ export class NewWorkspace {
|
|||
await this.prepareWorkspace(workspaceName, dataStackId, sampleName);
|
||||
await this.clickOnCreateAndOpenButton();
|
||||
|
||||
await this.waitPageAbsence();
|
||||
await this.driverHelper.waitVisibility(By.css(Ide.ACTIVATED_IDE_IFRAME_CSS));
|
||||
await this.testWorkspaceUtil.waitWorkspaceStatus(namespace, workspaceName, WorkspaceStatus.STARTING);
|
||||
}
|
||||
|
||||
async waitPageAbsence(timeout: number = TestConstants.TS_SELENIUM_LOAD_PAGE_TIMEOUT) {
|
||||
await this.driverHelper.waitDisappearanceTestWithTimeout(By.css(NewWorkspace.NAME_FIELD_CSS), timeout);
|
||||
await this.driverHelper.waitDisappearanceTestWithTimeout(By.css(NewWorkspace.TITLE_CSS), timeout);
|
||||
}
|
||||
|
||||
async createWorkspaceAndProceedEditing(workspaceName: string, dataStackId: string, sampleName: string) {
|
||||
await this.prepareWorkspace(workspaceName, dataStackId, sampleName);
|
||||
await this.selectCreateWorkspaceAndProceedEditing();
|
||||
|
|
@ -55,6 +60,13 @@ export class NewWorkspace {
|
|||
await this.workspaceDetails.waitPage(workspaceName);
|
||||
}
|
||||
|
||||
async createAndOpenWorksapce(workspaceName: string, dataStackId: string, sampleName: string) {
|
||||
await this.prepareWorkspace(workspaceName, dataStackId, sampleName);
|
||||
await this.clickOnCreateAndOpenButton();
|
||||
|
||||
await this.workspaceDetails.waitPage(workspaceName);
|
||||
}
|
||||
|
||||
async confirmProjectAdding(sampleName: string, timeout: number = TestConstants.TS_SELENIUM_DEFAULT_TIMEOUT) {
|
||||
await this.clickOnAddButton(timeout);
|
||||
await this.waitProjectAdding(sampleName, timeout);
|
||||
|
|
@ -170,11 +182,11 @@ export class NewWorkspace {
|
|||
}
|
||||
|
||||
private getStackCssLocator(dataStackId: string): string {
|
||||
return `div[data-stack-id='${dataStackId}']`;
|
||||
return `span[devfile-name='${dataStackId}']`;
|
||||
}
|
||||
|
||||
private getSelectedStackCssLocator(dataStackId: string) {
|
||||
return `div.stack-selector-item-selected[data-stack-id='${dataStackId}']`;
|
||||
return `div.devfile-selector-item-selected[data-devfile-id='${dataStackId}']`;
|
||||
}
|
||||
|
||||
private async prepareWorkspace(workspaceName: string, dataStackId: string, sampleName: string) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import { ILoginPage } from '../../pageobjects/login/ILoginPage';
|
|||
import { Dashboard } from '../../pageobjects/dashboard/Dashboard';
|
||||
import { NameGenerator } from '../../utils/NameGenerator';
|
||||
import { NewWorkspace } from '../../pageobjects/dashboard/NewWorkspace';
|
||||
import { WorkspaceDetailsPlugins } from '../../pageobjects/dashboard/workspace-details/WorkspaceDetailsPlugins';
|
||||
import { Ide } from '../../pageobjects/ide/Ide';
|
||||
import { ProjectTree } from '../../pageobjects/ide/ProjectTree';
|
||||
import { Editor } from '../../pageobjects/ide/Editor';
|
||||
|
|
@ -22,16 +21,12 @@ import { Editor } from '../../pageobjects/ide/Editor';
|
|||
const workspaceName: string = NameGenerator.generate('wksp-test-', 5);
|
||||
const namespace: string = 'che';
|
||||
const sampleName: string = 'console-java-simple';
|
||||
const pluginId: string = 'redhat/java/0.45.0';
|
||||
const pluginVersion: string = '0.45.0';
|
||||
const javaPluginName: string = `Language Support for Java`;
|
||||
const fileFolderPath: string = `${sampleName}/src/main/java/org/eclipse/che/examples`;
|
||||
const tabTitle: string = 'HelloWorld.java';
|
||||
|
||||
const loginPage: ILoginPage = e2eContainer.get<ILoginPage>(TYPES.LoginPage);
|
||||
const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard);
|
||||
const newWorkspace: NewWorkspace = e2eContainer.get(CLASSES.NewWorkspace);
|
||||
const workspaceDetailsPlugins: WorkspaceDetailsPlugins = e2eContainer.get(CLASSES.WorkspaceDetailsPlugins);
|
||||
const ide: Ide = e2eContainer.get(CLASSES.Ide);
|
||||
const projectTree: ProjectTree = e2eContainer.get(CLASSES.ProjectTree);
|
||||
const editor: Editor = e2eContainer.get(CLASSES.Editor);
|
||||
|
|
@ -49,14 +44,9 @@ suite('E2E', async () => {
|
|||
await newWorkspace.openPageByUI();
|
||||
});
|
||||
|
||||
test(`Create a '${workspaceName}' workspace and proceed editing`, async () => {
|
||||
await newWorkspace.createWorkspaceAndProceedEditing(workspaceName, 'che7-preview', sampleName);
|
||||
test('Create and open workspace', async () => {
|
||||
await newWorkspace.createAndRunWorkspace(namespace, workspaceName, 'Java Maven', sampleName);
|
||||
});
|
||||
|
||||
test('Add \'Java Language Support\' plugin to workspace', async () => {
|
||||
await workspaceDetailsPlugins.addPluginAndOpenWorkspace(namespace, workspaceName, javaPluginName, pluginId, pluginVersion);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
suite('Work with IDE', async () => {
|
||||
|
|
@ -76,18 +66,20 @@ suite('E2E', async () => {
|
|||
await projectTree.expandPathAndOpenFile(fileFolderPath, tabTitle);
|
||||
});
|
||||
|
||||
// unskip after resolving issue https://github.com/eclipse/che/issues/12904
|
||||
test.skip('Check "Java Language Server" initialization by statusbar', async () => {
|
||||
test('Check "Java Language Server" initialization by statusbar', async () => {
|
||||
await ide.waitStatusBarContains('Starting Java Language Server');
|
||||
await ide.waitStatusBarContains('100% Starting Java Language Server');
|
||||
await ide.waitStatusBarTextAbcence('Starting Java Language Server');
|
||||
});
|
||||
|
||||
// unskip after resolving issue https://github.com/eclipse/che/issues/12904
|
||||
test.skip('Check "Java Language Server" initialization by suggestion invoking', async () => {
|
||||
test('Check "Java Language Server" initialization by suggestion invoking', async () => {
|
||||
await ide.closeAllNotifications();
|
||||
await editor.waitEditorAvailable(tabTitle);
|
||||
await editor.clickOnTab(tabTitle);
|
||||
await editor.waitEditorAvailable(tabTitle);
|
||||
await editor.waitTabFocused(tabTitle);
|
||||
await editor.moveCursorToLineAndChar(tabTitle, 6, 20);
|
||||
await editor.pressControlSpaceCombination(tabTitle);
|
||||
await editor.waitSuggestion(tabTitle, 'append(CharSequence csq, int start, int end) : PrintStream');
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue