Skip to content

Commit 8f466ad

Browse files
authored
Update 'NoSetupRepoFactory' E2E test (#23264)
1 parent 0aefb1c commit 8f466ad

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

tests/e2e/pageobjects/dashboard/Dashboard.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** *******************************************************************
2-
* copyright (c) 2019-2023 Red Hat, Inc.
2+
* copyright (c) 2019-2024 Red Hat, Inc.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
@@ -38,6 +38,7 @@ export class Dashboard {
3838
browserVersion: 'browser-version',
3939
username: 'username'
4040
};
41+
private static readonly CONTINUE_WITH_DEFAULT_DEVFILE_BUTTON: By = By.xpath('//button[text()="Continue with default devfile"]');
4142

4243
constructor(
4344
@inject(CLASSES.DriverHelper)
@@ -184,6 +185,12 @@ export class Dashboard {
184185
await this.driverHelper.waitDisappearance(Dashboard.USER_SETTINGS_DROPDOWN, timeout);
185186
}
186187

188+
async clickContinueWithDefaultDevfileButton(timeout: number = TIMEOUT_CONSTANTS.TS_CLICK_DASHBOARD_ITEM_TIMEOUT): Promise<void> {
189+
Logger.debug();
190+
191+
await this.driverHelper.waitAndClick(Dashboard.CONTINUE_WITH_DEFAULT_DEVFILE_BUTTON, timeout);
192+
}
193+
187194
private getAboutMenuItemButtonLocator(text: string): By {
188195
return By.xpath(`//li/button[text()="${text}"]`);
189196
}

tests/e2e/specs/factory/NoSetupRepoFactory.spec.ts

+20
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,26 @@ suite(
105105
const allCreatedWorkspacesNames: string[] = await workspaces.getAllCreatedWorkspacesNames();
106106
expect(allCreatedWorkspacesNames).has.length(numberOfCreatedWorkspaces);
107107
});
108+
109+
test('Check creating workspace using default devfile', async function (): Promise<void> {
110+
await browserTabsUtil.navigateTo(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_URL());
111+
await dashboard.waitLoader();
112+
await dashboard.clickContinueWithDefaultDevfileButton();
113+
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
114+
registerRunningWorkspace(WorkspaceHandlingTests.getWorkspaceName());
115+
await projectAndFileTests.waitWorkspaceReadinessForCheCodeEditor();
116+
});
117+
118+
test('Check that a project folder has not been cloned', async function (): Promise<void> {
119+
testRepoProjectName = StringUtil.getProjectNameFromGitUrl(FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL);
120+
await driverHelper.waitVisibility(webCheCodeLocators.TitleBar.itemElement);
121+
await projectAndFileTests.performTrustAuthorDialog();
122+
const isProjectFolderUnable: string = await driverHelper.waitAndGetElementAttribute(
123+
(webCheCodeLocators.TreeItem as any).projectFolderItem,
124+
'aria-label'
125+
);
126+
expect(isProjectFolderUnable).to.contain('No Folder Opened Section');
127+
});
108128
} else {
109129
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
110130
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();

0 commit comments

Comments
 (0)