Automates "start workspace using IntelliJ IDEA Editors" test#23765
Automates "start workspace using IntelliJ IDEA Editors" test#23765olkornii wants to merge 7 commits intoeclipse-che:mainfrom
Conversation
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
tests/e2e/specs/dashboard-samples/StartWorkspaceUsingIntellijIdeEditor.spec.ts
Outdated
Show resolved
Hide resolved
tests/e2e/specs/dashboard-samples/StartWorkspaceUsingIntellijIdeEditor.spec.ts
Outdated
Show resolved
Hide resolved
tests/e2e/specs/dashboard-samples/StartWorkspaceUsingIntellijIdeaEditor.spec.ts
Show resolved
Hide resolved
tests/e2e/specs/dashboard-samples/StartWorkspaceUsingIntellijIdeEditor.spec.ts
Outdated
Show resolved
Hide resolved
| const dashboard: Dashboard = e2eContainer.get(CLASSES.Dashboard); | ||
| const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil); | ||
|
|
||
| const titlexPath: string = '/html/body/h1'; |
There was a problem hiding this comment.
The XPath '/html/body/h1' of the title looks too common, as it doesn't contain any workspace- or editor-specific information to distinguish it from other regular HTML page.
What do you think about an XPath which checks for the presence of HTML code like h1>Workspace (workspace name) is running</h1>?
There was a problem hiding this comment.
'/html/body/h1' XPath is exactly an XPath of HTML code "h1>Workspace (workspace name) is running</h1". There is a check for exact text: https://github.com/eclipse-che/che/pull/23765/changes#diff-732c71179bfd939d6b555b70a9ce4b4f28264ba1f6bedc94a9b2756d48a2fe42R118
|
@olkornii: taking into account that the test script contains 104 separate test runs, it would be useful not to stop test execution if one of the tests fails, but rather continue running follow up test and then collect test failures to display at the end. |
tests/e2e/specs/dashboard-samples/StartWorkspaceUsingIntellijIdeEditor.spec.ts
Outdated
Show resolved
Hide resolved
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
there is a parameter: "MOCHA_BAIL=false". It is what we need. Works as expected. |
Signed-off-by: Oleksii Korniienko <olkornii@redhat.com>
| editor: string, | ||
| sampleName: string, | ||
| xPath: string, | ||
| polling: number = TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT |
There was a problem hiding this comment.
polling is the default delay between tries in milliseconds between tries
TS_SELENIUM_START_WORKSPACE_TIMEOUT is not suitable here
| editor: string, | ||
| sampleUrl: string, | ||
| xPath: string, | ||
| polling: number = TIMEOUT_CONSTANTS.TS_SELENIUM_START_WORKSPACE_TIMEOUT |
There was a problem hiding this comment.
| Logger.info('Delete DevWorkspace. After each test.'); | ||
| if (currentTabHandle !== 'undefined') { | ||
| await browserTabsUtil.switchToWindow(currentTabHandle); | ||
| } |
There was a problem hiding this comment.
When bail: false, if testWorkspaceStartup fails after opening a new tab but before the workspace name is captured, getWorkspaceName() returns 'undefined' and teardown skips deletion.
This leaves an orphaned running workspace. With 117+ test combinations and bail: false, multiple orphans could accumulate and exhaust cluster resources or cause cascading failures.
Consider using kubernetesCommandLineToolsExecutor in teardown to clean up by workspace name prefix or label as a fallback.
| } | |
| } else { | |
| // fallback: delete DevWorkspace by CLI when name wasn't captured | |
| Logger.warn('Workspace name was not captured. Attempting cleanup via CLI.'); | |
| kubernetesCommandLineToolsExecutor.deleteDevWorkspace(); | |
| } |
|
It's interesting to see test failures when the parameter "MOCHA_BAIL=false" is set. To simulate this situation, you can set a non-existent Git URL in the |
What does this PR do?
Automates "start workspace using IntelliJ IDEA Editors" test
What issues does this PR fix or reference?
Jira issue: https://issues.redhat.com/browse/CRW-9410
PR Checklist
As the author of this Pull Request I made sure that:
What issues does this PR fix or referenceandHow to test this PRcompletedReviewers
Reviewers, please comment how you tested the PR when approving it.