Skip to content

Commit

Permalink
Updated method names to better reflect their actions
Browse files Browse the repository at this point in the history
Signed-off-by: Tibor Dancs <tdancs@redhat.com>
  • Loading branch information
ScrewTSW committed Mar 29, 2023
1 parent 6b20457 commit 0ce844c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions tests/e2e/pageobjects/dashboard/CreateWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ export class CreateWorkspace {
await this.driverHelper.waitAndClick(sampleLocator, timeout);
}

async startWorkspaceUsingFactory(factoryUrl: string, timeout: number = TimeoutConstants.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise<void> {
Logger.debug(`CreateWorkspace.startWorkspaceUsingFactory factoryUrl: "${factoryUrl}"`);
await this.driverHelper.waitVisibility(CreateWorkspace.FACTORY_URL_LOCATOR, timeout);
await this.driverHelper.type(CreateWorkspace.FACTORY_URL_LOCATOR, Key.chord(factoryUrl, Key.ENTER), timeout);
}

async clickOnSampleForSpecificEditor(sampleName: string, timeout: number = TimeoutConstants.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise<void> {
await this.clickOnEditorsDropdownListButton(sampleName, timeout);

Expand All @@ -67,6 +61,12 @@ export class CreateWorkspace {
await this.driverHelper.waitAndClick(sampleLocator, timeout);
}

async importFromGitUsingUI(factoryUrl: string, timeout: number = TimeoutConstants.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise<void> {
Logger.debug(`CreateWorkspace.importFromGitUsingUI factoryUrl: "${factoryUrl}"`);
await this.driverHelper.waitVisibility(CreateWorkspace.FACTORY_URL_LOCATOR, timeout);
await this.driverHelper.type(CreateWorkspace.FACTORY_URL_LOCATOR, Key.chord(factoryUrl, Key.ENTER), timeout);
}

private async clickOnEditorsDropdownListButton(sampleName: string, timeout: number): Promise<void> {
Logger.debug(`CreateWorkspace.clickOnSample sampleName: "${sampleName}, editor ${TestConstants.TS_SELENIUM_EDITOR}"`);

Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/specs/devfiles/SmokeTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const projectAndFileTests: ProjectAndFileTests = e2eContainer.get(CLASSES.Projec
const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests);
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);

suite(`The ${factoryUrl} userstory`, async function () {
suite(`The SmokeTest userstory`, async function () {
let projectSection: ViewSection;
suite(`Create workspace from factory:${factoryUrl}`, async function () {
loginTests.loginIntoChe();
workspaceHandlingTests.createAndOpenWorkspaceFromFactory(factoryUrl);
workspaceHandlingTests.createAndOpenWorkspaceFromGitRepository(factoryUrl);
workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
test('Register running workspace', async () => {
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
Expand Down
4 changes: 2 additions & 2 deletions tests/e2e/tests-library/WorkspaceHandlingTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ export class WorkspaceHandlingTests {
});
}

public createAndOpenWorkspaceFromFactory(factoryUrl: string): void {
public createAndOpenWorkspaceFromGitRepository(factoryUrl: string): void {
test(`Create and open new workspace from factory:${factoryUrl}`, async () => {
await this.dashboard.waitPage();
Logger.debug(`Fetching user kubernetes namespace, storing auth token by getting workspaces API URL.`);
await this.apiUrlResolver.getWorkspacesApiUrl();
await this.dashboard.clickCreateWorkspaceButton();
await this.createWorkspace.waitPage();
WorkspaceHandlingTests.parentGUID = await this.browserTabsUtil.getCurrentWindowHandle();
await this.createWorkspace.startWorkspaceUsingFactory(factoryUrl);
await this.createWorkspace.importFromGitUsingUI(factoryUrl);
await this.browserTabsUtil.waitAndSwitchToAnotherWindow(WorkspaceHandlingTests.parentGUID, TimeoutConstants.TS_IDE_LOAD_TIMEOUT);
});
}
Expand Down

0 comments on commit 0ce844c

Please sign in to comment.