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

Add README.md with describing test scenario for WTO #23127

Closed
wants to merge 2 commits into from
Closed
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
53 changes: 53 additions & 0 deletions tests/e2e/specs/web-terminal/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Test Scenario for Web Terminal in OpenShift

### Prerequisites:
* Test Environment: Node.js + Webdriver + Mocha framework.
* Automation Requirement: A browser for interacting with the OpenShift Web Console.
* Permissions: Admin access to the test cluster.
* Setup: Ensure the DevWorkspace Operator is preinstalled before executing the tests.
## Scenario for WebTerminal under Admin user
#### Note! This scenario also is used for interop testing
1. Login as Admin:
* Login as admin user into OpenShift Web Console and refresh the page
2. Clean Up Existing Resources:
* Remove any existing DevWorkspace custom resources (`oc delete dw --all -n dedicated_namespace`)
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
3. Launch WebTerminal:
* Click on the "WebTerminal" icon
* Wait for the WebTerminal widget to appear
4. Create a WebTerminal Session:
* Click the "Create" button.
* Wait for the WebTerminal xterm text area to appear.

5. Verify Admin Session:
* Execute the command oc whoami and verify that the session is running under the admin user.
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
* Since the terminal is canvas-based and difficult to read with WebDriver, read the DevWorkspace object, parse the YAML, and extract the username.
Copy link
Contributor

Choose a reason for hiding this comment

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

did you mean "and extract the username manually"?

Copy link
Contributor Author

@musienko-maxim musienko-maxim Sep 4, 2024

Choose a reason for hiding this comment

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

It means we get webterminal object in YAML format (oc get dw -n -o yaml), parse it, and make sure, that we have been logged in as the proper user. YAML.parse(devWorkspaceYaml).items[0].metadata.name

const devWorkspaceYaml: string = shellExecutor.executeArbitraryShellScript(

6. Execute Help Command:
* Run the help command in the Terminal, redirect the output to a dedicated container, and verify the result.
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
* Ensure all tools are present, and the help command executes successfully.
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
7. Set Inactivity Timeout:
* Configure the Terminal to have a 30-second inactivity timeout.
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
* Verify that the Terminal closes after 30 seconds of inactivity.

---

## Scenario for the Web Terminal under regular user
1. Login as Regular User:
* Log in to the OpenShift Web Console as a regular user and refresh the page.
* If a test project exists, delete it.
2. Clean Up Existing Resources:
* Remove any existing DevWorkspace custom resources (`oc delete dw --all -n dedicated_namespace`)
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
3. Launch WebTerminal:
* Click on the "WebTerminal" icon.
* Wait for the widget to appear for the regular user.
* In the project creation field, type a new namespace for the user.
4. Create a WebTerminal Session:
* Click the "Create" button.
* Wait for the WebTerminal xterm text area to appear.
5. Verify Regular User Session:
* Execute the command oc whoami and verify that the session is running under the regular user.
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
6. Execute Help Command:
* Run the help command in the Terminal, redirect the output to a dedicated container, and verify the result.
* Ensure all tools are present, and the help command executes successfully.
7. Set Inactivity Timeout:
* Configure the Terminal to have a 30-second inactivity timeout.
musienko-maxim marked this conversation as resolved.
Show resolved Hide resolved
* Verify that the Terminal closes after 30 seconds of inactivity.
Loading