From 76e20770d9ca0e9b1d489bed684b84f0eb398197 Mon Sep 17 00:00:00 2001 From: mildred Date: Wed, 6 Mar 2024 22:26:36 +0100 Subject: [PATCH] Adjust behavior to current functionality --- .gitignore | 8 +++++++ package-lock.json | 24 ++++++++++----------- package.json | 2 +- src/constants/constants.ts | 6 +++--- src/constants/env_constants.ts | 4 ++-- src/page-objects/AD_ImportDataPage.ts | 1 + src/page-objects/AD_ViewImportedDataPage.ts | 2 ++ 7 files changed, 29 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 122f199..69678ce 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,11 @@ node_modules/ .vscode .github .DS_Store +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ +/test-results/ +/playwright-report/ +/blob-report/ +/playwright/.cache/ diff --git a/package-lock.json b/package-lock.json index ff7d0d5..773f3da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,17 +9,17 @@ "version": "1.0.0", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.42.1", "@types/node": "^20.10.6" } }, "node_modules/@playwright/test": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.40.1.tgz", - "integrity": "sha512-EaaawMTOeEItCRvfmkI9v6rBkF1svM8wjl/YPRrg2N2Wmp+4qJYkWtJsbew1szfKKDm6fPLy4YAanBhIlf9dWw==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", + "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", "dev": true, "dependencies": { - "playwright": "1.40.1" + "playwright": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -52,12 +52,12 @@ } }, "node_modules/playwright": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.40.1.tgz", - "integrity": "sha512-2eHI7IioIpQ0bS1Ovg/HszsN/XKNwEG1kbzSDDmADpclKc7CyqkHw7Mg2JCz/bbCxg25QUPcjksoMW7JcIFQmw==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", + "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", "dev": true, "dependencies": { - "playwright-core": "1.40.1" + "playwright-core": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -70,9 +70,9 @@ } }, "node_modules/playwright-core": { - "version": "1.40.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.40.1.tgz", - "integrity": "sha512-+hkOycxPiV534c4HhpfX6yrlawqVUzITRKwHAmYfmsVreltEl6fAZJ3DPfLMOODw0H3s1Itd6MDCWmP1fl/QvQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", + "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==", "dev": true, "bin": { "playwright-core": "cli.js" diff --git a/package.json b/package.json index 2d907af..75fa1ec 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "author": "Orchestral team", "license": "ISC", "devDependencies": { - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.42.1", "@types/node": "^20.10.6" } } diff --git a/src/constants/constants.ts b/src/constants/constants.ts index b399189..d46995f 100644 --- a/src/constants/constants.ts +++ b/src/constants/constants.ts @@ -42,11 +42,11 @@ export const SCHEMA_TYPE_CC = 'CourseCredential' //Revisar este valor en la inte //Messages export const ALERT_FILE_IMPORTED_SUCCESSFULLY = "The file was imported successfully!" -export const ALERT_FILE_TO_IMPORT_IS_EMPTY = "The file you try to import is empty" +export const ALERT_FILE_TO_IMPORT_IS_EMPTY = "The file you try to import is empty!" export const ALERT_FILE_IS_BADLY_FORMATTED = "This file is badly formatted!" -export const ALERT_FILE_TO_IMPORT_WITHOUT_REQUIRED_COLUMS = "line 1: 'email' is a required property" -export const ALERT_FILE_TO_IMPORT_WITH_ALIEN_COLUMS = "line 1: Additional properties are not allowed ('alien1', 'alien2' were unexpected)" +export const ALERT_FILE_TO_IMPORT_WITHOUT_REQUIRED_COLUMS = "line 2: 'email' is a required property" +export const ALERT_FILE_TO_IMPORT_WITH_ALIEN_COLUMS = "line 2: Additional properties are not allowed ('alien1', 'alien2' were unexpected)" export const ALERT_USER_CREATED_SUCESSFULLY_MESSAGE = 'The account was created successfully' export const ERROR_INCORRECT_EMAIL_PASSWORD = 'Please enter a correct Email address and password. Note that both fields may be case-sensitive.' diff --git a/src/constants/env_constants.ts b/src/constants/env_constants.ts index 3f579db..8bbfa00 100644 --- a/src/constants/env_constants.ts +++ b/src/constants/env_constants.ts @@ -2,8 +2,8 @@ export const ADMIN_EMAIL = "idhub_admin@pangea.org" export const ADMIN_K = "1234" export const KO_ADMIN_K = "876" -//export const URL_IDHUB = "https://idhub-autotest.demo.pangea.org" -export const URL_IDHUB = "https://idhub-nightly.demo.pangea.org" +export const URL_IDHUB = "https://idhub-autotest.demo.pangea.org" +//export const URL_IDHUB = "https://idhub-nightly.demo.pangea.org" export const USER1_EMAIL = "user1@example.org" export const USER2_EMAIL = "user2@example.org" diff --git a/src/page-objects/AD_ImportDataPage.ts b/src/page-objects/AD_ImportDataPage.ts index a5965f3..4341032 100644 --- a/src/page-objects/AD_ImportDataPage.ts +++ b/src/page-objects/AD_ImportDataPage.ts @@ -110,6 +110,7 @@ export class ImportDataPage { const text = await element.innerText(); console.log(text); expect(text).toBe(expectedMessage); + return true; } } return false; diff --git a/src/page-objects/AD_ViewImportedDataPage.ts b/src/page-objects/AD_ViewImportedDataPage.ts index c231fa3..27fd43f 100644 --- a/src/page-objects/AD_ViewImportedDataPage.ts +++ b/src/page-objects/AD_ViewImportedDataPage.ts @@ -143,8 +143,10 @@ export class ViewImportedDataPage { const text = await element.innerText(); console.log(text); expect(text).toBe(ALERT_FILE_IMPORTED_SUCCESSFULLY); + return true; } } + return false; } catch (error) { console.error("Failed to check for successful file import alert:", error);