Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions tests/e2e/specs/SmokeTest.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ suite(`The SmokeTest userstory ${BASE_TEST_CONSTANTS.TEST_ENVIRONMENT}`, functio
const loginTests: LoginTests = e2eContainer.get(CLASSES.LoginTests);
const browserTabsUtil: BrowserTabsUtil = e2eContainer.get(CLASSES.BrowserTabsUtil);
const factoryUrl: string =
FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL ||
'https://github.com/che-incubator/quarkus-api-example.git?policies.create=perclick';
FACTORY_TEST_CONSTANTS.TS_SELENIUM_FACTORY_GIT_REPO_URL || 'https://github.com/che-incubator/quarkus-api-example.git?new';
let projectSection: ViewSection;
suite(`Create workspace from factory:${factoryUrl}`, function (): void {
suiteSetup('Login', async function (): Promise<void> {
Expand Down
11 changes: 9 additions & 2 deletions tests/e2e/utils/StringUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,15 @@ export class StringUtil {
url = url.split('?')[0].split('#')[0];

// remove branch/tree fragments for GitHub, GitLab, Bitbucket
if (url.includes('/tree/') || url.includes('/-/tree/') || url.includes('/src/')) {
url = url.split('/').slice(0, -2).join('/');
if (url.includes('/-/tree/')) {
// gitLab specific pattern: remove everything from /-/tree/ onwards
url = url.substring(0, url.indexOf('/-/tree/'));
} else if (url.includes('/tree/')) {
// gitHub pattern: remove /tree/ and everything after it
url = url.substring(0, url.indexOf('/tree/'));
} else if (url.includes('/src/')) {
// bitbucket pattern: remove /src/ and everything after it
url = url.substring(0, url.indexOf('/src/'));
}

const projectName: string = url
Expand Down
Loading