Skip to content

Commit 652b7c8

Browse files
committed
CCM-11492 Move test helper method
1 parent 6596bbd commit 652b7c8

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

tests/test-team/helpers/url-helper.ts

Lines changed: 0 additions & 6 deletions
This file was deleted.

tests/test-team/pages/template-mgmt-base-page-dynamic.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,14 @@ export abstract class TemplateMgmtBasePageDynamic extends TemplateMgmtBasePage {
1818

1919
await this.navigateTo(`/${appUrlSegment}/${pageUrlSegment}/${idParameter}`);
2020
}
21+
22+
static getIdFromUrl(
23+
fullUrl: string,
24+
pageSegment: string
25+
): string | undefined {
26+
// eslint-disable-next-line security/detect-non-literal-regexp
27+
const match = fullUrl.match(new RegExp(`${pageSegment}/([^#/?]+)`));
28+
const id = match ? match[1] : undefined;
29+
return id;
30+
}
2131
}

0 commit comments

Comments
 (0)