Skip to content

Commit

Permalink
ci: update hasUrl()
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Jan 8, 2025
1 parent a1ef4ff commit 9dc9c35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/tests/functional/user-route.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ test('user usual routine actions are working correctly', async ({
await pages.riskMatricesPage.hasTitle();

await pages.riskMatricesPage.addButton.click();
await pages.librariesPage.hasUrl();
await pages.librariesPage.hasUrl("/libraries?objectType=risk_matrix");
await pages.librariesPage.hasTitle();

await pages.librariesPage.importLibrary(vars.matrix.name, vars.matrix.urn);
Expand Down
4 changes: 2 additions & 2 deletions frontend/tests/utils/base-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ export abstract class BasePage {
* Otherwise, it checks if the browser's URL starts with `this.url`.
* @returns {void}
*/
async hasUrl(strict: boolean = true) {
const URLPattern = strict ? this.url : new RegExp(escapeRegex(this.url) + '.*');
async hasUrl(url: string = this.url, strict: boolean = true) {
const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*');
await expect(this.page).toHaveURL(URLPattern);

Check failure on line 51 in frontend/tests/utils/base-page.ts

View workflow job for this annotation

GitHub Actions / functional-tests (3.12, chromium)

[chromium] › functional/startup.test.ts:3:1 › startup tests

2) [chromium] › functional/startup.test.ts:3:1 › startup tests › proper redirection to the login page Error: expect(locator(':root')).toHaveURL(false) Locator: locator(':root') Matcher error: expected value must be a string or regular expression Expected has type: boolean Expected has value: false at utils/base-page.ts:51 49 | async hasUrl(url: string = this.url, strict: boolean = true) { 50 | const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*'); > 51 | await expect(this.page).toHaveURL(URLPattern); | ^ 52 | } 53 | 54 | async hasBreadcrumbPath(paths: (string | RegExp)[], fullPath = true, origin = 'Home') { at AnalyticsPage.hasUrl (/home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/utils/base-page.ts:51:27) at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:8:23 at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:4:2

Check failure on line 51 in frontend/tests/utils/base-page.ts

View workflow job for this annotation

GitHub Actions / functional-tests (3.12, chromium)

[chromium] › functional/startup.test.ts:3:1 › startup tests

2) [chromium] › functional/startup.test.ts:3:1 › startup tests › proper redirection to the login page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator(':root')).toHaveURL(false) Locator: locator(':root') Matcher error: expected value must be a string or regular expression Expected has type: boolean Expected has value: false at utils/base-page.ts:51 49 | async hasUrl(url: string = this.url, strict: boolean = true) { 50 | const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*'); > 51 | await expect(this.page).toHaveURL(URLPattern); | ^ 52 | } 53 | 54 | async hasBreadcrumbPath(paths: (string | RegExp)[], fullPath = true, origin = 'Home') { at AnalyticsPage.hasUrl (/home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/utils/base-page.ts:51:27) at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:8:23 at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:4:2

Check failure on line 51 in frontend/tests/utils/base-page.ts

View workflow job for this annotation

GitHub Actions / startup-functional-test (3.12)

[chromium] › functional/startup.test.ts:3:1 › startup tests

1) [chromium] › functional/startup.test.ts:3:1 › startup tests › proper redirection to the login page Error: expect(locator(':root')).toHaveURL(false) Locator: locator(':root') Matcher error: expected value must be a string or regular expression Expected has type: boolean Expected has value: false at utils/base-page.ts:51 49 | async hasUrl(url: string = this.url, strict: boolean = true) { 50 | const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*'); > 51 | await expect(this.page).toHaveURL(URLPattern); | ^ 52 | } 53 | 54 | async hasBreadcrumbPath(paths: (string | RegExp)[], fullPath = true, origin = 'Home') { at AnalyticsPage.hasUrl (/home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/utils/base-page.ts:51:27) at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:8:23 at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:4:2

Check failure on line 51 in frontend/tests/utils/base-page.ts

View workflow job for this annotation

GitHub Actions / startup-functional-test (3.12)

[chromium] › functional/startup.test.ts:3:1 › startup tests

1) [chromium] › functional/startup.test.ts:3:1 › startup tests › proper redirection to the login page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator(':root')).toHaveURL(false) Locator: locator(':root') Matcher error: expected value must be a string or regular expression Expected has type: boolean Expected has value: false at utils/base-page.ts:51 49 | async hasUrl(url: string = this.url, strict: boolean = true) { 50 | const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*'); > 51 | await expect(this.page).toHaveURL(URLPattern); | ^ 52 | } 53 | 54 | async hasBreadcrumbPath(paths: (string | RegExp)[], fullPath = true, origin = 'Home') { at AnalyticsPage.hasUrl (/home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/utils/base-page.ts:51:27) at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:8:23 at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:4:2

Check failure on line 51 in frontend/tests/utils/base-page.ts

View workflow job for this annotation

GitHub Actions / startup-functional-test (3.12)

[firefox] › functional/startup.test.ts:3:1 › startup tests

2) [firefox] › functional/startup.test.ts:3:1 › startup tests › proper redirection to the login page Error: expect(locator(':root')).toHaveURL(false) Locator: locator(':root') Matcher error: expected value must be a string or regular expression Expected has type: boolean Expected has value: false at utils/base-page.ts:51 49 | async hasUrl(url: string = this.url, strict: boolean = true) { 50 | const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*'); > 51 | await expect(this.page).toHaveURL(URLPattern); | ^ 52 | } 53 | 54 | async hasBreadcrumbPath(paths: (string | RegExp)[], fullPath = true, origin = 'Home') { at AnalyticsPage.hasUrl (/home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/utils/base-page.ts:51:27) at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:8:23 at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:4:2

Check failure on line 51 in frontend/tests/utils/base-page.ts

View workflow job for this annotation

GitHub Actions / startup-functional-test (3.12)

[firefox] › functional/startup.test.ts:3:1 › startup tests

2) [firefox] › functional/startup.test.ts:3:1 › startup tests › proper redirection to the login page Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(locator(':root')).toHaveURL(false) Locator: locator(':root') Matcher error: expected value must be a string or regular expression Expected has type: boolean Expected has value: false at utils/base-page.ts:51 49 | async hasUrl(url: string = this.url, strict: boolean = true) { 50 | const URLPattern = strict ? url : new RegExp(escapeRegex(url) + '.*'); > 51 | await expect(this.page).toHaveURL(URLPattern); | ^ 52 | } 53 | 54 | async hasBreadcrumbPath(paths: (string | RegExp)[], fullPath = true, origin = 'Home') { at AnalyticsPage.hasUrl (/home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/utils/base-page.ts:51:27) at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:8:23 at /home/runner/work/ciso-assistant-community/ciso-assistant-community/frontend/tests/functional/startup.test.ts:4:2
}

Expand Down

0 comments on commit 9dc9c35

Please sign in to comment.