Skip to content

Commit 617712e

Browse files
authored
[Test] Update 'Factory' E2E test (#23336)
* Add changes to 'Factory' test * Add new constant 'SELECT_OF_CREATION_NEW_WORKSPACE`
1 parent 1ac40f3 commit 617712e

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

tests/e2e/constants/BASE_TEST_CONSTANTS.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** *******************************************************************
2-
* copyright (c) 2020-2023 Red Hat, Inc.
2+
* copyright (c) 2020-2025 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
@@ -17,6 +17,7 @@ export const BASE_TEST_CONSTANTS: {
1717
DELETE_WORKSPACE_ON_FAILED_TEST: boolean;
1818
DELETE_WORKSPACE_ON_SUCCESSFUL_TEST: boolean;
1919
SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW: boolean;
20+
SELECT_CREATING_NEW_WORKSPACE: boolean;
2021
IS_CLUSTER_DISCONNECTED: () => boolean;
2122
IS_PRODUCT_DOCUMENTATION_RELEASED: any;
2223
OCP_VERSION: string;
@@ -145,6 +146,12 @@ export const BASE_TEST_CONSTANTS: {
145146
SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW:
146147
process.env.SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW === 'true',
147148

149+
/**
150+
* select creation of a new workspace, if a duplicate workspace is created from the factory or sample list.
151+
* this option is false by default.
152+
*/
153+
SELECT_CREATING_NEW_WORKSPACE: process.env.SELECT_CREATING_NEW_WORKSPACE === 'true',
154+
148155
/**
149156
* constant, which prolong timeout constants for local debug.
150157
*/

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

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** *******************************************************************
2-
* copyright (c) 2021-2024 Red Hat, Inc.
2+
* copyright (c) 2021-2025 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
@@ -95,6 +95,13 @@ suite(
9595
});
9696
}
9797

98+
if (BASE_TEST_CONSTANTS.SELECT_CREATING_NEW_WORKSPACE) {
99+
test('Select of creating a new workspace', async function (): Promise<void> {
100+
await dashboard.waitExistingWorkspaceFoundAlert();
101+
await dashboard.clickOnCreateNewWorkspaceButton();
102+
});
103+
}
104+
98105
test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
99106
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
100107
});

0 commit comments

Comments
 (0)