From 88c18f1e923f7572e6641ed893f7722a2ea8ca3a Mon Sep 17 00:00:00 2001 From: dweinholz Date: Tue, 26 Nov 2024 12:49:26 +0100 Subject: [PATCH] fixed tests --- package-lock.json | 27 +++++++++---------- package.json | 4 +-- tests/page_objects/application_overview.po.ts | 6 ++++- .../facility_application_overview.po.ts | 1 + tests/page_objects/formular.po.ts | 1 + tests/page_objects/profile.po.ts | 7 +++-- tests/page_objects/vo_overview.po.ts | 1 + 7 files changed, 27 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index d0d46b7e39..fb687eb3d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,7 +77,7 @@ "@angular/compiler-cli": "18.2.8", "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.9.0", - "@playwright/test": "1.47.2", + "@playwright/test": "^1.49.0", "@types/jasmine": "5.1.4", "@types/node": "20.16.14", "@typescript-eslint/eslint-plugin": "^8.0.0", @@ -4729,13 +4729,12 @@ } }, "node_modules/@playwright/test": { - "version": "1.47.2", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.47.2.tgz", - "integrity": "sha512-jTXRsoSPONAs8Za9QEQdyjFn+0ZQFjCiIztAIF6bi1HqhBzG9Ma7g1WotyiGqFSBRZjIEqMdT8RUlbk1QVhzCQ==", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.49.0.tgz", + "integrity": "sha512-DMulbwQURa8rNIQrf94+jPJQ4FmOVdpE5ZppRNvWVjvhC+6sOeo28r8MgIpQRYouXRtt/FCCXU7zn20jnHR4Qw==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright": "1.47.2" + "playwright": "1.49.0" }, "bin": { "playwright": "cli.js" @@ -14483,13 +14482,12 @@ } }, "node_modules/playwright": { - "version": "1.47.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz", - "integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.49.0.tgz", + "integrity": "sha512-eKpmys0UFDnfNb3vfsf8Vx2LEOtflgRebl0Im2eQQnYMA4Aqd+Zw8bEOB+7ZKvN76901mRnqdsiOGKxzVTbi7A==", "dev": true, - "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.47.2" + "playwright-core": "1.49.0" }, "bin": { "playwright": "cli.js" @@ -14502,11 +14500,10 @@ } }, "node_modules/playwright-core": { - "version": "1.47.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz", - "integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==", + "version": "1.49.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.49.0.tgz", + "integrity": "sha512-R+3KKTQF3npy5GTiKH/T+kdhoJfJojjHESR1YEWhYuEKRVfVaxH3+4+GvXE5xyCngCxhxnykk0Vlah9v8fs3jA==", "dev": true, - "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, diff --git a/package.json b/package.json index 2d83007dce..e9f35a7b8b 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "@angular/compiler-cli": "18.2.8", "@eslint/eslintrc": "^3.1.0", "@eslint/js": "^9.9.0", - "@playwright/test": "1.47.2", + "@playwright/test": "^1.49.0", "@types/jasmine": "5.1.4", "@types/node": "20.16.14", "@typescript-eslint/eslint-plugin": "^8.0.0", @@ -134,4 +134,4 @@ "*.js": "eslint --cache --fix", "*.{js,css,md}": "prettier --write" } -} \ No newline at end of file +} diff --git a/tests/page_objects/application_overview.po.ts b/tests/page_objects/application_overview.po.ts index fdb6be1e4d..42a702af91 100644 --- a/tests/page_objects/application_overview.po.ts +++ b/tests/page_objects/application_overview.po.ts @@ -54,8 +54,12 @@ export class ApplicationOverviewPage { } async goto() { - console.log('Goto Application overview Page'); + console.log(`Goto Application overview Page - ${this.baseURL}/#/applications`); + await this.page.goto(`${this.baseURL}/#/applications`); + await this.page.waitForURL('**/applications'); + + console.log(this.page.url()); expect(this.page.url()).toContain('/applications'); await this.page.waitForSelector(Util.by_data_test_id_str(this.SITE_LOADER), { state: 'hidden' }); diff --git a/tests/page_objects/facility_application_overview.po.ts b/tests/page_objects/facility_application_overview.po.ts index e6434bc8a3..5c048da03e 100644 --- a/tests/page_objects/facility_application_overview.po.ts +++ b/tests/page_objects/facility_application_overview.po.ts @@ -50,6 +50,7 @@ export class FacilityApplicationOverviewPage { async goto() { console.log('Goto Facility Application overview'); + await this.page.goto(`${this.baseURL}/#/facility-manager/facilityApplications`); console.log(this.page.url()); diff --git a/tests/page_objects/formular.po.ts b/tests/page_objects/formular.po.ts index 165a1751ca..75eed734dc 100644 --- a/tests/page_objects/formular.po.ts +++ b/tests/page_objects/formular.po.ts @@ -33,6 +33,7 @@ export class FormularPage { async goto() { console.log('Goto Type-Overview Page'); + await this.page.goto(`${this.baseURL}/#/applications/type-overview`); console.log(this.page.url()); diff --git a/tests/page_objects/profile.po.ts b/tests/page_objects/profile.po.ts index f4dc861c21..9f81a8b2ba 100644 --- a/tests/page_objects/profile.po.ts +++ b/tests/page_objects/profile.po.ts @@ -36,9 +36,11 @@ export class ProfilePage { async generateNewKeyPair(): Promise { await this.goto(); console.log('Opening the Generate Key modal'); + await this.page.locator(Util.by_data_test_id_str(this.OPEN_GENERATE_KEY_BUTTON)).click(); + console.log('Confirming effects of generating a new Key'); - await this.page.locator(Util.by_data_test_id_str(this.GENERATE_KEY_CHECKBOX)).click(); + await this.page.locator(Util.by_data_test_id_str(this.PUBLIC_KEY_ACKNOWLEDGE_CHECKBOX)).click(); console.log('Clicking on Set-Button'); @@ -62,8 +64,9 @@ export class ProfilePage { await this.page.locator(Util.by_data_test_id_str(this.OPEN_SET_KEY_BUTTON)).click(); console.log('Copying public key into textfield.'); await this.page.fill(Util.by_data_test_id_str(this.ENTER_PUBLIC_KEY_AREA), this.TEST_PUBLIC_KEY); - await this.page.locator(Util.by_data_test_id_str(this.PUBLIC_KEY_ACKNOWLEDGE_CHECKBOX)).click() console.log('Confirming effects of generating a new Key'); + + await this.page.locator(Util.by_data_test_id_str(this.PUBLIC_KEY_ACKNOWLEDGE_CHECKBOX)).last().click() // await this.page.locator(Util.by_data_test_id_str(this.GENERATE_KEY_CHECKBOX)).click(); console.log('Clicking on Set-Button'); await Promise.all([ diff --git a/tests/page_objects/vo_overview.po.ts b/tests/page_objects/vo_overview.po.ts index f90b0bc3b4..a73973852d 100644 --- a/tests/page_objects/vo_overview.po.ts +++ b/tests/page_objects/vo_overview.po.ts @@ -33,6 +33,7 @@ export class VoOverviewPage { async goto() { console.log('Goto vo manager overview Page') + await this.page.goto(this.baseURL + this.VO_OVERVIEW_URL) console.log(this.page.url())