Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Update 'Factory' E2E test #23336

Merged
merged 3 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion tests/e2e/constants/BASE_TEST_CONSTANTS.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** *******************************************************************
* copyright (c) 2020-2023 Red Hat, Inc.
* copyright (c) 2020-2025 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand All @@ -17,6 +17,7 @@ export const BASE_TEST_CONSTANTS: {
DELETE_WORKSPACE_ON_FAILED_TEST: boolean;
DELETE_WORKSPACE_ON_SUCCESSFUL_TEST: boolean;
SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW: boolean;
SELECT_OF_CREATION_NEW_WORKSPACE: boolean;
IS_CLUSTER_DISCONNECTED: () => boolean;
IS_PRODUCT_DOCUMENTATION_RELEASED: any;
OCP_VERSION: string;
Expand Down Expand Up @@ -145,6 +146,12 @@ export const BASE_TEST_CONSTANTS: {
SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW:
process.env.SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW === 'true',

/**
* select creation of a new workspace, if a duplicate workspace is created from the factory or sample list.
* this option is false by default.
*/
SELECT_OF_CREATION_NEW_WORKSPACE: process.env.SELECT_OF_CREATION_NEW_WORKSPACE === 'true',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO SELECT_CREATING_NEW_WORKSPACE name should be more relevant in this case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, default value = true is probably conflicting with another constant value SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW=== true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both constants SELECT_CREATING_NEW_WORKSPACE and SELECT_OPENING_EXISTING_WORKSPACE_INSTEAD_OF_CREATION_NEW have default value false


/**
* constant, which prolong timeout constants for local debug.
*/
Expand Down
9 changes: 8 additions & 1 deletion tests/e2e/specs/factory/Factory.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** *******************************************************************
* copyright (c) 2021-2024 Red Hat, Inc.
* copyright (c) 2021-2025 Red Hat, Inc.
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
Expand Down Expand Up @@ -95,6 +95,13 @@ suite(
});
}

if (BASE_TEST_CONSTANTS.SELECT_OF_CREATION_NEW_WORKSPACE) {
test('Select of creating a new workspace', async function (): Promise<void> {
await dashboard.waitExistingWorkspaceFoundAlert();
await dashboard.clickOnCreateNewWorkspaceButton();
});
}

test('Obtain workspace name from workspace loader page', async function (): Promise<void> {
await workspaceHandlingTests.obtainWorkspaceNameFromStartingPage();
});
Expand Down