diff --git a/tests/e2e/pageobjects/dashboard/Dashboard.ts b/tests/e2e/pageobjects/dashboard/Dashboard.ts index 15b001a459d..3bd48875b3f 100644 --- a/tests/e2e/pageobjects/dashboard/Dashboard.ts +++ b/tests/e2e/pageobjects/dashboard/Dashboard.ts @@ -1,5 +1,5 @@ /** ******************************************************************* - * copyright (c) 2019-2023 Red Hat, Inc. + * copyright (c) 2019-2024 Red Hat, Inc. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -38,6 +38,7 @@ export class Dashboard { browserVersion: 'browser-version', username: 'username' }; + private static readonly CONTINUE_WITH_DEFAULT_DEVFILE_BUTTON: By = By.xpath('//button[text()="Continue with default devfile"]'); constructor( @inject(CLASSES.DriverHelper) @@ -184,6 +185,12 @@ export class Dashboard { await this.driverHelper.waitDisappearance(Dashboard.USER_SETTINGS_DROPDOWN, timeout); } + async clickContinueWithDefaultDevfileButton(timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise { + Logger.debug(); + + await this.driverHelper.waitAndClick(Dashboard.CONTINUE_WITH_DEFAULT_DEVFILE_BUTTON, timeout); + } + private getAboutMenuItemButtonLocator(text: string): By { return By.xpath(`//li/button[text()="${text}"]`); } diff --git a/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts b/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts index a09c09a9212..fea2fdee730 100644 --- a/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts +++ b/tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts @@ -105,6 +105,26 @@ suite( const allCreatedWorkspacesNames: string[] = await workspaces.getAllCreatedWorkspacesNames(); expect(allCreatedWorkspacesNames).has.length(numberOfCreatedWorkspaces); }); + + test('Check creating workspace using default devfile', async function (): Promise { + await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL()); + await dashboard.waitLoader(); + await dashboard.clickContinueWithDefaultDevfileButton(); + await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage(); + registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName()); + await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor(); + }); + + test('Check that a project folder has not been cloned', async function (): Promise { + testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL); + await driverHelper.waitVisibility(webCheCodeLocators.TitleBar.itemElement); + await projectAndFileTests.performTrustAuthorDialog(); + const isProjectFolderUnable: string = await driverHelper.waitAndGetElementAttribute( + (webCheCodeLocators.TreeItem as any).projectFolderItem, + 'aria-label' + ); + expect(isProjectFolderUnable).to.contain('No Folder Opened Section'); + }); } else { test('Obtain workspace name from workspace loader page', async function (): Promise { await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();