-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add start workspace using VSCode Desktop SSH Editor test #23679
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
Open
olkornii
wants to merge
15
commits into
eclipse-che:main
Choose a base branch
from
olkornii:CRW-9705
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+189
−1
Open
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f45fbdd
added EditorSample test for VS Code.
olkornii 509fb39
small fixes + prettier
olkornii 619c6a0
fixed lint error
olkornii 3edcefd
one more lint error fix
olkornii 3bab796
Merge branch 'eclipse-che:main' into CRW-9705
olkornii 6c542b1
Resolved small issues
olkornii 4bc3eda
removed extra logs
olkornii 19a72d5
fixed lint errors
olkornii 98c111d
test suite teardown
olkornii 8696611
added urls for airgap cluster + reworked teardown method.
olkornii fe9c981
Merge branch 'eclipse-che:main' into CRW-9705
olkornii 0d0b9b4
Merge remote-tracking branch 'refs/remotes/origin/CRW-9705' into CRW-…
olkornii 7496707
reworked suiteTeardown. Added try/catch.
olkornii fdbee5a
prettier fixes
olkornii fbf3791
replaced stop and delete to just delete for suiteTeardown.
olkornii File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
tests/e2e/specs/dashboard-samples/EditorSampleVSCode.spec.ts
olkornii marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| import { Logger } from '../../utils/Logger'; | ||
| import { KubernetesCommandLineToolsExecutor } from '../../utils/KubernetesCommandLineToolsExecutor'; | ||
| import fs from 'fs'; | ||
| import path from 'path'; | ||
| import YAML from 'yaml'; | ||
| import { e2eContainer } from '../../configs/inversify.config'; | ||
| import { CLASSES } from '../../configs/inversify.types'; | ||
| import { LoginTests } from '../../tests-library/LoginTests'; | ||
| import { Dashboard } from '../../pageobjects/dashboard/Dashboard'; | ||
| import { BrowserTabsUtil } from '../../utils/BrowserTabsUtil'; | ||
| import { WorkspaceHandlingTests } from '../../tests-library/WorkspaceHandlingTests'; | ||
| import { expect } from 'chai'; | ||
|
|
||
| suite('Check Visual Studio Code (desktop) (SSH) with all samples', function (): void { | ||
| this.timeout(6000000); | ||
| const workspaceHandlingTests: WorkspaceHandlingTests = e2eContainer.get(CLASSES.WorkspaceHandlingTests); | ||
| const pathToSampleFile: string = path.resolve('resources/default-devfile.yaml'); | ||
| const workspaceName: string = YAML.parse(fs.readFileSync(pathToSampleFile, 'utf8')).metadata.name; | ||
| const kubernetesCommandLineToolsExecutor: KubernetesCommandLineToolsExecutor = e2eContainer.get( | ||
| CLASSES.KubernetesCommandLineToolsExecutor | ||
| ); | ||
| kubernetesCommandLineToolsExecutor.workspaceName = workspaceName; | ||
| const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests); | ||
| const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); | ||
| const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); | ||
|
|
||
| const vsCodeEditor: string = '//*[@id="editor-selector-card-che-incubator/che-code-sshd/latest"]'; | ||
olkornii marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const titlexPath: string = '/html/body/h1'; | ||
|
|
||
| const samplesForCheck: string[] = [ | ||
olkornii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 'Empty Workspace', | ||
| 'JBoss EAP 8.0', | ||
| 'Java Lombok', | ||
| 'Node.js Express', | ||
| 'Python', | ||
| 'Quarkus REST API', | ||
| '.NET', | ||
| 'Ansible', | ||
| 'C/C++', | ||
| 'Go', | ||
| 'PHP' | ||
| ]; | ||
|
|
||
| const urlsForCheck: string[] = [ | ||
olkornii marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 'https://github.com/crw-qe/quarkus-api-example-public/tree/ubi8-latest', | ||
| 'https://github.com/crw-qe/ubi9-based-sample-public/tree/ubi9-minimal' | ||
| ]; | ||
|
|
||
| async function deleteWorkspace(): Promise<void> { | ||
| await dashboard.openDashboard(); | ||
| await browserTabsUtil.closeAllTabsExceptCurrent(); | ||
| await dashboard.forceStopWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); | ||
| await dashboard.deleteStoppedWorkspaceByUI(WorkspaceHandlingTests.getWorkspaceName()); | ||
| } | ||
|
|
||
| async function testVSCode(sampleOrUrl: string, isUrl: boolean): Promise<void> { | ||
| Logger.debug(sampleOrUrl); | ||
| await dashboard.openDashboard(); | ||
| await workspaceHandlingTests.createAndOpenWorkspaceWithSpecificEditorAndSample(vsCodeEditor, sampleOrUrl, isUrl, titlexPath); | ||
|
|
||
| const headerText: string = await workspaceHandlingTests.getTextFromWorkspaceElement(titlexPath); | ||
| expect('Workspace ' + WorkspaceHandlingTests.getWorkspaceName() + ' is running').equal(headerText); | ||
|
|
||
olkornii marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| await deleteWorkspace(); | ||
| } | ||
|
|
||
| suiteSetup('Login into OC', function (): void { | ||
olkornii marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| kubernetesCommandLineToolsExecutor.loginToOcp(); | ||
| }); | ||
|
|
||
| suiteSetup('Login into Che', async function (): Promise<void> { | ||
| await loginTests.loginIntoChe(); | ||
| }); | ||
|
|
||
| test('Test VSCode (desktop) (SSH) with default Samples', async function (): Promise<void> { | ||
olkornii marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| for (const sampleName of samplesForCheck) { | ||
| await testVSCode(sampleName, false); | ||
| } | ||
| }); | ||
|
|
||
| test('Test VSCode (desktop) (SSH) with ubi', async function (): Promise<void> { | ||
| for (const url of urlsForCheck) { | ||
| await testVSCode(url, true); | ||
| } | ||
| }); | ||
|
|
||
| suiteTeardown('Delete default DevWorkspace', function (): void { | ||
| kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.