From 8c284f8c934042f3d70e25a4c8019d61072fa83d Mon Sep 17 00:00:00 2001 From: dweinholz Date: Mon, 20 Mar 2023 10:30:48 +0100 Subject: [PATCH 01/22] fix(Application): cant choose non SimpleVM compute center anymoore --- e2e/environment_template.json | 17 - e2e/log4jsGen.js | 17 - e2e/page_objects/application_formular.po.ts | 101 ---- e2e/page_objects/application_overview.po.ts | 131 ----- e2e/page_objects/cluster_overview.po.ts | 62 --- e2e/page_objects/facility_overview.po.ts | 76 --- e2e/page_objects/fm_project_overview.po.ts | 52 -- e2e/page_objects/login.po.ts | 96 ---- e2e/page_objects/new_cluster.po.ts | 75 --- e2e/page_objects/new_instance.po.ts | 119 ---- e2e/page_objects/profile_page.po.ts | 57 -- e2e/page_objects/project_overview.po.ts | 247 --------- e2e/page_objects/vm_detail.po.ts | 101 ---- e2e/page_objects/vm_overview.po.ts | 283 ---------- e2e/page_objects/vm_snapshot.po.ts | 76 --- e2e/page_objects/vo_overview.po.ts | 52 -- e2e/page_objects/volume_overview.po.ts | 86 --- e2e/page_objects/workshop_overview.po.ts | 154 ------ e2e/page_objects/workshop_vm.po.ts | 81 --- e2e/protractor.conf.js | 205 ------- e2e/tests/cloud_application_approval_test.ts | 36 -- .../cloud_application_modification_test.ts | 33 -- e2e/tests/cloud_application_test.ts | 46 -- e2e/tests/cloud_modification_approval_test.ts | 34 -- e2e/tests/cluster_tests.ts | 48 -- e2e/tests/create_workshop_test.ts | 45 -- e2e/tests/login_test.ts | 27 - e2e/tests/member_test.ts | 26 - e2e/tests/public_key_test.ts | 23 - ...le_vm_application_modification_approval.ts | 21 - e2e/tests/simple_vm_application_test.ts | 46 -- e2e/tests/simple_vm_approval_test.ts | 23 - .../simple_vm_extension_approval_test.ts | 21 - e2e/tests/simple_vm_extension_test.ts | 30 -- e2e/tests/simple_vm_modification_test.ts | 34 -- e2e/tests/simple_vm_no_pi_test.ts | 53 -- e2e/tests/start_workshop_vms_test.ts | 67 --- e2e/tests/terminate_all_pt.ts | 41 -- e2e/tests/terminate_all_pt_after.ts | 41 -- e2e/tests/terminate_all_workshops_test.ts | 24 - e2e/tests/virtual_machine_tests.ts | 201 ------- e2e/tsconfig.e2e.json | 12 - e2e/util.ts | 510 ------------------ .../applications/applications.component.html | 24 +- src/app/layouts/full-layout.component.ts | 4 +- .../computecenter.component.ts | 14 +- .../application-base-class.component.ts | 1 + 47 files changed, 27 insertions(+), 3546 deletions(-) delete mode 100644 e2e/environment_template.json delete mode 100644 e2e/log4jsGen.js delete mode 100644 e2e/page_objects/application_formular.po.ts delete mode 100644 e2e/page_objects/application_overview.po.ts delete mode 100644 e2e/page_objects/cluster_overview.po.ts delete mode 100644 e2e/page_objects/facility_overview.po.ts delete mode 100644 e2e/page_objects/fm_project_overview.po.ts delete mode 100644 e2e/page_objects/login.po.ts delete mode 100644 e2e/page_objects/new_cluster.po.ts delete mode 100644 e2e/page_objects/new_instance.po.ts delete mode 100644 e2e/page_objects/profile_page.po.ts delete mode 100644 e2e/page_objects/project_overview.po.ts delete mode 100644 e2e/page_objects/vm_detail.po.ts delete mode 100644 e2e/page_objects/vm_overview.po.ts delete mode 100644 e2e/page_objects/vm_snapshot.po.ts delete mode 100644 e2e/page_objects/vo_overview.po.ts delete mode 100644 e2e/page_objects/volume_overview.po.ts delete mode 100644 e2e/page_objects/workshop_overview.po.ts delete mode 100644 e2e/page_objects/workshop_vm.po.ts delete mode 100644 e2e/protractor.conf.js delete mode 100644 e2e/tests/cloud_application_approval_test.ts delete mode 100644 e2e/tests/cloud_application_modification_test.ts delete mode 100644 e2e/tests/cloud_application_test.ts delete mode 100644 e2e/tests/cloud_modification_approval_test.ts delete mode 100644 e2e/tests/cluster_tests.ts delete mode 100644 e2e/tests/create_workshop_test.ts delete mode 100644 e2e/tests/login_test.ts delete mode 100644 e2e/tests/member_test.ts delete mode 100644 e2e/tests/public_key_test.ts delete mode 100644 e2e/tests/simple_vm_application_modification_approval.ts delete mode 100644 e2e/tests/simple_vm_application_test.ts delete mode 100644 e2e/tests/simple_vm_approval_test.ts delete mode 100644 e2e/tests/simple_vm_extension_approval_test.ts delete mode 100644 e2e/tests/simple_vm_extension_test.ts delete mode 100644 e2e/tests/simple_vm_modification_test.ts delete mode 100644 e2e/tests/simple_vm_no_pi_test.ts delete mode 100644 e2e/tests/start_workshop_vms_test.ts delete mode 100644 e2e/tests/terminate_all_pt.ts delete mode 100644 e2e/tests/terminate_all_pt_after.ts delete mode 100644 e2e/tests/terminate_all_workshops_test.ts delete mode 100644 e2e/tests/virtual_machine_tests.ts delete mode 100644 e2e/tsconfig.e2e.json delete mode 100644 e2e/util.ts diff --git a/e2e/environment_template.json b/e2e/environment_template.json deleted file mode 100644 index 049b0b2b3f..0000000000 --- a/e2e/environment_template.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "password_user": "", - "email_user": "", - "elixir_id_user": "", - "password_fm": "", - "email_fm": "", - "password_vo": "", - "email_vo": "", - "elixir_id_vo": "", - "portal": "", - "angular":"", - "auth_user": "", - "auth_fm": "", - "auth_vo": "", - "browser_h": 1080, - "browser_w": 1920 -} diff --git a/e2e/log4jsGen.js b/e2e/log4jsGen.js deleted file mode 100644 index 53e191e873..0000000000 --- a/e2e/log4jsGen.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; -var log4js = require('log4js'); -log4js.configure({ - appenders: {logs: {type: "file", filename: "test_results/e2e.log"}, console: {type: 'log4js-protractor-appender'}}, - - categories: {default: {appenders: ["logs", "console"], level: "debug"}} -}); - -var log4jsGen = { - getLogger: function getLogger() { - - var logger = log4js.getLogger('logs'); - return logger; - } -}; - -module.exports = log4jsGen; diff --git a/e2e/page_objects/application_formular.po.ts b/e2e/page_objects/application_formular.po.ts deleted file mode 100644 index 145a2932e1..0000000000 --- a/e2e/page_objects/application_formular.po.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { by, element } from 'protractor'; -import { Util } from '../util'; - -/** - * Page object for the Application requests. - */ -export class FormularPage { - private static SIDEBAR_NEW_PROJECT: string = 'sidebar_new_project'; - private static NEW_SVM_BTN: string = 'newSimpleVMBtn'; - private static SUBMIT_BTN: string = 'submit_btn'; - private static VERIFICATION_BTN: string = 'verification_btn'; - private static ACKNOWLEDGE_BTN: string = 'acknowledge_approve_btn'; - private static APPLICATION_SUBMITTED: string = 'The application was submitted'; - private static NOTIFICATION_MESSAGE: string = 'notification_message'; - public static NOTIFICATION_BTN_REDIRECT: string = 'notification_btn_redirect'; - private static NUMBER_FLAVORS: string = '5'; - private static PI_RESPONSIBILITY: string = 'project_application_responsibility'; - private static PI_APPROVAL_BUTTON: string = 'approveApplicationButtonPI'; - - static async submitApplication(): Promise { - Util.logInfo('Submit Application'); - - await Util.clickElementById(this.SUBMIT_BTN); - await Util.clickElementById(this.VERIFICATION_BTN); - await Util.clickElementById(this.ACKNOWLEDGE_BTN); - Util.logInfo('Submitted Application'); - } - - static async approveByPI(): Promise { - Util.logInfo('Approving by PI'); - await Util.waitForPresenceOfElementById(this.PI_RESPONSIBILITY); - await Util.clickElementById(this.PI_RESPONSIBILITY); - await Util.waitForPresenceOfElementById(this.PI_APPROVAL_BUTTON); - await Util.clickElementById(this.PI_APPROVAL_BUTTON); - await Util.waitForPresenceOfElementById(this.NOTIFICATION_BTN_REDIRECT); - await Util.clickElementById(this.NOTIFICATION_BTN_REDIRECT); - } - - static async navigateToCloudApplication(): Promise { - await Util.navigateToAngularPage('applications/newCloudApplication'); - - return await Util.waitForPage('applications/newCloudApplication'); - } - - static async navigateToSimpleVmApplication(): Promise { - await Util.waitForPresenceOfElementById(this.SIDEBAR_NEW_PROJECT); - await Util.clickElementById(this.SIDEBAR_NEW_PROJECT); - await Util.waitForPresenceOfElementById(this.NEW_SVM_BTN); - await Util.clickElementById(this.NEW_SVM_BTN); - } - - static async isApplicationSubmitted(): Promise { - return await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.APPLICATION_SUBMITTED); - } - - static async fillApplicationFormular(name: string, is_pi?: boolean, openstack?: boolean): Promise { - - // fill Formular - Util.logInfo('Fill form'); - await Util.sendTextToElementByIdUnsecure('id_project_application_name', name); - await Util.sendTextToElementByName('project_application_shortname', name); - await Util.sendTextToElementByName('project_application_description', 'ProtractorTest Description'); - await Util.sendTextToElementByName('project_application_lifetime', '4'); - if (!openstack) { - await Util.clickElementById('id_project_application_workshop'); - } - await Util.sendTextToElementByName('project_application_institute', 'Proctractor Institute'); - await Util.sendTextToElementByName('project_application_workgroup', 'Proctractor Workgroup'); - await Util.clickElementById('id_project_application_bmbf_switch'); - await Util.sendTextToElementByName('project_application_bmbf_project', 'BMBF Project'); - await Util.clickElementById('id_project_application_elixir_switch'); - await Util.sendTextToElementByName('project_application_elixir_project', 'Elixir Project'); - await Util.sendTextToElementByIdUnsecure('de.NBI default', this.NUMBER_FLAVORS); - await Util.sendTextToElementByElement(element(by.className('input-container')).element(by.tagName('input')), 'Bioinformatics'); - await Util.clickElementById('Bioinformatics'); - await Util.clickElementById('id_project_application_horizon_switch'); - await Util.sendTextToElementByName('project_application_horizon2020', 'Horizon2020Project'); - await Util.sendTextToElementByIdUnsecure('id_project_application_volume_limit', '2'); - await Util.clickElementById('id_project_application_report_allowed'); - await Util.clickElementById('id_project_application_sensitive_data'); - // await Util.sendTextToElementByName('information_public_title_input', 'A Public Title'); - await Util.clickElementById('public_description_enabled'); - await Util.sendTextToElementByName('information_description', 'A Public Description'); - await Util.clickElementById('information_resources_checkbox'); - await Util.clickElementById('information_lifetime_checkbox'); - await Util.clickElementById('information_project_type_checkbox'); - await Util.clickElementById('information_pi_name_checkbox'); - await Util.clickElementById('information_institution_checkbox'); - await Util.clickElementById('information_workgroup_checkbox'); - await Util.clickElementById('information_project_affiliation_checkbox'); - await Util.clickElementById('platform_denbi_checkbox'); - await Util.clickElementById('platform_twitter_checkbox'); - - if (is_pi) { - await Util.clickElementById('project_application_pi_approved_checkbox'); - await Util.clickElementById('project_application_responsibility_checkbox'); - } else { - await Util.sendTextToElementByIdUnsecure('id_project_application_pi_email', Util.PI_EMAIL); - } - } -} diff --git a/e2e/page_objects/application_overview.po.ts b/e2e/page_objects/application_overview.po.ts deleted file mode 100644 index e3e9f805ba..0000000000 --- a/e2e/page_objects/application_overview.po.ts +++ /dev/null @@ -1,131 +0,0 @@ -import { by, element, ElementFinder } from 'protractor'; -import { Util } from '../util'; - -/** - * Applicationoverview page object. - */ -export class ApplicationOverviewPage { - private static OWN_APPLICATION_ID: string = 'own_applications'; - private static EXTENSION_RESULT: string = 'notification_message'; - private static EXTENSION_SV_SUCCESSFULLY_APPROVED: string = 'Modify request successfully approved!'; - private static EXTENSION_OP_SUCCESFULLY_APPROVED: string = 'Modify request successfully approved and forwarded to facility!'; - private static EXTENSION_APPROVAL_BTN_PREFIX: string = 'extension_approval_'; - private static COMPUTE_CENTER_SELECTION_PREFIX: string = 'id_compute_center_option_'; - private static DEFAULT_DENBI_COMPUTE_CENTER: string = 'de.NBI Cloud Portal - Development'; - private static CLOUD_PROJECT_CREATED: string = 'The new project was created'; - private static SIMPLE_VM_CREATED: string = 'The project was created!'; - private static NOTIFICATION_MESSAGE: string = 'notification_modal_message'; - private static APPROVAL_PREFIX: string = 'approve_'; - private static APPROVAL_CLIENT_LIMIT_PREFIX: string = 'approve_client_limit_'; - private static MODIFICATION_TAB_BUTTON: string = 'tab_state_button_modification_request'; - private static MODIFICATION_APPROVAL_BTN_PREFIX: string = 'modification_approval_'; - private static MODIFICATION_REQUEST_RESULT_TEXT: string = 'The resource modification request was approved!'; - private static EXTENSION_TAB_BUTTON: string = 'tab_state_button_extension_request'; - private static EXTENSION_RESULT_MESSAGE_TEXT: string = 'The project has been extended!'; - private static DECLINE_PT_OPEN_APPLICATION_PRE: string = 'btn_decline_PTOpenStack'; - private static DECLINE_PT_SIMPLE_APPLICATION_PRE: string = 'btn_decline_PTSimpleVM'; - private static SUCCESSFULL_DECLINED: string = 'The Application was declined'; - private static CLOSE_NOTIFICATION_MODAL: string = 'close_notification_modal_btn'; - private static SUBMITTED_APPLICATIONS_TAB: string = 'tab_state_button_submitted_applications'; - private static LOADING_APPLICATIONS: string = 'loading_applications'; - - static async navigateToApplicationOverview(): Promise { - Util.logInfo('Navigate to Application Overview form'); - await Util.navigateToAngularPage('applications'); - await Util.waitForPage('applications'); - } - - static async declinePTApplications(): Promise { - Util.logInfo('Decline all PT applications'); - await Util.waitForPresenceOfElementById(this.SUBMITTED_APPLICATIONS_TAB); - Util.logInfo('Decline open PT OpenStack applications'); - - let openstack_ele: ElementFinder = element(by.id(this.DECLINE_PT_OPEN_APPLICATION_PRE)); - - while (await openstack_ele.isPresent()) { - await Util.clickElementByElement(openstack_ele); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.SUCCESSFULL_DECLINED); - await Util.clickElementById(this.CLOSE_NOTIFICATION_MODAL); - openstack_ele = element(by.id(this.DECLINE_PT_OPEN_APPLICATION_PRE)); - - } - Util.logInfo('Decline open PT SimpleVM applications'); - - let simple_ele: ElementFinder = element(by.id(this.DECLINE_PT_SIMPLE_APPLICATION_PRE)); - while (await simple_ele.isPresent()) { - await Util.clickElementByElement(simple_ele); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.SUCCESSFULL_DECLINED); - await Util.clickElementById(this.CLOSE_NOTIFICATION_MODAL); - simple_ele = element(by.id(this.DECLINE_PT_SIMPLE_APPLICATION_PRE)); - - } - - } - - static async approveModificationRequest(application_name: string): Promise { - await Util.waitForPresenceOfElementById(this.MODIFICATION_TAB_BUTTON); - await Util.waitForInvisibilityOfElementById(this.LOADING_APPLICATIONS); - await Util.clickElementById(this.MODIFICATION_TAB_BUTTON); - await Util.waitForAbsenceOfElementById(this.LOADING_APPLICATIONS); - - await Util.waitForPresenceOfElementById(this.MODIFICATION_APPROVAL_BTN_PREFIX + application_name); - await Util.clickElementById(this.MODIFICATION_APPROVAL_BTN_PREFIX + application_name); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.MODIFICATION_REQUEST_RESULT_TEXT); - - } - - static async approveSimpleVMModificationRequest(application_name: string): Promise { - await Util.waitForPresenceOfElementById(this.MODIFICATION_TAB_BUTTON); - await Util.clickElementById(this.MODIFICATION_TAB_BUTTON); - await Util.waitForAbsenceOfElementById(this.LOADING_APPLICATIONS); - - await Util.waitForPresenceOfElementById(this.MODIFICATION_APPROVAL_BTN_PREFIX + application_name); - await Util.clickElementById(this.MODIFICATION_APPROVAL_BTN_PREFIX + application_name); - await Util.clickElementById(this.APPROVAL_CLIENT_LIMIT_PREFIX + application_name); - - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.MODIFICATION_REQUEST_RESULT_TEXT); - - } - - static async approveExtensionRequest(application_name: string): Promise { - - await Util.waitForPresenceOfElementById(this.EXTENSION_TAB_BUTTON); - await Util.clickElementById(this.EXTENSION_TAB_BUTTON); - await Util.waitForAbsenceOfElementById(this.LOADING_APPLICATIONS); - - await Util.waitForPresenceOfElementById(this.EXTENSION_APPROVAL_BTN_PREFIX + application_name); - await Util.clickElementById(this.EXTENSION_APPROVAL_BTN_PREFIX + application_name); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.EXTENSION_RESULT_MESSAGE_TEXT); - - } - - static async isApplicationRequestPresent(application_name: string): Promise { - await Util.waitForPage('applications'); - await Util.waitForPresenceOfElementById(this.OWN_APPLICATION_ID); - const elm: any = element(by.id(application_name)); - - return await elm.isPresent(); - } - - static async approveSimpleVm(application_name: string): Promise { - await Util.waitForPage('applications'); - await Util.waitForAbsenceOfElementById(this.LOADING_APPLICATIONS); - await Util.waitForPresenceOfElementById(this.COMPUTE_CENTER_SELECTION_PREFIX + application_name); - await Util.clickOptionOfSelect(this.DEFAULT_DENBI_COMPUTE_CENTER, this.COMPUTE_CENTER_SELECTION_PREFIX + application_name); - await Util.clickElementById(this.APPROVAL_PREFIX + application_name); - await Util.clickElementById(this.APPROVAL_CLIENT_LIMIT_PREFIX + application_name); - - return Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.SIMPLE_VM_CREATED, 60000); - - } - - static async approveCloudApplication(application_name: string): Promise { - await Util.waitForPage('applications'); - await Util.waitForAbsenceOfElementById(this.LOADING_APPLICATIONS); - await Util.waitForPresenceOfElementById(this.COMPUTE_CENTER_SELECTION_PREFIX + application_name); - await Util.clickOptionOfSelect(this.DEFAULT_DENBI_COMPUTE_CENTER, this.COMPUTE_CENTER_SELECTION_PREFIX + application_name); - await Util.clickElementById(this.APPROVAL_PREFIX + application_name); - - return await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.CLOUD_PROJECT_CREATED); - } -} diff --git a/e2e/page_objects/cluster_overview.po.ts b/e2e/page_objects/cluster_overview.po.ts deleted file mode 100644 index b56a2a9d70..0000000000 --- a/e2e/page_objects/cluster_overview.po.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { browser } from 'protractor'; -import { Util } from '../util'; - -/** - * Cluster Overview Page. - */ -export class ClusterOverviewPage { - - private static CLUSTER_OVERVIEW_URL: string = 'virtualmachines/clusterOverview'; - private static INSTANCE_PREFIX: string = 'instanceCard_'; - private static RUNNING_BADE_PREFIX: string = 'running_badge_'; - private static DELETE_CLUSTER_PREFIX: string = 'delete_'; - private static SCALE_DOWN_PREFIX: string = 'scale_down_'; - private static SCALE_UP_PREFIX: string = 'scale_up_'; - private static CONFIRM_DELETE_BTN: string = 'confirm_delete_button'; - private static DEFAULT_BADGE_PREFIX: string = 'default_badge_'; - private static DELETE_BADGE_PREFIX: string = 'deleted_badge_'; - private static CLUSTER_NAME: string = ''; - - static async setClusterName(name: string): Promise { - Util.logInfo(`Setting basic cluster name as ${name}`); - this.CLUSTER_NAME = name; - } - - static async getClusterName(): Promise { - return this.CLUSTER_NAME; - } - - static async navigateToOverview(): Promise { - Util.logInfo('Navigating to Cluster Overview Page'); - await Util.navigateToAngularPage(this.CLUSTER_OVERVIEW_URL); - await Util.waitForPage(this.CLUSTER_OVERVIEW_URL, Util.MIN_TIMEOUT_1); - - return await browser.driver.sleep(10000); - } - - static async isClusterActive(name: string = this.CLUSTER_NAME): Promise { - Util.logInfo(`Checking if ${name} is active`); - - return await Util.waitForPresenceOfElementById(`${this.RUNNING_BADE_PREFIX}${name}`, Util.MIN_TIMOEUT_30); - } - - static async scaleUpCluster(name: string = this.CLUSTER_NAME): Promise { - Util.logInfo(`Scale Up ${name}`); - - await Util.clickElementById(this.SCALE_UP_PREFIX + name); - - Util.logInfo(`Deletion method for ${name} completed`); - } - - static async deleteCluster(name: string = this.CLUSTER_NAME): Promise { - Util.logInfo(`Deleting ${name}`); - - await Util.clickElementById(this.DELETE_CLUSTER_PREFIX + name); - - await Util.clickElementById(this.CONFIRM_DELETE_BTN); - await Util.waitForPresenceOfElementById(this.DELETE_BADGE_PREFIX + name, Util.MIN_TIMEOUT_15); - - Util.logInfo(`Deletion method for ${name} completed`); - } - -} diff --git a/e2e/page_objects/facility_overview.po.ts b/e2e/page_objects/facility_overview.po.ts deleted file mode 100644 index 081b56c867..0000000000 --- a/e2e/page_objects/facility_overview.po.ts +++ /dev/null @@ -1,76 +0,0 @@ -import { browser } from 'protractor'; -import { Util } from '../util'; - -/** - * Facilityoverivew page. - */ -export class FacilityOverviewPage { - - private static FACILITY_OVERVIEW_URL: string = 'facility-manager/facilityApplications'; - private static APPLICATION_APPROVAL_BTN_PREFIX: string = 'approval_'; - private static SUCCESSFULLY_APPROVED_APPL: string = 'Successfully approved the application.'; - private static NOTIFICATION_MESSAGE: string = 'notification_message'; - private static EXTENSION_APPROVAL_BTN_PREFIX: string = 'extension_approval_'; - private static MODIFICATION_APPROVAL_BTN_PREFIX: string = 'approveModificationButton_'; - private static EXTENSION_SUCCESSFULLY: string = 'Successfully approved the application modification.'; - private static MODIFICATION_EXTENSION_SUCCESS_TEXT: string = 'Successfully approved modification!'; - private static TAB_STATE_MODIFICATION_BUTTON: string = 'tab_state_button_modification_requests'; - private static TAB_STATE_TERMINATION_BUTTON: string = 'tab_state_button_termination_requests'; - private static TERMINATE_PT_APPLICATION_BTN: string = 'approveTerminationButton_PT'; - private static TERMINATE_PROJECT_BTN: string = 'terminate_project_btn'; - private static WAS_TERMINATED: string = 'The project was terminated.'; - private static CLOSE_NOTIFICATION_BTN: string = 'close_notification'; - private static LOADING_APPLICATIONS: string = 'loading_applications'; - private static TERMINATION_TABLE: string = 'termination_table'; - private static TERMINATION_COUNTER: string = 'termination_counter'; - - static async navigateToFacilityOverview(): Promise { - Util.logInfo('Navigating to facility overview'); - await Util.navigateToAngularPage(this.FACILITY_OVERVIEW_URL); - } - - static async approveApplication(application_name: string): Promise { - await Util.clickElementById(this.APPLICATION_APPROVAL_BTN_PREFIX + application_name); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.SUCCESSFULLY_APPROVED_APPL); - } - - static async approveApplicationExtension(application_name: string): Promise { - await Util.clickElementById(this.EXTENSION_APPROVAL_BTN_PREFIX + application_name); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.EXTENSION_SUCCESSFULLY); - } - - static async terminatePTApplications(): Promise { - await Util.waitForPresenceOfElementById(this.TAB_STATE_TERMINATION_BUTTON); - await Util.waitForInvisibilityOfElementById(this.LOADING_APPLICATIONS); - await Util.clickElementById(this.TAB_STATE_TERMINATION_BUTTON); - await Util.waitForInvisibilityOfElementById(this.LOADING_APPLICATIONS); - await browser.sleep(10000); - - Util.logInfo('Terminate all PT projects'); - const elements: any = await Util.getElementsByIdPrefix(this.TERMINATE_PT_APPLICATION_BTN); - for (const ele of elements) { - // eslint-disable-next-line no-await-in-loop - await this.terminateProject(ele); - } - } - - static async terminateProject(terminateBtnId: Element): Promise { - Util.logInfo(`Terminate Project ${terminateBtnId}`); - - await Util.clickElementByElement(terminateBtnId); - await Util.clickElementById(this.TERMINATE_PROJECT_BTN); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.WAS_TERMINATED); - await Util.clickElementById(this.CLOSE_NOTIFICATION_BTN); - - } - - static async approveApplicationModification(application_name: string): Promise { - await Util.waitForPresenceOfElementById(this.TAB_STATE_MODIFICATION_BUTTON); - await Util.clickElementById(this.TAB_STATE_MODIFICATION_BUTTON); - await Util.waitForAbsenceOfElementById(this.LOADING_APPLICATIONS); - await Util.waitForPresenceOfElementById(this.MODIFICATION_APPROVAL_BTN_PREFIX + application_name); - await Util.clickElementById(this.MODIFICATION_APPROVAL_BTN_PREFIX + application_name); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MESSAGE, this.MODIFICATION_EXTENSION_SUCCESS_TEXT); - } - -} diff --git a/e2e/page_objects/fm_project_overview.po.ts b/e2e/page_objects/fm_project_overview.po.ts deleted file mode 100644 index 89cfebe1c6..0000000000 --- a/e2e/page_objects/fm_project_overview.po.ts +++ /dev/null @@ -1,52 +0,0 @@ -import {browser, by, element} from 'protractor'; -import {Util} from '../util'; - -/** - * FM Overview Page. - */ -export class FmProjectsOverview { - - private static FM_OVERVIEW_URL: string = 'facility-manager/facilityProjects'; - private static FILTER_PROJECT_NAME_INPUT: string = 'filter_project_name'; - private static SHOW_TERMINATE_PREFIX: string = 'show_terminate_'; - private static TERMINATE_PROJECT_BTN: string = 'terminate_project_btn'; - private static NOTIFICATION_MESSAGE: string = 'notification_message'; - private static CLOSE_NOTIFICATION_BTN: string = 'close_notification'; - private static PROJECT_TERMINATED_MESSAGE: string = 'The project was terminated.'; - private static TERMINATE_BUTTON_TEXT: string = 'Terminate Project'; - private static NOTIFICATION_MODAL_TITLE: string = 'notification_modal_title' - private static SUCCESS: string = 'Success' - - static async navigateToFMProjectsOverview(): Promise { - Util.logInfo('Navigating to fm projects overview'); - await Util.navigateToAngularPage(this.FM_OVERVIEW_URL); - } - - static async filterForPTProjets(): Promise { - Util.logInfo('Filter for PT Projects'); - await Util.sendTextToElementByIdUnsecure(this.FILTER_PROJECT_NAME_INPUT, 'PT'); - await browser.sleep(2000) - } - - static async terminateAllPTProjects(): Promise { - Util.logInfo('Terminate all PT projects'); - let ele: any = element(by.buttonText(this.TERMINATE_BUTTON_TEXT)); - while (await ele.isPresent()) { - await this.terminateProject(ele); - ele = element(by.buttonText(this.TERMINATE_BUTTON_TEXT)); - } - - } - - static async terminateProject(terminateBtnId: Element): Promise { - Util.logInfo(`Terminate Project ${terminateBtnId}`); - - await Util.clickElementByElement(terminateBtnId); - await Util.clickElementById(this.TERMINATE_PROJECT_BTN); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MODAL_TITLE, this.SUCCESS); - await Util.clickElementById(this.CLOSE_NOTIFICATION_BTN); - await browser.sleep(5000) - - } - -} diff --git a/e2e/page_objects/login.po.ts b/e2e/page_objects/login.po.ts deleted file mode 100644 index 2ea0f5d560..0000000000 --- a/e2e/page_objects/login.po.ts +++ /dev/null @@ -1,96 +0,0 @@ -import { browser, by, element } from 'protractor'; -import { Util } from '../util'; - -/** - * LoginPage. - */ -export class LoginPage { - - private static timeout: number = browser.params.timeout; - private static TEST_RP_WARNING: string = 'testRpWarning'; - private static TEST_RP_CONTINUE: string = 'continue'; - - static async login(email: string, psw: string, auth: string, relog: boolean = false): Promise { - await browser.driver.get(browser.params.portal); - Util.logInfo('Login'); - const current_url: any = await browser.driver.getCurrentUrl(); - Util.logInfo(current_url); - if (relog) { - Util.logInfo('Need to relog'); - await this.logOut(); - await browser.waitForAngularEnabled(false); - await LoginPage.login(email, psw, auth); - } else if (auth === 'google') { - Util.logInfo('Login with Google'); - await this.useGoogle(email, psw); - } else if (auth === 'orcid') { - Util.logInfo('Login with Orcid'); - await this.useOrcid(email, psw); - } else { - Util.logInfo('Login with University of Bielefeld'); - await this.useUni(email, psw); - } - Util.logInfo('Checking login success.'); - await Util.waitForPage('userinfo'); - } - - static async useOrcid(email: string, psw: string): Promise { - if (!await Util.clickElementByLinkTextIgnoreError('ORCID')) { - await Util.clickElementByLinkText('Sign in with ORCID'); - } - // Input Email - await Util.waitForPage('https://orcid.org/signin'); - await Util.sendTextToElementByIdSecure('username', email); - await Util.sendTextToElementByIdSecure('password', psw); - await Util.clickElementById('signin-button'); - if (await Util.waitForPageIgnoreError(this.TEST_RP_WARNING)) { - await Util.clickElementByName(this.TEST_RP_CONTINUE); - } - await Util.waitForPage('userinfo'); - Util.logInfo(await browser.driver.getCurrentUrl()); - } - - static async useGoogle(email: string, psw: string): Promise { - if (!await Util.clickElementByLinkTextIgnoreError('Google')) { - await Util.clickElementByLinkText('Sign in with Google'); - } - // Input Email - await Util.waitForPage('accounts.google.com/o/oauth2/'); - await Util.sendTextToElementByIdSecure('identifierId', email); - // Click next btn - await Util.clickElementById('identifierNext'); - await Util.waitForPage('accounts.google.com/signin/v2/challenge'); - await Util.waitForElementToBeClickableById('password'); - await Util.sendTextToElementByNameWithoutLogging('password', psw); - await Util.clickElementById('passwordNext'); - if (await Util.waitForPageIgnoreError(this.TEST_RP_WARNING)) { - await Util.clickElementByName(this.TEST_RP_CONTINUE); - } - await Util.waitForPage('userinfo'); - } - - static async useUni(email: string, psw: string): Promise { - Util.logInfo(await browser.driver.getPageSource()); - await Util.waitForPresenceOfElementById('query'); - await Util.sendTextToElementByIdUnsecure('query', 'Bielefeld'); - await element(by.linkText('University of Bielefeld')).click(); - await Util.waitForElementToBeClickableById('password'); - await Util.sendTextToElementByIdSecure('username', email); - await Util.sendTextToElementByIdSecure('password', psw); - await Util.clickElementByName('_eventId_proceed'); - await Util.waitForPage('execution=e1s2'); - await Util.clickElementByName('_eventId_proceed'); - if (await Util.waitForPageIgnoreError(this.TEST_RP_WARNING)) { - await Util.clickElementByName(this.TEST_RP_CONTINUE); - } - await Util.waitForPage('userinfo'); - } - - static async logOut(): Promise { - Util.logInfo('Restarting browser'); - await browser.restart(); - await browser.waitForAngularEnabled(false); - await browser.manage().window().setSize(browser.params.width, browser.params.height); - } - -} diff --git a/e2e/page_objects/new_cluster.po.ts b/e2e/page_objects/new_cluster.po.ts deleted file mode 100644 index 446394234f..0000000000 --- a/e2e/page_objects/new_cluster.po.ts +++ /dev/null @@ -1,75 +0,0 @@ -import { browser, by, element } from 'protractor'; -import { Util } from '../util'; - -export class NewClusterPage { - private static NEW_CLUSTER_URL: string = 'virtualmachines/newCluster'; - private static PROJECT_SELECT_ID: string = 'projectSelect'; - private static PROJECT_NAME: string = `id_option_${Util.SIMPLE_VM_APPLICATION_NAME}`; - private static MASTER_FLAVOR_ID: string = 'master_id_flavor_detail'; - private static MASTER_IMAGE_ID: string = 'master_id_image_detail'; - private static FLAVOR_PREFIX: string = 'id_flavor_owl_'; - private static IMAGE_PREFIX: string = 'id_image_owl_'; - private static SELECTED_BATCH_WORKER_FLAVOR_SELECTION = 'selected_batch_id_flavor_detail'; - private static SELECTED_BATCH_WORKER_COUNT: string = 'workerInstancesCount_1'; - private static START_BUTTON: string = 'startClusterButton'; - private static NEW_CLUSTER_ID_FIELD: string = 'new_cluster_id'; - private static INFO_MODAL: string = 'info_modal'; - private static RESPONSIBILITY_CONFIRMATION: string = 'cluster_responsibility'; - - static async navigateToNewClusterPage(): Promise { - Util.logInfo(`Navigating to: ${this.NEW_CLUSTER_URL}`); - await Util.navigateToAngularPage(this.NEW_CLUSTER_URL); - - return await Util.waitForPage(this.NEW_CLUSTER_URL); - } - - static async chooseProject(): Promise { - await Util.waitForPresenceOfElementById('application_form'); - await browser.sleep(15000); - if (await Util.isElementPresentById('singleProjectNameSpan')) { - Util.logInfo('Single Project automatically selected'); - } else { - await Util.waitForPresenceOfElementById(this.PROJECT_SELECT_ID); - await Util.waitForElementToBeClickableById(this.PROJECT_SELECT_ID); - Util.logInfo('Getting option from select'); - await Util.clickOptionOfSelect(this.PROJECT_NAME, this.PROJECT_SELECT_ID); - } - } - - static async fillBasicForm(): Promise { - Util.logInfo('Fill new instance basic form'); - - await this.fillMandatoryFormWith(Util.DEFAULT_FLAVOR_NAME, Util.UBUNTU_18_TITLE); - } - - static async fillMandatoryFormWith(flavor: string, image: string, worker_count: string = '2'): Promise { - Util.logInfo('Fill new cluster mandatory form'); - - await Util.waitForPresenceOfElementById(this.MASTER_FLAVOR_ID); - await element(by.id(this.MASTER_FLAVOR_ID)).element(by.id(`${this.FLAVOR_PREFIX}${flavor}`)).click(); - await Util.waitForPresenceOfElementById(this.MASTER_IMAGE_ID); - await element(by.id(this.MASTER_IMAGE_ID)).element(by.id(`${this.IMAGE_PREFIX}${image}`)).click(); - await browser.sleep(5000); - await Util.waitForPresenceOfElementById(this.SELECTED_BATCH_WORKER_FLAVOR_SELECTION); - await element(by.id(this.SELECTED_BATCH_WORKER_FLAVOR_SELECTION)).element(by.id(`${this.FLAVOR_PREFIX}${flavor}`)).click(); - await Util.waitForPresenceOfElementById(this.SELECTED_BATCH_WORKER_COUNT); - await Util.sendTextToElementByIdUnsecure(this.SELECTED_BATCH_WORKER_COUNT, worker_count); - await Util.clickElementById(this.RESPONSIBILITY_CONFIRMATION); - } - - static async submitAndStartCluster(): Promise { - Util.logInfo('Submit and start Cluster'); - - await Util.waitForElementToBeClickableById(this.START_BUTTON); - await Util.clickElementById(this.START_BUTTON); - - return await this.getClusterName(); - } - - static async getClusterName(): Promise { - await Util.waitForPresenceOfElementById(this.INFO_MODAL); - await Util.waitForPresenceOfElementById(this.NEW_CLUSTER_ID_FIELD); - - return await element(by.id(this.NEW_CLUSTER_ID_FIELD)).getText(); - } -} diff --git a/e2e/page_objects/new_instance.po.ts b/e2e/page_objects/new_instance.po.ts deleted file mode 100644 index 533a707e20..0000000000 --- a/e2e/page_objects/new_instance.po.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { browser, by, element } from 'protractor'; -import { Util } from '../util'; - -/** - * New Instance Page. - */ -export class NewInstancePage { - private static NEW_INSTANCE_URL: string = 'virtualmachines/newVM'; - private static PROJECT_SELECT_ID: string = 'projectSelect'; - private static PROJECT_NAME: string = `id_option_${Util.SIMPLE_VM_APPLICATION_NAME}`; - private static BASIC_VM_NAME: string = Util.BASIC_VM_NAME; - private static REDIRECT_MODAL: string = 'redirect_modal'; - private static NEW_INSTANCE_NAME_SPAN: string = 'new_vm_name'; - private static VOLUME_VM_NAME: string = Util.VOLUME_VM_NAME; - private static ID_INSTANCE_NAME: string = 'id_instance_name'; - private static START_BUTTON: string = 'startVMButton'; - private static OVERVIEW_BUTTON: string = 'goToOverviewButton'; - private static FLAVOR_ID: string = 'id_flavor_detail'; - private static IMAGE_ID: string = 'id_image_detail'; - private static FLAVOR_PREFIX: string = 'id_flavor_owl_'; - private static IMAGE_PREFIX: string = 'id_image_owl_'; - private static VOLUME_NAME_ID: string = 'volume_name'; - private static VOLUME_MOUNT_PATH_ID: string = 'volume_mount_path'; - private static VOLUME_SPACE_ID: string = 'volume_space'; - private static VOLUME_SPACE: string = '1'; - private static CLOSE_INFO_MODAL: string = 'close_info_modal'; - private static OPTIONAL_ACCORDION: string = 'optional_accordion'; - private static HOW_TO_CONNECT: string = 'how_to_connect_id'; - private static HTC_VM_NAME: string = 'instance_name'; - private static VM_RESPONSIBILITY: string = 'vm_responsibility'; - private static ADD_VOLUME_FORM_BUTTON: string = 'openAddVolumeFormButton'; - private static ADD_VOLUME_CONFIRMATION_BUTTON: string = 'addVolumeConfirmationButton'; - - static async getNewInstanceTab(): Promise { - Util.logInfo('Navigating to New Instance Tab'); - await Util.navigateToAngularPage(this.NEW_INSTANCE_URL); - - return await Util.waitForPage(this.NEW_INSTANCE_URL); - } - - static async chooseProject(): Promise { - await Util.waitForPresenceOfElementById('application_form'); - await browser.sleep(15000); - if (await Util.isElementPresentById('singleProjectNameSpan')) { - Util.logInfo('Single Project automatically selected'); - } else { - await Util.waitForPresenceOfElementById(this.PROJECT_SELECT_ID); - await Util.waitForElementToBeClickableById(this.PROJECT_SELECT_ID); - Util.logInfo('Getting option from select'); - await Util.clickOptionOfSelect(this.PROJECT_NAME, this.PROJECT_SELECT_ID); - } - } - - static async fillBasicForm(name: string = this.BASIC_VM_NAME): Promise { - Util.logInfo('Fill new instance basic form'); - - await this.fillMandatoryFormWith(name, Util.DEFAULT_FLAVOR_NAME, Util.UBUNTU_18_TITLE); - } - - static async fillBasicVolumeForm(): Promise { - Util.logInfo('Fill new instance basic volume form'); - - await this.fillMandatoryFormWith(this.VOLUME_VM_NAME, Util.DEFAULT_FLAVOR_NAME, Util.UBUNTU_18_TITLE); - } - - static async fillMandatoryFormWith(instance_name: string, flavor: string, image: string): Promise { - Util.logInfo('Fill new instance mandatory form'); - - await Util.waitForPresenceOfElementById(this.ID_INSTANCE_NAME); - await Util.sendTextToElementByIdUnsecure(this.ID_INSTANCE_NAME, instance_name); - await Util.waitForPresenceOfElementById(this.FLAVOR_ID); - await element(by.id(this.FLAVOR_ID)).element(by.id(`${this.FLAVOR_PREFIX}${flavor}`)).click(); - await Util.waitForPresenceOfElementById(this.IMAGE_ID); - await element(by.id(this.IMAGE_ID)).element(by.id(`${this.IMAGE_PREFIX}${image}`)).click(); - await Util.clickElementById(this.VM_RESPONSIBILITY); - } - - static async submitAndStartVM(): Promise { - Util.logInfo('Submit and start VM'); - - await Util.waitForElementToBeClickableById(this.START_BUTTON); - await Util.clickElementById(this.START_BUTTON); - // await Util.waitForPage('/virtualmachines/vmOverview') - } - - static async waitForConfirmation(): Promise { - return await Util.waitForPresenceOfElementById(this.OVERVIEW_BUTTON); - } - - static async isRedirectModalPresent(): Promise { - return await Util.waitForPresenceOfElementById(this.REDIRECT_MODAL); - } - - static async setVolume(): Promise { - Util.logInfo('Set Volume'); - - await Util.clickElementById(this.ADD_VOLUME_FORM_BUTTON); - Util.logInfo('Setting Volume name'); - await Util.sendTextToElementByIdUnsecure(this.VOLUME_NAME_ID, Util.VOLUME_NAME); - Util.logInfo('Setting Volume mount path'); - await Util.sendTextToElementByIdUnsecure(this.VOLUME_MOUNT_PATH_ID, Util.VOLUME_MOUNT_PATH_STRING); - - Util.logInfo('Setting Volume space'); - await Util.sendTextToElementByIdUnsecure(this.VOLUME_SPACE_ID, this.VOLUME_SPACE); - await Util.clickElementById(this.ADD_VOLUME_CONFIRMATION_BUTTON); - } - - static async closeInfoModal(): Promise { - await Util.clickElementById(this.CLOSE_INFO_MODAL); - } - - static async getVMName(): Promise { - await Util.waitForPresenceOfElementById(this.REDIRECT_MODAL); - await Util.waitForPresenceOfElementById(this.NEW_INSTANCE_NAME_SPAN); - - return await element(by.id(this.NEW_INSTANCE_NAME_SPAN)).getAttribute('textContent'); - } - -} diff --git a/e2e/page_objects/profile_page.po.ts b/e2e/page_objects/profile_page.po.ts deleted file mode 100644 index 8dcd21ce35..0000000000 --- a/e2e/page_objects/profile_page.po.ts +++ /dev/null @@ -1,57 +0,0 @@ -// eslint-disable-next-line @typescript-eslint/no-unused-vars,import/no-extraneous-dependencies -import { browser, by, element } from 'protractor'; -import { Util } from '../util'; - -/** - * New Instance Page. - */ -export class ProfilePage { - private static OPEN_GENERATE_KEY_BUTTON: string = 'generateSShKey'; - private static GENERATE_KEY_CHECKBOX: string = 'generate_checkbox'; - private static GENERATE_KEY_BUTTON: string = 'set_new_ssh_key_button'; - private static USER_PUBLIC_KEY_FIELD: string = 'user_public_key'; - private static ENTER_PUBLIC_KEY_AREA: string = 'public_key_enter_area'; - private static OPEN_SET_KEY_BUTTON: string = 'setPublicKeyButton'; - private static SET_NEW_PUBLIC_KEY_BUTTON: string = 'set_new_public_key_button'; - // eslint-disable-next-line max-len - private static TEST_PUBLIC_KEY: string = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCnkSQ+DSg1Ro6Nk56L6nEzYwTbRzH//8dJOVDFDV1ZKMKDMphOOdYVqcm4JjVmvTqFKAdWldMbdJVa5vGysjiyfad86o+thsSQ7I5aFF5vr3+YaK5NJPssqMi/ElV4pjH0e3Z/r+Y61ZT/9in8jY5z4uWk/sMyW8Q5F2qXcd5IcDUWNMHndDl5jCMgL275HUfAGrimSTukSTPkkVY3UqSo9NppagK31fXLsR2Cajg+NGlmYqZa6ySkp0ydJV9sVDKHMFDty1TLuNMtnT4XMeIwtA+nTvPUU2akx1OsM4HeQq7nQ2r5GKRt/6K9sypEuX/zkmzMhm9IIF7etqBoV8kfNlO7hijjvmbEOxd6C53yOF7xpT4XzZzYF35TC7Gk+GMOIvrnRqrATkDBV9hLRYzQKUUfAGrIo4jH7m2DadppjRVAF679UhSWtksPx3vtTNVV/Dh/WnJmHgniDEAr6IBvMeaUVFvEdCD5506VYpIXj5ckObVJyTaTkQSf1+PxE+E='; - - static async generateNewKeyPair(): Promise { - Util.logInfo('Opening the Generate Key modal'); - await Util.waitForPresenceOfElementById(this.OPEN_GENERATE_KEY_BUTTON); - await Util.clickElementById(this.OPEN_GENERATE_KEY_BUTTON); - Util.logInfo('Confirming effects of generating a new Key'); - await Util.waitForPresenceOfElementById(this.GENERATE_KEY_CHECKBOX); - await Util.clickElementById(this.GENERATE_KEY_CHECKBOX); - Util.logInfo('Clicking on Set-Button'); - await Util.waitForPresenceOfElementById(this.GENERATE_KEY_BUTTON); - await Util.clickElementById(this.GENERATE_KEY_BUTTON); - await browser.sleep(5000); - await Util.waitForPresenceOfElementById(this.USER_PUBLIC_KEY_FIELD); - await browser.sleep(5000); - - // eslint-disable-next-line no-return-await - return await Util.getElemTextById(this.USER_PUBLIC_KEY_FIELD); - } - - static async setNewPublicKey(): Promise { - Util.logInfo('Opening the Set Key modal.'); - await Util.waitForPresenceOfElementById(this.OPEN_SET_KEY_BUTTON); - await Util.clickElementById(this.OPEN_SET_KEY_BUTTON); - Util.logInfo('Copying public key into textfield.'); - await Util.waitForPresenceOfElementById(this.ENTER_PUBLIC_KEY_AREA); - await Util.sendTextToElementByIdUnsecure(this.ENTER_PUBLIC_KEY_AREA, this.TEST_PUBLIC_KEY); - Util.logInfo('Clicking on Set-Button'); - await Util.waitForPresenceOfElementById(this.SET_NEW_PUBLIC_KEY_BUTTON); - await Util.clickElementById(this.SET_NEW_PUBLIC_KEY_BUTTON); - await browser.sleep(5000); - - // eslint-disable-next-line no-return-await - return await Util.getElemTextById(this.USER_PUBLIC_KEY_FIELD); - } - - static async getPublicKeySet(): Promise { - // eslint-disable-next-line no-return-await - return await Util.getElemTextById(this.USER_PUBLIC_KEY_FIELD); - } -} diff --git a/e2e/page_objects/project_overview.po.ts b/e2e/page_objects/project_overview.po.ts deleted file mode 100644 index 9ac8bd5b09..0000000000 --- a/e2e/page_objects/project_overview.po.ts +++ /dev/null @@ -1,247 +0,0 @@ -import { browser } from 'protractor'; -import { Util } from '../util'; - -/** - * Project Overview page. - */ -export class ProjectOverview { - - private static PI_USER_TAB: string = 'pi_user_tab'; - private static PI_EMAIL_FIELD: string = 'id_pi_email'; - private static VALIDATION_HASH: string = 'validation_hash'; - private static INFORMATION_TAB: string = 'information_tab'; - private static ADD_MEMBER_BTN_MODAL: string = 'add_member_btn_modal'; - private static SEARCH_MEMBER: string = 'add_member_input'; - private static DEFAULT_MEMBER_EMAIL: string = 'testuserdenbi'; - private static DEFAULT_MEMBER: string = 'Test User'; - private static ADD_MEMBER_BTN: string = 'add_member_btn'; - private static SEARCH_MEMBER_BTN: string = 'search_member_btn'; - private static SUCCESS: string = 'Success'; - private static REMOVE_MEMBER_PREFIX: string = 'remove_member_'; - private static NOTIFICATION_TITLE: string = 'notification_title'; - private static NOTIFICATION_CLOSE: string = 'close_notification'; - private static CLOSE_ADD_MEMBER_MODAL_BTN: string = 'close_add_user_modal_btn'; - private static MODIFICATION_REQUEST_RESULT: string = 'extension_result_submitted'; - private static MODIFICATION_REQUEST_SUCCESS_TEXT: string = 'Modification request successfully submitted!'; - private static EXTENSION_REQUEST_SUCCESS_TEXT: string = 'Lifetime extension request successfully submitted!'; - private static DENBI_DEFAULT_OLD_ID: string = 'de.NBI default_old'; - private static DENBI_DEFAULT_NEW_INPUT: string = 'de.NBI default'; - private static OLD_VOLUME_COUNTER_ID: string = 'project_application_volume_counter'; - private static NEW_VOLUME_COUNTER_ID: string = 'id_project_application_renewal_volume_counter'; - private static OLD_VOLUME_LIMIT_ID: string = 'project_application_volume_limit'; - private static NEW_VOLUME_LIMIT_ID: string = 'id_project_application_renewal_volume_limit'; - private static OLD_OBJECT_STORAGE_ID: string = 'project_application_object_storage'; - private static NEW_OBJECT_STORAGE_ID: string = 'id_project_application_renewal_object_storage'; - private static TOTAL_RAM: string = 'total_ram_label'; - private static TOTAL_CORES: string = 'total_cores_label'; - private static BIOINFORMATICS_TOPIC: string = 'topic_Bioinformatics'; - private static SHOW_INFORMATION_BTN: string = 'show_information_btn'; - private static SUBMITTED_SHOW_INFORMATION_BTN: string = 'submitted_show_information_btn'; - private static DISSEMINATION_PLATFORM_LIST: string = 'dissemination_platforms'; - private static DISSEMINATION_INFORMATION_LIST: string = 'dissemination_information'; - // eslint-disable-next-line max-len - private static DEFAULT_INFORMATION_DISSEMINATION_STRING: string = 'Title, Research Topics, Description, Resources, Lifetime, Project Type, Name of PI, Institution, Workgroup, Project affiliation'; - private static DEFAULT_PLATFORM_DISSEMINATION_STRING: string = 'de.NBI Platforms, Twitter'; - private static PI_ROW: string = 'id_pi_row'; - private static REMOVE_APPLICATION_BUTTON: string = 'remove_application_button'; - private static REMOVE_APPLICATION_MODAL: string = 'remove_application_modal'; - private static CONFIRM_REMOVE_APPLICATION_BUTTON: string = 'confirm_remove_application_button'; - private static MODIFICATION_REQUEST_BUTTON: string = 'show_modification_extension_button'; - private static NO_DOI_BUTTON: string = 'no_new_dois_btn'; - private static SUBMIT_MODIFICATION_BUTTON: string = 'submit_modification_btn'; - private static CONFIRM_MODIFICATION_BUTTON: string = 'confirm_modification_btn'; - private static SHOW_DOI_MODAL: string = 'show_doi_question_modal'; - private static EXTENSION_LIFETIME_INPUT: string = 'temp_project_extension_application_renewal_lifetime'; - private static SUBMIT_EXTENSION_BUTTON: string = 'submit_extension_btn'; - private static CONFIRM_EXTENSION_BUTTON: string = 'confirm_extension_btn'; - private static PROJECT_LIST_FOLDED: string = 'project_list_folded'; - private static PROJECT_LIST_FOLDED_TOGGLER: string = 'project_list_folded_toggler'; - private static PROJECT_LIST: string = 'project_list'; - private static EXTENSION_REQUEST_RESULT: string = 'extension_result_submitted'; - - static async navigateToSimpleProjectverview(): Promise { - Util.logInfo('Navigating to simple project overview'); - await browser.sleep(5000); - if (await Util.isElementPresentById(this.PROJECT_LIST_FOLDED)) { - await this.navigateToSimpleProjectoverviewByProjectsThenByClick(); - } else { - await this.navigateToSimpleProjectoverviewByClick(); - } - } - - static async navigateToSimpleProjectoverviewByClick(): Promise { - await Util.clickElementById(Util.SIMPLE_VM_APPLICATION_NAME); - } - - static async navigateToSimpleProjectoverviewByProjectsThenByClick(): Promise { - await Util.clickElementById(this.PROJECT_LIST_FOLDED_TOGGLER); - await Util.clickElementById(Util.SIMPLE_VM_APPLICATION_NAME); - } - - static async navigateToPIApproval(): Promise { - Util.logInfo('Navigating to Approval of PI'); - await Util.clickElementById(this.INFORMATION_TAB); - await Util.waitForPresenceOfElementById(this.VALIDATION_HASH); - await Util.clickElementById(this.VALIDATION_HASH); - } - - static async checkForPIApproval(): Promise { - Util.logInfo('Checking if PI-Mail is present'); - await Util.waitForPresenceOfElementById(this.SUBMITTED_SHOW_INFORMATION_BTN); - await Util.clickElementById(this.SUBMITTED_SHOW_INFORMATION_BTN); - await Util.waitForPresenceOfElementById(this.PI_USER_TAB); - await Util.clickElementById(this.PI_USER_TAB); - await Util.waitForPresenceOfElementById(this.PI_EMAIL_FIELD); - const piMail: string = await Util.getElemTextById(this.PI_EMAIL_FIELD); - - return !!(typeof (piMail) !== 'undefined' && piMail); - } - - static async navigateToOpenStackeProjectverview(): Promise { - Util.logInfo('Navigating to openstack project overview'); - await browser.sleep(5000); - if (await Util.isElementPresentById(this.PROJECT_LIST_FOLDED)) { - await this.navigateToOpenstackProjectoverviewByProjectsThenByClick(); - } else { - await this.navigateToOpenstackProjectoverviewByClick(); - } - } - - static async navigateToOpenstackProjectoverviewByClick(): Promise { - await Util.clickElementById(Util.OPENSTACK_APPLICATION_NAME); - } - - static async navigateToOpenstackProjectoverviewByProjectsThenByClick(): Promise { - await Util.clickElementById(this.PROJECT_LIST_FOLDED_TOGGLER); - await Util.clickElementById(Util.OPENSTACK_APPLICATION_NAME); - } - - static async isDisseminationSet(): Promise { - Util.logInfo('Check if dissemination is set'); - await Util.waitForTextPresenceInElementById(this.DISSEMINATION_INFORMATION_LIST, this.DEFAULT_INFORMATION_DISSEMINATION_STRING); - await Util.waitForTextPresenceInElementById(this.DISSEMINATION_PLATFORM_LIST, this.DEFAULT_PLATFORM_DISSEMINATION_STRING); - } - - static async hasPi(): Promise { - Util.logInfo('Check if pi is set'); - await Util.clickElementById(this.SUBMITTED_SHOW_INFORMATION_BTN); - - return await Util.waitForAbsenceOfElementById(this.PI_ROW); - - } - - static async copyPIHash(): Promise { - await Util.waitForPresenceOfElementById(this.INFORMATION_TAB); - await Util.clickElementById(this.INFORMATION_TAB); - await Util.waitForPresenceOfElementById(this.VALIDATION_HASH); - - return await Util.getElemTextById(this.VALIDATION_HASH); - - } - - static async addMemberToProject(application_name: string, member: string = this.DEFAULT_MEMBER_EMAIL): Promise { - Util.logInfo('Open add member modal'); - await Util.clickElementById(this.ADD_MEMBER_BTN_MODAL); - await Util.sendTextToElementByIdUnsecure(this.SEARCH_MEMBER, member); - await Util.clickElementById(this.SEARCH_MEMBER_BTN); - await Util.clickElementById(this.ADD_MEMBER_BTN); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_TITLE, this.SUCCESS); - Util.logInfo('Close Modal'); - await Util.clickElementById(this.NOTIFICATION_CLOSE); - await Util.clickElementById(this.CLOSE_ADD_MEMBER_MODAL_BTN); - await browser.sleep(1000); - - } - - static async removeMemberFromProject(application_name: string, member: string = this.DEFAULT_MEMBER): Promise { - await Util.clickElementById(this.REMOVE_MEMBER_PREFIX + member); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_TITLE, this.SUCCESS); - Util.logInfo('Close Modal'); - - await Util.clickElementById(this.NOTIFICATION_CLOSE); - await browser.sleep(1000); - - } - - static async openModificationModal(appication_name: string): Promise { - await Util.waitForPresenceOfElementById(this.MODIFICATION_REQUEST_BUTTON); - await Util.clickElementById(this.MODIFICATION_REQUEST_BUTTON); - } - - static async openExtensionModal(application_Name: string): Promise { - await Util.waitForPresenceOfElementById(this.SHOW_DOI_MODAL); - await Util.clickElementById(this.SHOW_DOI_MODAL); - await Util.waitForPresenceOfElementById(this.NO_DOI_BUTTON); - await Util.clickElementById(this.NO_DOI_BUTTON); - } - - static async sendModificationRequest(application_name: string): Promise { - await Util.waitForPresenceOfElementById(this.SUBMIT_MODIFICATION_BUTTON); - await Util.clickElementById(this.SUBMIT_MODIFICATION_BUTTON); - await Util.waitForPresenceOfElementById(this.CONFIRM_MODIFICATION_BUTTON); - await Util.clickElementById(this.CONFIRM_MODIFICATION_BUTTON); - await Util.waitForTextPresenceInElementById(this.MODIFICATION_REQUEST_RESULT, this.MODIFICATION_REQUEST_SUCCESS_TEXT); - } - - static async sendExtensionRequest(application_name: string): Promise { - await Util.waitForPresenceOfElementById(this.SUBMIT_EXTENSION_BUTTON); - await Util.clickElementById(this.SUBMIT_EXTENSION_BUTTON); - await Util.waitForPresenceOfElementById(this.CONFIRM_EXTENSION_BUTTON); - await Util.clickElementById(this.CONFIRM_EXTENSION_BUTTON); - await Util.waitForTextPresenceInElementById(this.EXTENSION_REQUEST_RESULT, this.EXTENSION_REQUEST_SUCCESS_TEXT); - } - - static async isBioinformaticsSet(): Promise { - await Util.clickElementById(this.SUBMITTED_SHOW_INFORMATION_BTN); - await Util.clickElementById(this.INFORMATION_TAB); - await Util.waitForPresenceOfElementById(this.BIOINFORMATICS_TOPIC); - } - - static async areDefaultValuesSetSimpleVM(): Promise { - await Util.checkInputsByIdsGotSameValue(this.DENBI_DEFAULT_OLD_ID, this.DENBI_DEFAULT_NEW_INPUT); - await Util.checkInputsByIdsGotSameValue(this.OLD_VOLUME_COUNTER_ID, this.NEW_VOLUME_COUNTER_ID); - await Util.checkInputsByIdsGotSameValue(this.OLD_VOLUME_LIMIT_ID, this.NEW_VOLUME_LIMIT_ID); - - } - - static async areDefaultValuesSetOpenstack(): Promise { - await Util.checkInputsByIdsGotSameValue(this.DENBI_DEFAULT_OLD_ID, this.DENBI_DEFAULT_NEW_INPUT); - await Util.checkInputsByIdsGotSameValue(this.OLD_VOLUME_COUNTER_ID, this.NEW_VOLUME_COUNTER_ID); - await Util.checkInputsByIdsGotSameValue(this.OLD_VOLUME_LIMIT_ID, this.NEW_VOLUME_LIMIT_ID); - await Util.checkInputsByIdsGotSameValue(this.OLD_OBJECT_STORAGE_ID, this.NEW_OBJECT_STORAGE_ID); - - } - - static async checkTotalCoresRam(): Promise { - Util.logInfo('Check cores and ram'); - const counter: string = await Util.getInputValueById(this.DENBI_DEFAULT_NEW_INPUT); - const cores: string = await Util.getElemTextById(`${this.DENBI_DEFAULT_NEW_INPUT}_cores`); - const ram: string = await Util.getElemTextById(`${this.DENBI_DEFAULT_NEW_INPUT}_ram`); - const total_ram: number = parseInt(await Util.getElemTextById(this.TOTAL_RAM), 10); - const total_cores: number = parseInt(await Util.getElemTextById(this.TOTAL_CORES), 10); - const total_cores_calc: number = parseInt(cores, 10) * parseInt(counter, 10); - const total_ram_calc: number = parseInt(ram, 10) * parseInt(counter, 10); - expect(total_ram).toEqual(total_ram_calc); - expect(total_cores_calc).toEqual(total_cores); - - } - - static async fillModificationRequest(): Promise { - await Util.sendTextToElementByIdUnsecure(this.DENBI_DEFAULT_NEW_INPUT, '5'); - await Util.sendTextToElementByIdUnsecure(this.NEW_VOLUME_COUNTER_ID, '1'); - await Util.sendTextToElementByIdUnsecure(this.NEW_VOLUME_LIMIT_ID, '1'); - await Util.sendTextToElementByIdUnsecure('id_project_application_renewal_comment', 'This is a Protrector test modification!'); - } - - static async fillExtensionRequest(): Promise { - await Util.waitForPresenceOfElementById(this.EXTENSION_LIFETIME_INPUT); - await Util.sendTextToElementByIdUnsecure(this.EXTENSION_LIFETIME_INPUT, '3'); - } - - static async removeApplication(): Promise { - await Util.clickElementById(this.REMOVE_APPLICATION_BUTTON); - await Util.waitForPresenceOfElementById(this.REMOVE_APPLICATION_MODAL); - await Util.clickElementById(this.CONFIRM_REMOVE_APPLICATION_BUTTON); - } - -} diff --git a/e2e/page_objects/vm_detail.po.ts b/e2e/page_objects/vm_detail.po.ts deleted file mode 100644 index 2166cad065..0000000000 --- a/e2e/page_objects/vm_detail.po.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { Util } from '../util'; - -/** - * Instance Detail Page. - */ -export class VMDetailPage { - - private VM_NAME: string; - private VM_DETAIL_URL: string = 'virtualmachines/detail/'; - private VM_DETAIL_FULL_URL: string; - - private ACTIVE_BADGE_PREFIX: string = 'active_badge_'; - private SHUTOFF_BADGE_PREFIX: string = 'shutoff_badge_'; - - private VERIFY_STOP_BTN: string = 'verifyStopButton'; - private VERIFY_RESTART_BTN: string = 'verifyRestartButton'; - - private SHUTOFF_BUTTON: string = 'stopVMButton'; - private RESUME_BUTTON: string = 'restartVMButton'; - private DELETE_BUTTON: string = 'deleteVMButton'; - private SNAPSHOT_BUTTON: string = 'createSnapshotVMButton'; - - private STOP_MODAL: string = 'stop_modal'; - private SHUTOFF_SUCCESS: string = 'stop_success_div'; - private CLOSE_STOP_MODAL: string = 'close_stop_modal'; - - private RESUME_MODAL: string = 'resume_modal'; - private RESUME_SUCCESS: string = 'resume_success_div'; - private CLOSE_RESUME_MODAL: string = 'close_resume_modal'; - - private SNAPSHOT_NAME_MODAL: string = 'snapshot_name_modal'; - private SNAPSHOT_NAME_INPUT: string = 'snapshot_name_input'; - private SNAPSHOT_CREATE_BUTTON: string = 'snapshot_create_modal_button'; - private SNAPSHOT_RESULT_MODAL: string = 'snapshot_result_modal'; - private SNAPSHOT_DONE_DIV: string = 'snapshot_done'; - private CLOSE_SNAPSHOT_RESULT_BUTTON: string = 'snapshot_result_modal_close'; - - private VERIFY_MODAL: string = 'verify_modal'; - private CONFIRM_DELETE_BUTTON: string = 'confirm_delete_button'; - private DELETED_BADGE_PREFIX: string = 'deleted_badge_'; - private CLOSE_DELETE_MODAL: string = 'close_delete_modal'; - private VERIFY_RESTART_MODAL: string = 'submitRestartModal'; - private SUBMIT_STOP_MODAL: string = 'submitStopVmModal'; - - async setBasicVMName(name: string): Promise { - Util.logInfo(`Setting basic vm name as ${name}`); - this.VM_NAME = name; - } - - getVmName(): string { - return this.VM_NAME; - } - - async stopBasicVM(): Promise { - Util.logInfo(`Stopping Basic vm ${this.VM_NAME}`); - await Util.waitForElementToBeClickableById(this.SHUTOFF_BUTTON); - await Util.clickElementById(this.SHUTOFF_BUTTON); - await Util.waitForElementToBeClickableById(this.VERIFY_STOP_BTN); - await Util.clickElementById(this.VERIFY_STOP_BTN); - await Util.waitForPresenceOfElementById(this.SHUTOFF_SUCCESS, Util.MIN_TIMEOUT_15); - await Util.clickElementById(this.CLOSE_STOP_MODAL); - await Util.waitForPresenceOfElementById(this.SHUTOFF_BADGE_PREFIX + this.VM_NAME); - - Util.logInfo('Stopping of Basic VM completed'); - } - - async restartBasicVM(): Promise { - Util.logInfo('Restarting basic VM'); - await Util.clickElementById(this.RESUME_BUTTON); - await Util.waitForElementToBeClickableById(this.VERIFY_RESTART_BTN); - await Util.clickElementById(this.VERIFY_RESTART_BTN); - await Util.waitForPresenceOfElementById(this.RESUME_SUCCESS, Util.MIN_TIMEOUT_15); - await Util.clickElementById(this.CLOSE_RESUME_MODAL); - await Util.waitForPresenceOfElementById(this.ACTIVE_BADGE_PREFIX + this.VM_NAME); - Util.logInfo('Restarting of Basic VM completed'); - - } - - async createSnapshotBasicVM(): Promise { - Util.logInfo('Creating Snapshot of basic VM'); - await Util.waitForElementToBeClickableById(this.SNAPSHOT_BUTTON); - await Util.clickElementById(this.SNAPSHOT_BUTTON); - await Util.waitForPresenceOfElementById(this.SNAPSHOT_NAME_MODAL); - await Util.sendTextToElementByIdUnsecure(this.SNAPSHOT_NAME_INPUT, Util.ALTERNATIVE_SNAPSHOT_NAME); - await Util.clickElementById(this.SNAPSHOT_CREATE_BUTTON); - await Util.waitForPresenceOfElementById(this.SNAPSHOT_DONE_DIV); - await Util.clickElementById(this.CLOSE_SNAPSHOT_RESULT_BUTTON); - Util.logInfo('Creating of Snapshot finished'); - - } - - async deleteBasicVM(): Promise { - Util.logInfo('Deleting Basic VM'); - await Util.waitForElementToBeClickableById(this.DELETE_BUTTON); - await Util.clickElementById(this.DELETE_BUTTON); - await Util.waitForElementToBeClickableById(this.CONFIRM_DELETE_BUTTON); - await Util.clickElementById(this.CONFIRM_DELETE_BUTTON); - await Util.waitForPresenceOfElementById(`${this.DELETED_BADGE_PREFIX}${this.VM_NAME}`, Util.MIN_TIMEOUT_15); - Util.logInfo('Deleting of Basic VM finished'); - } -} diff --git a/e2e/page_objects/vm_overview.po.ts b/e2e/page_objects/vm_overview.po.ts deleted file mode 100644 index e71f17e4e6..0000000000 --- a/e2e/page_objects/vm_overview.po.ts +++ /dev/null @@ -1,283 +0,0 @@ -import { browser, by, element } from 'protractor'; -import { Util } from '../util'; - -/** - * Instance Overview Page. - */ -export class VMOverviewPage { - - private VM_OVERVIEW_URL: string = 'virtualmachines/vmOverview'; - private TABLE_ID: string = 'vm_overview_table'; - private SHOW_ACTIONS_PREFIX: string = 'showActionsButton_'; - private ACTIVE_BADGE_PREFIX: string = 'active_badge_'; - private SHUTOFF_BADGE_PREFIX: string = 'shutoff_badge_'; - private DELETED_BADGE_PREFIX: string = 'deleted_badge_'; - private CHECKBOX_DELETED: string = 'checkbox_deleted'; - private VERIFY_STOP_BTN: string = 'verifyStopButton'; - private VERIFY_RESTART_BTN: string = 'verifyRestartButton'; - private DETAIL_PRE: string = 'showDetailsButton_'; - private DETAIL_LINK: string = 'detail_'; - - private SHUTOFF_BUTTON_PREFIX: string = 'stopVMButton_'; - private RESUME_BUTTON_PREFIX: string = 'restartVMButton_'; - private DELETE_BUTTON_PREFIX: string = 'deleteVMButton_'; - private SNAPSHOT_BUTTON_PREFIX: string = 'createSnapshotVMButton_'; - - private SNAPSHOT_NAME_MODAL: string = 'snapshot_name_modal'; - private SNAPSHOT_NAME_INPUT: string = 'snapshot_name_input'; - private SNAPSHOT_CREATE_BUTTON: string = 'snapshot_create_modal_button'; - private SNAPSHOT_RESULT_MODAL: string = 'snapshot_result_modal'; - private SNAPSHOT_DONE_DIV: string = 'snapshot_done'; - private CLOSE_SNAPSHOT_RESULT_BUTTON: string = 'snapshot_result_modal_close'; - - private VERIFY_MODAL: string = 'verify_modal'; - private CONFIRM_DELETE_BUTTON: string = 'confirm_delete_button'; - - private VERIFY_RESTART_MODAL: string = 'submitRestartModal'; - private SUBMIT_STOP_MODAL: string = 'submitStopVmModal'; - - private BASIC_VM_NAME_KEY: string = 'basic_vm_name'; - private VOLUME_VM_NAME_KEY: string = 'volume_vm_name'; - private static vm_names: { [key: string]: string } = {}; - private static name_counter: number = 0; - - async navigateToOverview(): Promise { - Util.logInfo('Navigating to VM Overview Page'); - await Util.navigateToAngularPage(this.VM_OVERVIEW_URL); - await Util.waitForPage(this.VM_OVERVIEW_URL); - - return await browser.driver.sleep(10000); - } - - static async getAllWorkshopMachines(): Promise { - return Util.getTextFromElementsByIdPrefix(`detail_${Util.WORKSHOP_NAME}`); - } - - static async logVmNames(): Promise { - Util.logInfo(`Name_Counter: ${VMOverviewPage.name_counter}`); - - Util.logInfo('VM Names:'); - for (const key in VMOverviewPage.vm_names) { - const val: any = VMOverviewPage.vm_names[key]; - console.log(`\tKey: ${key} Value: ${val}`); - - } - } - - async setBasicVMName(name: string): Promise { - Util.logInfo(`Setting basic vm name as ${name}`); - VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY] = name; - VMOverviewPage.name_counter += 1; - await VMOverviewPage.logVmNames(); - - } - - async setVolumeVMName(name: string): Promise { - Util.logInfo(`Setting volume vm name as ${name}`); - VMOverviewPage.vm_names[this.VOLUME_VM_NAME_KEY] = name; - VMOverviewPage.name_counter += 1; - await VMOverviewPage.logVmNames(); - - } - - async isVmActive(name: string): Promise { - Util.logInfo(`Checking if ${name} is active`); - await Util.waitForPresenceOfElementById(this.TABLE_ID); - - return await Util.waitForPresenceOfElementById(`${this.ACTIVE_BADGE_PREFIX}${name}`, Util.MIN_TIMEOUT_15); - } - - async isBasicVMActive(): Promise { - return await this.isVmActive(VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]); - } - - async areAllVMActive(): Promise { - Util.logInfo(`Checking active for ${VMOverviewPage.name_counter} active vm`); - - for (const key in VMOverviewPage.vm_names) { - if (key in VMOverviewPage.vm_names) { - const val: any = VMOverviewPage.vm_names[key]; - console.log(`Key: ${key} Value: ${val}`); - if (!await this.isVmActive(val)) { - return false; - } - } - } - - return true; - } - - async isVMShutoff(name: string): Promise { - Util.logInfo(`Checking if ${name} is shutoff`); - await Util.waitForPresenceOfElementById(this.TABLE_ID); - - return await Util.waitForPresenceOfElementById(`${this.SHUTOFF_BADGE_PREFIX}${name}`, Util.MIN_TIMEOUT_15); - } - - async isBasicVMShutoff(): Promise { - return await this.isVMShutoff(VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]); - } - - async showDeleted(): Promise { - console.log('Showing all deleted VM'); - await Util.clickElementById(this.CHECKBOX_DELETED); - } - - async isVMDeleted(name: string): Promise { - Util.logInfo(`Checking if ${name} is deleted`); - - await Util.waitForPresenceOfElementById(this.TABLE_ID); - - return await Util.waitForPresenceOfElementById(`${this.DELETED_BADGE_PREFIX}${name}`); - } - - async isBasicVMDeleted(): Promise { - return await this.isVMDeleted(VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]); - } - - async isVolumeVMDeleted(): Promise { - return await this.isVMDeleted(VMOverviewPage.vm_names[this.VOLUME_VM_NAME_KEY]); - } - - async shutoffVM(name: string): Promise { - Util.logInfo(`Shutting off ${name}`); - await Util.waitForPresenceOfElementById(`${this.ACTIVE_BADGE_PREFIX}${name}`); - await Util.clickElementById(`${this.SHOW_ACTIONS_PREFIX}${name}`); - await Util.clickElementById(`${this.SHUTOFF_BUTTON_PREFIX}${name}`); - await Util.waitForPresenceOfElementById(this.SUBMIT_STOP_MODAL); - await Util.clickElementById(this.VERIFY_STOP_BTN); - await browser.sleep(1000); - - Util.logInfo(`Shutoff method for ${name} completed`); - } - - async shutOffBasicVM(): Promise { - return await this.shutoffVM(VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]); - } - - async resumeVM(name: string): Promise { - Util.logInfo(`Resume vm ${name}`); - await Util.waitForPresenceOfElementById(`${this.SHUTOFF_BADGE_PREFIX}${name}`); - await Util.clickElementById(`${this.SHOW_ACTIONS_PREFIX}${name}`); - await Util.clickElementById(`${this.RESUME_BUTTON_PREFIX}${name}`); - await Util.waitForPresenceOfElementById(this.VERIFY_RESTART_MODAL); - await Util.clickElementById(this.VERIFY_RESTART_BTN); - await browser.sleep(1000); - Util.logInfo(`Resuming method for ${name} completed`); - } - - async resumeBasicVM(): Promise { - return await this.resumeVM(VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]); - } - - async getBasicVMName(): Promise { - if (VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]) { - return VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]; - } else { - return ''; - } - } - - async getNewBasicVMName(): Promise { - return await Util.getTextFromLinkElement(this.DETAIL_LINK, Util.BASIC_VM_NAME); - - } - - async getNewVolumeVMName(): Promise { - return await Util.getTextFromLinkElement(this.DETAIL_LINK, Util.VOLUME_VM_NAME); - - } - - async getVolumeVMName(): Promise { - if (VMOverviewPage.vm_names[this.VOLUME_VM_NAME_KEY]) { - return VMOverviewPage.vm_names[this.VOLUME_VM_NAME_KEY]; - } else { - return ''; - } - } - - static async removeNameFromVmNames(key_or_val: string): Promise { - Util.logInfo(`Check to remove ${key_or_val} from vm names`); - if (key_or_val in VMOverviewPage.vm_names) { - delete VMOverviewPage.vm_names[key_or_val]; - VMOverviewPage.name_counter -= 1; - await VMOverviewPage.logVmNames(); - - return; - - } else { - for (const key in VMOverviewPage.vm_names) { - const val: any = VMOverviewPage.vm_names[key]; - if (val === key_or_val) { - delete VMOverviewPage.vm_names[key]; - VMOverviewPage.name_counter -= 1; - Util.logInfo(`Removed ${key}:${val} from vm_names`); - await VMOverviewPage.logVmNames(); - - return; - } - - } - } - await VMOverviewPage.logVmNames(); - - Util.logInfo(`${key_or_val} not found in vm_names`); - - } - - async deleteVM(name: string): Promise { - Util.logInfo(`Deleting ${name}`); - if (element(by.id(`${this.SHOW_ACTIONS_PREFIX}${name}`)).isPresent()) { - await Util.clickElementById(`${this.SHOW_ACTIONS_PREFIX}${name}`); - } - - await Util.clickElementById(`${this.DELETE_BUTTON_PREFIX}${name}`); - await Util.waitForPresenceOfElementById(this.VERIFY_MODAL); - await Util.clickElementById(this.CONFIRM_DELETE_BUTTON); - await Util.waitForPresenceOfElementById(`${this.DELETED_BADGE_PREFIX}${name}`, Util.MIN_TIMEOUT_15); - Util.logInfo(`Remove ${name} from vm list `); - await VMOverviewPage.removeNameFromVmNames(name); - - Util.logInfo(`Deletion method for ${name} completed`); - } - - async deleteBasicVM(): Promise { - return await this.deleteVM(VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]); - } - - async deleteVolumeVM(): Promise { - return await this.deleteVM(VMOverviewPage.vm_names[this.VOLUME_VM_NAME_KEY]); - } - - async createSnapshotOfVM(name: string): Promise { - Util.logInfo(`Creating snapshot of ${name}`); - - if (element(by.id(`${this.SHOW_ACTIONS_PREFIX}${name}`)).isPresent()) { - await Util.clickElementById(`${this.SHOW_ACTIONS_PREFIX}${name}`); - } - await Util.clickElementById(`${this.SNAPSHOT_BUTTON_PREFIX}${name}`); - await Util.waitForPresenceOfElementById(this.SNAPSHOT_NAME_MODAL); - await Util.sendTextToElementByIdUnsecure(this.SNAPSHOT_NAME_INPUT, Util.BASIC_SNAPSHOT_NAME); - await Util.clickElementById(this.SNAPSHOT_CREATE_BUTTON); - await this.isVmActive(name); - // await Util.waitForPresenceOfElementById(this.SNAPSHOT_RESULT_MODAL); - // await Util.waitForPresenceOfElementById(this.SNAPSHOT_DONE_DIV); - // await Util.clickElementById(this.CLOSE_SNAPSHOT_RESULT_BUTTON); - Util.logInfo(`Creating snapshot method for ${name} completed`); - } - - async createSnapshotOfBasicVM(): Promise { - return await this.createSnapshotOfVM(VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]); - - } - - async goToVmDetail(): Promise { - const vm_name: string = await this.getBasicVMName(); - - await this.isVmActive(vm_name); - Util.logInfo(`Going to VM Detail page for ${VMOverviewPage.vm_names[this.BASIC_VM_NAME_KEY]}`); - - return await Util.clickElementById(`${this.DETAIL_LINK}${vm_name}`); - } - -} diff --git a/e2e/page_objects/vm_snapshot.po.ts b/e2e/page_objects/vm_snapshot.po.ts deleted file mode 100644 index 0a5f061271..0000000000 --- a/e2e/page_objects/vm_snapshot.po.ts +++ /dev/null @@ -1,76 +0,0 @@ -import {browser} from 'protractor'; -import {Util} from '../util'; - -/** - * Snapshot Overview page. - */ -export class SnapshotOverviewPage { - - private static SNAPSHOT_OVERVIEW_URL: string = 'virtualmachines/snapshotOverview'; - private static TABLE_ID: string = 'snapshot_table'; - private static SNAPSHOT_ACTIVE_PREFIX: string = 'snapshot_active_'; - private static DELETE_BUTTON_PREFIX: string = 'delete_button_'; - private static DELETE_MODAL: string = 'delete_modal'; - private static DELETE_SUCCESS: string = 'delete_success'; - private static CLOSE_DELETE_MODAL: string = 'close_delete_modal'; - private static VERIFY_MODAL: string = 'verify_modal'; - private static CONFIRM_DELETE: string = 'confirm_delete_button'; - - static async navigateToSnapshotOverview(): Promise { - Util.logInfo('Navigating to Snapshot Overview Page'); - await Util.navigateToAngularPage(this.SNAPSHOT_OVERVIEW_URL); - await Util.waitForPage(this.SNAPSHOT_OVERVIEW_URL); - - return await browser.driver.sleep(10000); - } - - static async isSnapshotDeleted(name: string): Promise { - Util.logInfo(`Checking if snapshot ${name} is absent`); - await Util.waitForPresenceOfElementById(this.TABLE_ID, 10000); - - return await Util.waitForAbsenceOfElementById(name); - } - - static async isBasicSnapshotDeleted(): Promise { - return await this.isSnapshotDeleted(Util.BASIC_SNAPSHOT_NAME); - } - - static async isSnapshotPresent(name: string): Promise { - Util.logInfo(`Checking if snapshot ${name} is present`); - await Util.waitForPresenceOfElementById(this.TABLE_ID, 10000); - - return await Util.waitForPresenceOfElementById(name); - } - - static async isBasicSnapshotPresent(): Promise { - return await this.isSnapshotPresent(Util.BASIC_SNAPSHOT_NAME); - } - - static async isSnapshotActive(name: string): Promise { - Util.logInfo(`Checking if snapshot ${name} is active`); - await Util.waitForPresenceOfElementById(this.TABLE_ID, 1000000); - - return await Util.waitForPresenceOfElementById(`${this.SNAPSHOT_ACTIVE_PREFIX}${name}`, Util.MIN_TIMEOUT_15); - } - - static async isBasicSnapshotActive(): Promise { - return await this.isSnapshotActive(Util.BASIC_SNAPSHOT_NAME); - } - - static async deleteSnapshot(name: string): Promise { - Util.logInfo(`Deleting snapshot ${name}`); - await Util.waitForPresenceOfElementById(this.TABLE_ID); - await Util.clickElementById(`${this.DELETE_BUTTON_PREFIX}${name}`); - await Util.waitForPresenceOfElementById(this.VERIFY_MODAL); - await Util.clickElementById(this.CONFIRM_DELETE); - await Util.waitForPresenceOfElementById(this.DELETE_MODAL); - await Util.waitForPresenceOfElementById(this.DELETE_SUCCESS); - await Util.clickElementById(this.CLOSE_DELETE_MODAL); - - return await Util.waitForInvisibilityOfElementById(this.DELETE_MODAL); - } - - static async deleteBasicSnapshot(): Promise { - await this.deleteSnapshot(Util.BASIC_SNAPSHOT_NAME); - } -} diff --git a/e2e/page_objects/vo_overview.po.ts b/e2e/page_objects/vo_overview.po.ts deleted file mode 100644 index 138b715090..0000000000 --- a/e2e/page_objects/vo_overview.po.ts +++ /dev/null @@ -1,52 +0,0 @@ -import { - browser, -} from 'protractor'; -import { Util } from '../util'; - -/** - * Vo Overview Page. - */ -export class VoOverviewPage { - - private static VO_OVERVIEW_URL: string = 'vo-manager/overview'; - private static FILTER_PROJECT_NAME_INPUT: string = 'filter_project_name'; - private static SHOW_TERMINATE_PREFIX: string = 'show_terminate_'; - private static TERMINATE_PROJECT_BTN: string = 'terminate_project_btn'; - private static NOTIFICATION_MESSAGE: string = 'notification_message'; - private static CLOSE_NOTIFICATION_BTN: string = 'close_notification'; - private static PROJECT_TERMINATED_MESSAGE: string = 'The project was terminated.'; - private static TERMINATE_BUTTON_TEXT: string = 'Terminate Project'; - private static NOTIFICATION_MODAL_TITLE: string = 'notification_modal_title'; - private static SUCCESS: string = 'Success'; - - static async navigateToVolumeOverview(): Promise { - Util.logInfo('Navigating to vo overview'); - await Util.navigateToAngularPage(this.VO_OVERVIEW_URL); - } - - static async filterForPTProjets(): Promise { - Util.logInfo('Filter for PT Projects'); - await Util.sendTextToElementByIdUnsecure(this.FILTER_PROJECT_NAME_INPUT, 'PT'); - await browser.sleep(2000); - } - - static async terminateAllPTProjects(): Promise { - Util.logInfo('Terminate all PT projects'); - const elements: any = await Util.getElementsByIdPrefix(this.SHOW_TERMINATE_PREFIX); - for (const ele of elements) { - // eslint-disable-next-line no-await-in-loop - await this.terminateProject(ele); - } - } - - static async terminateProject(terminateBtnId: Element): Promise { - Util.logInfo(`Terminate Project ${terminateBtnId}`); - - await Util.clickElementByElement(terminateBtnId); - await Util.clickElementById(this.TERMINATE_PROJECT_BTN); - await Util.waitForTextPresenceInElementById(this.NOTIFICATION_MODAL_TITLE, this.SUCCESS); - await Util.clickElementById(this.CLOSE_NOTIFICATION_BTN); - - } - -} diff --git a/e2e/page_objects/volume_overview.po.ts b/e2e/page_objects/volume_overview.po.ts deleted file mode 100644 index 54f49a9400..0000000000 --- a/e2e/page_objects/volume_overview.po.ts +++ /dev/null @@ -1,86 +0,0 @@ -import {browser} from 'protractor'; -import {Util} from '../util'; - -/** - * Volume Overview Page. - */ -export class VolumeOverviewPage { - - private static VOLUME_OVERVIEW_URL: string = 'virtualmachines/volumeOverview'; - private static CREATE_ATTACH_BUTTON: string = 'create_attach_button'; - - private static TABLE_ID: string = 'volume_table_body'; - private static VOLUME_NAME_CELL_ID_PREFIX: string = 'cell_name_id_'; - private static VOLUME_DELETED_STATUS_BADE_PRE: string = 'deleted_badge_' - private static VM_NAME_CELL_ID_PREFIX: string = 'cell_vm_id_'; - private static VM_CELL_FREE_ID: string = 'cell_vm_free_id'; - private static DELETE_BUTTON_PREFIX: string = 'delete_button_'; - private static VERIFY_MODAL: string = 'verify_modal'; - private static VERIFY_DELETION_BUTTON: string = 'verify_deletion_button'; - - private static RESULT_MODAL: string = 'result_modal'; - private static SUCCESS_CA_DIV: string = 'successfully_created_attached_div'; - private static SUCCESS_DELETED_DIV: string = 'successfully_deleted_div'; - private static CLOSE_RESULT_MODAL: string = 'close_result_modal'; - - private static CREATE_MODAL: string = 'create_modal'; - private static PROJECT_SELECT_ID: string = 'select_project_id'; - private static OPTION_PROJECT_PREFIX: string = 'project_option_'; - private static VM_SELECT_ID: string = 'select_vm_id'; - private static OPTION_VM_PREFIX: string = 'vm_option_'; - private static NAME_INPUT_ID: string = 'name_input_id'; - private static SPACE_INPUT_ID: string = 'space_input_id'; - private static VERIFY_CA_BUTTON: string = 'verify_create_attach_button'; - - static async navigateToVolumeOverview(): Promise { - Util.logInfo('Navigating to volume overview'); - await Util.navigateToAngularPage(this.VOLUME_OVERVIEW_URL); - } - - static async isVolumePresent(): Promise { - return await Util.waitForPresenceOfElementById(`${this.VOLUME_NAME_CELL_ID_PREFIX}${Util.VOLUME_NAME}`); - } - - static async deleteVolume(): Promise { - Util.logInfo('Deleting Volume'); - await Util.clickElementById(this.DELETE_BUTTON_PREFIX + Util.VOLUME_NAME); - await Util.waitForVisibilityOfElementById(this.VERIFY_MODAL); - await Util.clickElementById(this.VERIFY_DELETION_BUTTON); - } - - static async createAndAttachVolumeToProjectVm(vm: string): Promise { - Util.logInfo(` creating and attach volume to project: ${Util.SIMPLE_VM_APPLICATION_NAME} vm: ${vm}`); - - await Util.clickElementById(this.CREATE_ATTACH_BUTTON); - await Util.waitForVisibilityOfElementById(this.CREATE_MODAL); - await Util.clickOptionOfSelect(`${this.OPTION_PROJECT_PREFIX}${Util.SIMPLE_VM_APPLICATION_NAME}`, this.PROJECT_SELECT_ID); - await browser.sleep(2000).then().catch(); - await Util.waitForPresenceOfElementById(this.VM_SELECT_ID); - await Util.clickOptionOfSelect(`${this.OPTION_VM_PREFIX}${vm}`, this.VM_SELECT_ID); - await Util.sendTextToElementByIdUnsecure(this.NAME_INPUT_ID, Util.VOLUME_NAME); - await Util.sendTextToElementByIdUnsecure(this.SPACE_INPUT_ID, Util.VOLUME_SPACE); - await Util.clickElementById(this.VERIFY_CA_BUTTON); - - Util.logInfo(' creating and attaching probably successful'); - } - - static async isVolumeDeleted(): Promise { - await Util.waitForPresenceOfElementById(this.TABLE_ID); - - return Util.waitForPresenceOfElementById(`${this.VOLUME_DELETED_STATUS_BADE_PRE}${Util.VOLUME_NAME}`) - - } - - static async isVolumeAttachedToVM(name: string): Promise { - Util.logInfo(` checking if volume attached to ${name}`); - - return await Util.waitForPresenceOfElementById(`${this.VM_NAME_CELL_ID_PREFIX}${name}`); - } - - static async isVolumeFree(): Promise { - Util.logInfo(` checking if volume is free`); - - return await Util.waitForPresenceOfElementById(`available_${Util.VOLUME_NAME}`); - - } -} diff --git a/e2e/page_objects/workshop_overview.po.ts b/e2e/page_objects/workshop_overview.po.ts deleted file mode 100644 index f4e841bef7..0000000000 --- a/e2e/page_objects/workshop_overview.po.ts +++ /dev/null @@ -1,154 +0,0 @@ -import { browser } from 'protractor'; -import { Util } from '../util'; - -/** - * Workshop Overview Page. - */ -export class WorkshopOverviewPage { - private static WORKSHOP_OVERVIEW_URL: string = 'virtualmachines/workshopOverview'; - private static PROJECTS_EXISTING: string = 'projectsExisting'; - private static PROJECT_SELECT: string = 'projectSelect'; - private static PROJECT_OPTION: string = `project_option_${Util.SIMPLE_VM_APPLICATION_NAME}`; - private static NEW_WORKSHOP_BUTTON: string = 'new_workshop_button_id'; - private static CREATE_WORKSHOP_BUTTON: string = 'create_workshop_button_id'; - private static CREATION_STATUS_MODAL: string = 'creation_status_modal'; - private static CREATION_STATUS_MESSAGE_FIELD: string = 'creation_status_message'; - private static SUCCESS_ALERT: string = 'creation_success'; - private static ERROR_ALERT: string = 'creation_failure' - private static CLOSE_CEATION_STATUS_MODAL: string = 'close_creation_status_modal'; - private static LONGNAME_FIELD: string = 'workshop_longname'; - private static SHORTNAME_FIELD: string = 'workshop_shortname'; - private static WORKSHOP_OPTION: string = `select_workshop_${Util.WORKSHOP_NAME}_btn`; - private static USER_NAME_FIELD_PREFIX: string = 'user_name_field_prefix_'; - private static CLEANUP_WORKSHOP_BUTTON: string = 'cleanup_workshop_button_id'; - private static VERIFY_CLEANUP_MODAL: string = 'verify_delete_modal'; - private static VERIFY_CLEANUP_BUTTON: string = 'confirm_delete_workshop_button'; - private static DELETE_STATUS_MODAL: string = 'delete_status_modal'; - private static DELETE_SUCCESS: string = 'delete_success_id'; - private static CLOSE_DELETION_STATUS_MODAL: string = 'close_deletion_status'; - private static VM_NAME_PREFIX: string = 'vm_name_'; - private static RESENV_URL_PREFIX: string = 'resenv_url_'; - - static async navigateToOverview(): Promise { - Util.logInfo('Navigating to Workshop Overview Page'); - await Util.navigateToAngularPage(this.WORKSHOP_OVERVIEW_URL); - await Util.waitForPage(this.WORKSHOP_OVERVIEW_URL); - - return browser.driver.sleep(10000); - } - - static async selectProject(): Promise { - await Util.waitForPresenceOfElementById(this.PROJECTS_EXISTING); - Util.logInfo(`Selecting project ${this.PROJECT_OPTION}`); - await Util.waitForPresenceOfElementById(this.PROJECT_SELECT); - await Util.waitForElementToBeClickableById(this.PROJECT_SELECT); - Util.logInfo('Getting option from select'); - await Util.clickOptionOfSelect(this.PROJECT_OPTION, this.PROJECT_SELECT); - } - - static async createNewWorkshop(): Promise { - Util.logInfo(`Creating Workshop ${Util.WORKSHOP_NAME}`); - await Util.waitForPresenceOfElementById(this.NEW_WORKSHOP_BUTTON); - await Util.waitForElementToBeClickableById(this.NEW_WORKSHOP_BUTTON); - await Util.clickElementById(this.NEW_WORKSHOP_BUTTON); - - await Util.waitForPresenceOfElementById(this.LONGNAME_FIELD); - await Util.sendTextToElementByIdUnsecure(this.LONGNAME_FIELD, Util.WORKSHOP_NAME); - - await Util.waitForPresenceOfElementById(this.SHORTNAME_FIELD); - await Util.sendTextToElementByIdUnsecure(this.SHORTNAME_FIELD, Util.WORKSHOP_NAME); - - await Util.clickElementById(this.CREATE_WORKSHOP_BUTTON); - } - - static async newWorkshopSuccess(): Promise { - Util.logInfo(`Checking success for new Workshop ${Util.WORKSHOP_NAME}`); - await Util.waitForPresenceOfElementById(this.CREATION_STATUS_MODAL); - await Util.waitForPresenceOfElementById(this.CREATION_STATUS_MESSAGE_FIELD); - - return Util.waitForPresenceOfElementById(this.SUCCESS_ALERT); - } - - static async newWorkshopError(): Promise { - Util.logInfo(`Checking error for new Workshop ${Util.WORKSHOP_NAME}`); - await Util.waitForPresenceOfElementById(this.CREATION_STATUS_MODAL); - await Util.waitForPresenceOfElementById(this.CREATION_STATUS_MESSAGE_FIELD); - - return Util.waitForPresenceOfElementById(this.ERROR_ALERT); - } - - static async workshopHasUser(): Promise { - Util.logInfo(`Checking if user ${Util.VO_ACCOUNT_ELIXIR_ID} exists for Workshop ${Util.WORKSHOP_NAME}`); - await this.selectWorkshop(); - - return Util.waitForPresenceOfElementById(`${this.USER_NAME_FIELD_PREFIX}${Util.VO_ACCOUNT_ELIXIR_ID}`); - } - - static async workshopHasAdmin(): Promise { - Util.logInfo(`Checking if admin ${Util.USER_ACCOUNT_ELIXIR_ID} exists for Workshop ${Util.WORKSHOP_NAME}`); - await this.selectWorkshop(); - - return Util.waitForPresenceOfElementById(`${this.USER_NAME_FIELD_PREFIX}${Util.USER_ACCOUNT_ELIXIR_ID}`); - } - - static async deleteWorkshop(): Promise { - Util.logInfo(`Deleting Workshop ${Util.WORKSHOP_NAME}`); - await this.selectWorkshop(); - await Util.waitForPresenceOfElementById(this.CLEANUP_WORKSHOP_BUTTON); - await Util.waitForElementToBeClickableById(this.CLEANUP_WORKSHOP_BUTTON); - await Util.clickElementById(this.CLEANUP_WORKSHOP_BUTTON); - await Util.waitForPresenceOfElementById(this.VERIFY_CLEANUP_MODAL); - await Util.waitForPresenceOfElementById(this.VERIFY_CLEANUP_BUTTON); - await Util.waitForElementToBeClickableById(this.VERIFY_CLEANUP_BUTTON); - await Util.clickElementById(this.VERIFY_CLEANUP_BUTTON); - await Util.waitForPresenceOfElementById(this.DELETE_STATUS_MODAL); - - return Util.waitForPresenceOfElementById(this.DELETE_SUCCESS); - } - - static async selectWorkshop(): Promise { - Util.logInfo(`Selecting Workshop ${Util.WORKSHOP_NAME}`); - await Util.waitForElementToBeClickableById(this.WORKSHOP_OPTION); - await Util.clickElementById(this.WORKSHOP_OPTION); - } - - static async workshopHasVms(): Promise { - const vmNames: string[] = []; - vmNames.push(await this.getVmOfUser(Util.USER_ACCOUNT_ELIXIR_ID)); - vmNames.push(await this.getVmOfUser(Util.VO_ACCOUNT_ELIXIR_ID)); - - return vmNames; - } - - static async getResenvUrlOfUser(): Promise { - return this.getResEnvUrlOfVm( - await this.getVmOfUser(Util.VO_ACCOUNT_ELIXIR_ID), - ); - } - - static async getResenvUrlOfAdmin(): Promise { - return this.getResEnvUrlOfVm( - await this.getVmOfUser(Util.USER_ACCOUNT_ELIXIR_ID), - ); - } - - static async getVmOfUser(elixirId: string): Promise { - return Util.getElemTextById(`${this.VM_NAME_PREFIX}${elixirId}`); - } - - static async getResEnvUrlOfVm(vmName: string): Promise { - return Util.getElemTextById(`${this.RESENV_URL_PREFIX}${vmName}`); - } - - static async closeCreationStatusModal(): Promise { - await Util.waitForPresenceOfElementById(this.CLOSE_CEATION_STATUS_MODAL); - await Util.waitForElementToBeClickableById(this.CLOSE_CEATION_STATUS_MODAL); - await Util.clickElementById(this.CLOSE_CEATION_STATUS_MODAL); - } - - static async closeWorkshopCleanupModal(): Promise { - await Util.waitForPresenceOfElementById(this.CLOSE_DELETION_STATUS_MODAL); - await Util.waitForElementToBeClickableById(this.CLOSE_DELETION_STATUS_MODAL); - await Util.clickElementById(this.CLOSE_DELETION_STATUS_MODAL); - } -} diff --git a/e2e/page_objects/workshop_vm.po.ts b/e2e/page_objects/workshop_vm.po.ts deleted file mode 100644 index 659ad1707f..0000000000 --- a/e2e/page_objects/workshop_vm.po.ts +++ /dev/null @@ -1,81 +0,0 @@ -import { browser, by, element } from 'protractor'; -import { Util } from '../util'; - -/** - * Workshop vm page - */ -export class WorkshopVMPage { - private static WORKSHOP_VM_URL: string = 'virtualmachines/newWorkshop'; - private static PROJECTS_EXISTING: string = 'projectsExisting'; - private static PROJECT_SELECT: string = 'projectSelect'; - private static PROJECT_OPTION: string = `project_option_${Util.SIMPLE_VM_APPLICATION_NAME}`; - private static WORKSHOP_OPTION: string = `workshop_option_${Util.WORKSHOP_NAME}`; - private static FLAVOR_ID: string = 'id_flavor_detail'; - private static FLAVOR_PREFIX: string = 'id_flavor_owl_'; - private static IMAGE_ID: string = 'id_image_detail'; - private static IMAGE_PREFIX: string = 'id_image_owl_'; - private static RESENV_ID: string = 'id_resenv'; - private static RESENV_PREFIX: string = 'id_template_owl_'; - private static ADD_USER_PREFIX: string = 'add_user_'; - private static ANSIBLE_OKAY_CHECKBOX: string = 'ansible_need_okay'; - private static RESPONSIBILITY_CHECKBOX: string = 'vm_responsibility'; - private static START_VMS_BUTTON: string = 'startVMButton'; - private static REDIRECT_MODAL: string = 'redirect_modal'; - - static async navigateToAddWorkshopVm(): Promise { - Util.logInfo('Navigating to Workshop new VM Page'); - await Util.navigateToAngularPage(this.WORKSHOP_VM_URL); - await Util.waitForPage(this.WORKSHOP_VM_URL); - - return browser.driver.sleep(10000); - } - - static async selectProject(): Promise { - await Util.waitForPresenceOfElementById(this.PROJECTS_EXISTING); - Util.logInfo(`Selecting project ${this.PROJECT_OPTION}`); - await Util.waitForPresenceOfElementById(this.PROJECT_SELECT); - await Util.waitForElementToBeClickableById(this.PROJECT_SELECT); - Util.logInfo('Getting option from select'); - await Util.clickOptionOfSelect(this.PROJECT_OPTION, this.PROJECT_SELECT); - } - - static async selectWorkshop(): Promise { - await Util.waitForElementToBeClickableById(this.WORKSHOP_OPTION); - await Util.clickElementById(this.WORKSHOP_OPTION); - } - - static async startVMsForUserAndAdmin(): Promise { - await this.fillForm( - Util.DEFAULT_FLAVOR_NAME, - Util.UBUNTU_18_TITLE, - Util.CWLAB, - [Util.USER_ACCOUNT_ELIXIR_ID, Util.VO_ACCOUNT_ELIXIR_ID], - ); - } - - static async isRedirectModalPresent(): Promise { - return Util.waitForPresenceOfElementById(this.REDIRECT_MODAL); - } - - static async fillForm(flavor: string, image: string, resenv: string, userElixirIds: string[]): Promise { - await Util.waitForPresenceOfElementById(this.FLAVOR_ID); - await element(by.id(this.FLAVOR_ID)).element(by.id(`${this.FLAVOR_PREFIX}${flavor}`)).click(); - await Util.waitForPresenceOfElementById(this.IMAGE_ID); - await element(by.id(this.IMAGE_ID)).element(by.id(`${this.IMAGE_PREFIX}${image}`)).click(); - await Util.waitForPresenceOfElementById(this.RESENV_ID); - await element(by.id(this.RESENV_ID)).element(by.id(`${this.RESENV_PREFIX}${resenv}`)).click(); - for (const userElixirId of userElixirIds) { - // eslint-disable-next-line no-await-in-loop - await Util.waitForPresenceOfElementById(`${this.ADD_USER_PREFIX}${userElixirId}`); - // eslint-disable-next-line no-await-in-loop - await Util.clickElementById(`${this.ADD_USER_PREFIX}${userElixirId}`); - } - await Util.waitForElementToBeClickableById(this.ANSIBLE_OKAY_CHECKBOX); - await Util.clickElementById(this.ANSIBLE_OKAY_CHECKBOX); - await Util.waitForElementToBeClickableById(this.RESPONSIBILITY_CHECKBOX); - await Util.clickElementById(this.RESPONSIBILITY_CHECKBOX); - await Util.waitForElementToBeClickableById(this.START_VMS_BUTTON); - await Util.clickElementById(this.START_VMS_BUTTON); - } - -} diff --git a/e2e/protractor.conf.js b/e2e/protractor.conf.js deleted file mode 100644 index bac49115e3..0000000000 --- a/e2e/protractor.conf.js +++ /dev/null @@ -1,205 +0,0 @@ -// Protractor configuration file, see link for more information -// https://github.com/angular/protractor/blob/master/lib/config.ts -var DisplayProcessor = require('jasmine-spec-reporter').DisplayProcessor; -const {SpecReporter} = require('jasmine-spec-reporter'); -const HtmlReporter = require('protractor-beautiful-reporter'); -const log4jsGen = require('./log4jsGen'); -const DescribeFailureReporter = require('protractor-stop-describe-on-failure'); - -const fs = require('fs'); -let rawdata = fs.readFileSync('e2e/environment.json'); -let credentials = JSON.parse(rawdata); - - -function LogInterceptor(configuration, theme) { -} - - -LogInterceptor.prototype = new DisplayProcessor(); - -LogInterceptor.prototype.displaySuite = function (suite, log) { - log4jsGen.getLogger().info(log); - return log; -}; - -LogInterceptor.prototype.displaySuccessfulSpec = function (spec, log) { - log4jsGen.getLogger().info(log); - - return log; -}; - -LogInterceptor.prototype.displayFailedSpec = function (spec, log) { - log4jsGen.getLogger().error(log); - - return log; -}; - -LogInterceptor.prototype.displayPendingSpec = function (spec, log) { - log4jsGen.getLogger().info(log); - - return log; -}; - -LogInterceptor.prototype.displaySummaryErrorMessages = function (spec, log) { - log4jsGen.getLogger().error(log); - - return log; -}; - -LogInterceptor.prototype.displaySpecErrorMessages = function (spec, log) { - log4jsGen.getLogger().error(log); - - return log; -}; - - -exports.config = { - seleniumAddress: 'http://localhost:4444/wd/hub', - params: { - portal: credentials['portal'], - angular: credentials['angular'], - width: credentials["browser_w"], - height: credentials["browser_h"], - login: { - email_user: credentials['email_user'], - password_user: credentials['password_user'], - elixir_id_user: credentials['elixir_id_user'], - email_fm: credentials['email_fm'], - password_fm: credentials['password_fm'], - email_vo: credentials['email_vo'], - password_vo: credentials['password_vo'], - elixir_id_vo: credentials['elixir_id_vo'], - auth_user: credentials['auth_user'], - auth_fm: credentials['auth_fm'], - auth_vo: credentials['auth_vo'] - } - }, - suites: { - pub_key: ['tests/public_key_test.ts', - ], - simple_vm_application: [ - 'tests/terminate_all_pt.ts', - 'tests/public_key_test.ts', - 'tests/simple_vm_application_test.ts', - 'tests/simple_vm_approval_test.ts', - 'tests/member_test.ts', - 'tests/simple_vm_modification_test.ts', - 'tests/simple_vm_application_modification_approval.ts', - 'tests/simple_vm_extension_test.ts', - 'tests/simple_vm_extension_approval_test.ts', - 'tests/simple_vm_no_pi_test.ts', - 'tests/terminate_all_pt_after.ts', - ], - simple_vm_cluster: [ - 'tests/terminate_all_pt.ts', - 'tests/public_key_test.ts', - 'tests/simple_vm_application_test.ts', - 'tests/simple_vm_approval_test.ts', - 'tests/cluster_tests.ts', - 'tests/terminate_all_pt_after.ts', - ], - simple_vm_vms: [ - 'tests/terminate_all_pt.ts', - 'tests/public_key_test.ts', - 'tests/simple_vm_application_test.ts', - 'tests/simple_vm_approval_test.ts', - 'tests/virtual_machine_tests.ts', - 'tests/terminate_all_pt_after.ts', - ], - simple_vm_full: [ - 'tests/terminate_all_pt.ts', - 'tests/public_key_test.ts', - 'tests/simple_vm_application_test.ts', - 'tests/simple_vm_approval_test.ts', - 'tests/member_test.ts', - 'tests/simple_vm_modification_test.ts', - 'tests/simple_vm_application_modification_approval.ts', - 'tests/simple_vm_extension_test.ts', - 'tests/simple_vm_extension_approval_test.ts', - 'tests/simple_vm_no_pi_test.ts', - 'tests/cluster_tests.ts', - 'tests/virtual_machine_tests.ts', - 'tests/terminate_all_pt_after.ts', - ], - cloud_application: [ - 'tests/terminate_all_pt.ts', - 'tests/cloud_application_test.ts', - 'tests/cloud_application_approval_test.ts', - 'tests/cloud_application_modification_test.ts', - 'tests/cloud_modification_approval_test.ts', - 'tests/terminate_all_pt_after.ts', - ], - all: [ - 'tests/terminate_all_pt.ts', - 'tests/public_key_test.ts', - 'tests/simple_vm_application_test.ts', - 'tests/simple_vm_approval_test.ts', - 'tests/member_test.ts', - 'tests/simple_vm_modification_test.ts', - 'tests/simple_vm_application_modification_approval.ts', - 'tests/simple_vm_extension_test.ts', - 'tests/simple_vm_extension_approval_test.ts', - 'tests/simple_vm_no_pi_test.ts', - 'tests/cloud_application_test.ts', - 'tests/cloud_application_approval_test.ts', - 'tests/cloud_application_modification_test.ts', - 'tests/cloud_modification_approval_test.ts', - 'tests/cluster_tests.ts', - 'tests/virtual_machine_tests.ts', - 'tests/create_workshop_test.ts', - 'tests/start_workshop_vms_test.ts', - 'tests/terminate_all_workshops_test.ts', - 'tests/terminate_all_pt_after.ts', - ] - }, - - allScriptsTimeout: 11000, - - capabilities: { - browserName: 'chrome', - acceptInsecureCerts: true, - chromeOptions: { - args: ["--incognito", "--ignore-certificate-errors", '--headless', '--disable-gpu'] - //args: ["--incognito", "--ignore-certificate-errors"] - - } - }, - directConnect: true, //uncomment on macOS, also start webserver via webdriver-manager - framework: 'jasmine', - jasmineNodeOpts: { - showColors: true, - defaultTimeoutInterval: 1800000, - print: function () { - } - }, - beforeLaunch: function () { - require('ts-node').register({ - project: 'e2e/tsconfig.e2e.json' - }); - - - }, - onPrepare() { - jasmine.getEnv().addReporter(new HtmlReporter({ - baseDirectory: 'test_results/report', - screenshotsSubfolder: 'screenshots', - jsonsSubfolder: 'jsons', - gatherBrowserLogs: true, - preserveDirectory: false - }).getJasmine2Reporter()); - jasmine.getEnv().addReporter(new SpecReporter({ - spec: { - displayStacktrace: 'pretty', - displayFailuresSummary: true, - displayFailuredSpec: true, - displaySuiteNumber: true, - displaySpecDuration: true, - displayErrorMessages: true - }, - customProcessors: [LogInterceptor] - })); - jasmine.getEnv().addReporter(DescribeFailureReporter(jasmine.getEnv())); - browser.manage().window().maximize(); - }, - -}; diff --git a/e2e/tests/cloud_application_approval_test.ts b/e2e/tests/cloud_application_approval_test.ts deleted file mode 100644 index 9da581760b..0000000000 --- a/e2e/tests/cloud_application_approval_test.ts +++ /dev/null @@ -1,36 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { ApplicationOverviewPage } from '../page_objects/application_overview.po'; -import { Util } from '../util'; -import { FacilityOverviewPage } from '../page_objects/facility_overview.po'; - -describe('Cloud Application Approval Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - }); - - it('should navigate to application overview', async (): Promise => { - await ApplicationOverviewPage.navigateToApplicationOverview(); - - }); - - it('should approve cloud application with denbi default facility', async (): Promise => { - await ApplicationOverviewPage.approveCloudApplication(Util.OPENSTACK_APPLICATION_NAME); - }); - - it('should relog with facility manager', async (): Promise => { - await LoginPage.login(browser.params.login.email_fm, browser.params.login.password_fm, browser.params.login.auth_fm, true); - }); - - it('should navigate to facility overview', async (): Promise => { - await FacilityOverviewPage.navigateToFacilityOverview(); - }); - - it('should approve cloud application', async (): Promise => { - await FacilityOverviewPage.approveApplication(Util.OPENSTACK_APPLICATION_NAME); - }); - -}); diff --git a/e2e/tests/cloud_application_modification_test.ts b/e2e/tests/cloud_application_modification_test.ts deleted file mode 100644 index b5dbe3dc54..0000000000 --- a/e2e/tests/cloud_application_modification_test.ts +++ /dev/null @@ -1,33 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Cloud ApplicationModification Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should navigate to openstack project overview', async (): Promise => { - await ProjectOverview.navigateToOpenStackeProjectverview(); - }); - - it('should open the modification request modal', async (): Promise => { - await ProjectOverview.openModificationModal(Util.OPENSTACK_APPLICATION_NAME); - }); - - it('should have old values prefilled', async (): Promise => { - await ProjectOverview.areDefaultValuesSetOpenstack(); - }); - - it('should fill modification formular', async (): Promise => { - await ProjectOverview.fillModificationRequest(); - }); - - it('should send a modification request', async (): Promise => { - await ProjectOverview.sendModificationRequest(Util.OPENSTACK_APPLICATION_NAME); - }); -}); diff --git a/e2e/tests/cloud_application_test.ts b/e2e/tests/cloud_application_test.ts deleted file mode 100644 index 48f7b88fb6..0000000000 --- a/e2e/tests/cloud_application_test.ts +++ /dev/null @@ -1,46 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { FormularPage } from '../page_objects/application_formular.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Cloud Application Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should navigate to cloud application form', async (): Promise => { - Util.logInfo('Starting send a cloud application test!'); - await FormularPage.navigateToCloudApplication(); - }); - - it('should fill cloud application form', async (): Promise => { - await FormularPage.fillApplicationFormular(Util.OPENSTACK_APPLICATION_NAME, true, true); - }); - - it('should submit cloud application ', async (): Promise => { - await FormularPage.submitApplication(); - }); - - it('should successfully submitted the application', async (): Promise => { - const isPresent: boolean = await FormularPage.isApplicationSubmitted(); - expect(isPresent).toBeTruthy(); - }); - - it('should load project overview', async (): Promise => { - await Util.clickElementById(FormularPage.NOTIFICATION_BTN_REDIRECT); - await Util.waitForTextInUrl('project-management'); - }); - - it('should have Bioinformatics in the research topics', async (): Promise => { - await ProjectOverview.isBioinformaticsSet(); - }); - - it('should have dissemination ', async (): Promise => { - await ProjectOverview.isDisseminationSet(); - }); - -}); diff --git a/e2e/tests/cloud_modification_approval_test.ts b/e2e/tests/cloud_modification_approval_test.ts deleted file mode 100644 index 07913d5be3..0000000000 --- a/e2e/tests/cloud_modification_approval_test.ts +++ /dev/null @@ -1,34 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { ApplicationOverviewPage } from '../page_objects/application_overview.po'; -import { Util } from '../util'; -import { FacilityOverviewPage } from '../page_objects/facility_overview.po'; - -describe('Cloud ApplicationModification Approval Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - }); - - it('should navigate to application overview', async (): Promise => { - await ApplicationOverviewPage.navigateToApplicationOverview(); - }); - - it('should approve a cloud modification request', async (): Promise => { - await ApplicationOverviewPage.approveModificationRequest(Util.OPENSTACK_APPLICATION_NAME); - }); - - it('should relog with facility manager', async (): Promise => { - await LoginPage.login(browser.params.login.email_fm, browser.params.login.password_fm, browser.params.login.auth_fm, true); - }); - - it('should navigate to facility overview', async (): Promise => { - await FacilityOverviewPage.navigateToFacilityOverview(); - }); - - it('should approve cloud application', async (): Promise => { - await FacilityOverviewPage.approveApplicationModification(Util.OPENSTACK_APPLICATION_NAME); - }); -}); diff --git a/e2e/tests/cluster_tests.ts b/e2e/tests/cluster_tests.ts deleted file mode 100644 index f45c96a7a5..0000000000 --- a/e2e/tests/cluster_tests.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; - -import { Util } from '../util'; -import { NewClusterPage } from '../page_objects/new_cluster.po'; -import { ClusterOverviewPage } from '../page_objects/cluster_overview.po'; - -describe('Cluster Tests', async (): Promise => { - - beforeAll(async (): Promise => { - Util.logDebug('------------------------------Cluster tests: started'); - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should start a cluster', async (): Promise => { - Util.logDebug('------------------------------Start cluster test: started'); - Util.logDebug('Trying to start a new cluster'); - await NewClusterPage.navigateToNewClusterPage(); - Util.logInfo('Choosing project'); - await NewClusterPage.chooseProject(); - Util.logInfo('Filling Form'); - await NewClusterPage.fillBasicForm(); - Util.logInfo('Starting'); - const cluster_id: string = await NewClusterPage.submitAndStartCluster(); - await ClusterOverviewPage.setClusterName(cluster_id); - - }); - - it('cluster should become active', async (): Promise => { - Util.logDebug('------------------------------Overview cluster tests: started'); - await ClusterOverviewPage.navigateToOverview(); - const cluster_id: string = await ClusterOverviewPage.getClusterName(); - - Util.logInfo(`Checking if cluster ${cluster_id} is active`); - const areActive: boolean = await ClusterOverviewPage.isClusterActive(); - expect(areActive).toBeTruthy(); - }); - - it('cluster should be deleted', async (): Promise => { - await ClusterOverviewPage.navigateToOverview(); - const cluster_id: string = await ClusterOverviewPage.getClusterName(); - - Util.logInfo(`Start deleting cluster ${cluster_id}!`); - await ClusterOverviewPage.deleteCluster(); - }); - -}); diff --git a/e2e/tests/create_workshop_test.ts b/e2e/tests/create_workshop_test.ts deleted file mode 100644 index 354b6101df..0000000000 --- a/e2e/tests/create_workshop_test.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { WorkshopOverviewPage } from '../page_objects/workshop_overview.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Workshop creation test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('Should create a Workshop', async (): Promise => { - Util.logInfo('Adding user to Project'); - await ProjectOverview.navigateToSimpleProjectverview(); - await ProjectOverview.addMemberToProject(Util.SIMPLE_VM_APPLICATION_NAME); - Util.logDebug('Testing creation of new workshop'); - await WorkshopOverviewPage.navigateToOverview(); - await WorkshopOverviewPage.selectProject(); - Util.logDebug('Creating new Workshop'); - await WorkshopOverviewPage.createNewWorkshop(); - Util.logInfo('Checking if new workshop successful'); - const workshopSuccess: boolean = await WorkshopOverviewPage.newWorkshopSuccess(); - expect(workshopSuccess).toBeTruthy(); - await WorkshopOverviewPage.closeCreationStatusModal(); - - Util.logInfo('Checking if new workshop failing'); - Util.logDebug('Creating new Workshop again'); - await WorkshopOverviewPage.createNewWorkshop(); - const workshopError: boolean = await WorkshopOverviewPage.newWorkshopError(); - expect(workshopError).toBeTruthy(); - await WorkshopOverviewPage.closeCreationStatusModal(); - }); - - it('Should has Users', async (): Promise => { - Util.logInfo('Checking if User exists'); - const hasUser: boolean = await WorkshopOverviewPage.workshopHasUser(); - expect(hasUser).toBeTruthy(); - Util.logInfo('Checking if Admin exists'); - const hasAdmin: boolean = await WorkshopOverviewPage.workshopHasAdmin(); - expect(hasAdmin).toBeTruthy(); - }); - -}); diff --git a/e2e/tests/login_test.ts b/e2e/tests/login_test.ts deleted file mode 100644 index 7ad40bc807..0000000000 --- a/e2e/tests/login_test.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { Util } from '../util'; - -describe('Login test', async (): Promise => { - - beforeAll(async (): Promise => { - Util.logInfo('------------------------------Login test started'); - await browser.waitForAngularEnabled(false); - await browser.get(browser.params.portal); - }); - - it('should login', async (): Promise => { - Util.logInfo('Login'); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user); - const result: boolean = await Util.waitForPage('userinfo'); - expect(result).toEqual(true); - - }); - - it('should restart', async (): Promise => { - await LoginPage.logOut(); - const result: boolean = await Util.waitForPage('data:,'); - expect(result).toEqual(true); - }); - -}); diff --git a/e2e/tests/member_test.ts b/e2e/tests/member_test.ts deleted file mode 100644 index be8117d6b6..0000000000 --- a/e2e/tests/member_test.ts +++ /dev/null @@ -1,26 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Member Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should navigate to project overview', async (): Promise => { - await ProjectOverview.navigateToSimpleProjectverview(); - }); - - it('should add member', async (): Promise => { - await ProjectOverview.addMemberToProject(Util.SIMPLE_VM_APPLICATION_NAME); - }); - - it('should remove member', async (): Promise => { - await ProjectOverview.removeMemberFromProject(Util.SIMPLE_VM_APPLICATION_NAME); - }); - -}); diff --git a/e2e/tests/public_key_test.ts b/e2e/tests/public_key_test.ts deleted file mode 100644 index 748d3b8838..0000000000 --- a/e2e/tests/public_key_test.ts +++ /dev/null @@ -1,23 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { ProfilePage } from '../page_objects/profile_page.po'; - -describe('Public Key Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should generate a new ssh-keypair', async (): Promise => { - const pubKeyText = await ProfilePage.generateNewKeyPair(); - expect(pubKeyText).toContain('ecdsa'); - }); - - it('should set a new ssh-keypair without previous generation', async (): Promise => { - const pubKeyText = await ProfilePage.setNewPublicKey(); - expect(pubKeyText).toContain('ssh-rsa'); - }); - -}); diff --git a/e2e/tests/simple_vm_application_modification_approval.ts b/e2e/tests/simple_vm_application_modification_approval.ts deleted file mode 100644 index 7275c898b5..0000000000 --- a/e2e/tests/simple_vm_application_modification_approval.ts +++ /dev/null @@ -1,21 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { ApplicationOverviewPage } from '../page_objects/application_overview.po'; -import { Util } from '../util'; - -describe('Simple Application Modification Approval Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - }); - - it('should navigate to application overview', async (): Promise => { - await ApplicationOverviewPage.navigateToApplicationOverview(); - }); - - it('should approve a simple vm modification request', async (): Promise => { - await ApplicationOverviewPage.approveSimpleVMModificationRequest(Util.SIMPLE_VM_APPLICATION_NAME); - }); -}); diff --git a/e2e/tests/simple_vm_application_test.ts b/e2e/tests/simple_vm_application_test.ts deleted file mode 100644 index 5ef8745a21..0000000000 --- a/e2e/tests/simple_vm_application_test.ts +++ /dev/null @@ -1,46 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { FormularPage } from '../page_objects/application_formular.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Simple Application Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should navigate to the simple vm form', async (): Promise => { - Util.logInfo('Starting send a simple vm application test!'); - await FormularPage.navigateToSimpleVmApplication(); - }); - - it('should fill the simple vm form', async (): Promise => { - await FormularPage.fillApplicationFormular(Util.SIMPLE_VM_APPLICATION_NAME, true); - }); - - it('should submit the simple vm form', async (): Promise => { - await FormularPage.submitApplication(); - }); - - it('should successfully submitted the application', async (): Promise => { - const isPresent: boolean = await FormularPage.isApplicationSubmitted(); - expect(isPresent).toBeTruthy(); - }); - - it('should load project overview', async (): Promise => { - await Util.clickElementById(FormularPage.NOTIFICATION_BTN_REDIRECT); - await Util.waitForTextInUrl('project-management'); - }); - - it('should have Bioinformatics in the research topics', async (): Promise => { - await ProjectOverview.isBioinformaticsSet(); - }); - - it('should have dissemination ', async (): Promise => { - await ProjectOverview.isDisseminationSet(); - }); - -}); diff --git a/e2e/tests/simple_vm_approval_test.ts b/e2e/tests/simple_vm_approval_test.ts deleted file mode 100644 index 985c6353d9..0000000000 --- a/e2e/tests/simple_vm_approval_test.ts +++ /dev/null @@ -1,23 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { ApplicationOverviewPage } from '../page_objects/application_overview.po'; -import { Util } from '../util'; - -describe('Simple Application Approval Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - }); - - it('should navigate to application overview', async (): Promise => { - Util.logInfo('Starting approve a simple vm application test!'); - await ApplicationOverviewPage.navigateToApplicationOverview(); - - }); - - it('should approve A SIMPLE VM APPLICATION', async (): Promise => { - await ApplicationOverviewPage.approveSimpleVm(Util.SIMPLE_VM_APPLICATION_NAME); - }); -}); diff --git a/e2e/tests/simple_vm_extension_approval_test.ts b/e2e/tests/simple_vm_extension_approval_test.ts deleted file mode 100644 index 4f070b57c1..0000000000 --- a/e2e/tests/simple_vm_extension_approval_test.ts +++ /dev/null @@ -1,21 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { ApplicationOverviewPage } from '../page_objects/application_overview.po'; -import { Util } from '../util'; - -describe('Simple Application Extension Approval Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - }); - - it('should navigate to application overview', async (): Promise => { - await ApplicationOverviewPage.navigateToApplicationOverview(); - }); - - it('should approve a simple vm modification request', async (): Promise => { - await ApplicationOverviewPage.approveExtensionRequest(Util.SIMPLE_VM_APPLICATION_NAME); - }); -}); diff --git a/e2e/tests/simple_vm_extension_test.ts b/e2e/tests/simple_vm_extension_test.ts deleted file mode 100644 index d0aed0b542..0000000000 --- a/e2e/tests/simple_vm_extension_test.ts +++ /dev/null @@ -1,30 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Simple Application Extension Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should navigate to application overview', async (): Promise => { - console.log('Starting send a simple vm modification request test!'); - await ProjectOverview.navigateToSimpleProjectverview(); - }); - - it('should open the extension request modal', async (): Promise => { - await ProjectOverview.openExtensionModal(Util.SIMPLE_VM_APPLICATION_NAME); - }); - - it('should fill extension formular', async (): Promise => { - await ProjectOverview.fillExtensionRequest(); - }); - - it('should send an extension request', async (): Promise => { - await ProjectOverview.sendExtensionRequest(Util.SIMPLE_VM_APPLICATION_NAME); - }); -}); diff --git a/e2e/tests/simple_vm_modification_test.ts b/e2e/tests/simple_vm_modification_test.ts deleted file mode 100644 index 61aad90461..0000000000 --- a/e2e/tests/simple_vm_modification_test.ts +++ /dev/null @@ -1,34 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Simple Application Modification Test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should navigate to application overview', async (): Promise => { - console.log('Starting send a simple vm modification request test!'); - await ProjectOverview.navigateToSimpleProjectverview(); - }); - - it('should open the modification request modal', async (): Promise => { - await ProjectOverview.openModificationModal(Util.SIMPLE_VM_APPLICATION_NAME); - }); - - it('should have old values prefilled', async (): Promise => { - await ProjectOverview.areDefaultValuesSetSimpleVM(); - }); - - it('should fill modification formular', async (): Promise => { - await ProjectOverview.fillModificationRequest(); - }); - - it('should send a modification request', async (): Promise => { - await ProjectOverview.sendModificationRequest(Util.SIMPLE_VM_APPLICATION_NAME); - }); -}); diff --git a/e2e/tests/simple_vm_no_pi_test.ts b/e2e/tests/simple_vm_no_pi_test.ts deleted file mode 100644 index 32e756fc4d..0000000000 --- a/e2e/tests/simple_vm_no_pi_test.ts +++ /dev/null @@ -1,53 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { FormularPage } from '../page_objects/application_formular.po'; -import { Util } from '../util'; -import { ProjectOverview } from '../page_objects/project_overview.po'; - -describe('Simple Application Test without PI', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should navigate to the simple vm form', async (): Promise => { - Util.logInfo('Starting send a simple vm application test!'); - await FormularPage.navigateToSimpleVmApplication(); - }); - - it('should fill the simple vm form', async (): Promise => { - await FormularPage.fillApplicationFormular(Util.SIMPLE_VM_APPLICATION_NAME_NO_PI); - }); - - it('should submit the simple vm form', async (): Promise => { - await FormularPage.submitApplication(); - }); - - it('should successfully submitted the application', async (): Promise => { - const isPresent: boolean = await FormularPage.isApplicationSubmitted(); - expect(isPresent).toBeTruthy(); - }); - - it('should load project overview', async (): Promise => { - await Util.clickElementById(FormularPage.NOTIFICATION_BTN_REDIRECT); - await Util.waitForTextInUrl('project-management'); - }); - - it('should have no pi set', async (): Promise => { - const isAbsent: boolean = await ProjectOverview.hasPi(); - expect(isAbsent).toBeTruthy(); - }); - - it('pi should successfully approve application', async (): Promise => { - await ProjectOverview.navigateToPIApproval(); - await FormularPage.approveByPI(); - const mailPresent: boolean = await ProjectOverview.checkForPIApproval(); - expect(mailPresent).toBeTruthy(); - }); - - it('should remove the application', async (): Promise => { - await ProjectOverview.removeApplication(); - }); -}); diff --git a/e2e/tests/start_workshop_vms_test.ts b/e2e/tests/start_workshop_vms_test.ts deleted file mode 100644 index 60d6d4f5e3..0000000000 --- a/e2e/tests/start_workshop_vms_test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { WorkshopVMPage } from '../page_objects/workshop_vm.po'; -import { Util } from '../util'; -import { VMOverviewPage } from '../page_objects/vm_overview.po'; -import { WorkshopOverviewPage } from '../page_objects/workshop_overview.po'; - -describe('Workshop VM Test', (): void => { - - const vmOverviewPage: VMOverviewPage = new VMOverviewPage(); - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('Should start workshop vms', async (): Promise => { - Util.logInfo('Starting workshop vm for user and admin'); - await WorkshopVMPage.navigateToAddWorkshopVm(); - await WorkshopVMPage.selectProject(); - await WorkshopVMPage.selectWorkshop(); - await WorkshopVMPage.startVMsForUserAndAdmin(); - await WorkshopVMPage.isRedirectModalPresent(); - await Util.waitForPage('/virtualmachines/vmOverview'); - }); - - it('Should become active', async (): Promise => { - Util.logInfo('Wating until vms become active'); - await browser.sleep(5000); - const workshopMachines: string[] = await VMOverviewPage.getAllWorkshopMachines(); - Util.logInfo(`Number of machines found: ${workshopMachines.length}`); - expect(workshopMachines.length).toBe(2); - const results: any[] = []; - for (const workshopMachine of workshopMachines) { - Util.logInfo(`Wating for ${workshopMachine}`); - // eslint-disable-next-line no-await-in-loop - results.push(vmOverviewPage.isVmActive(workshopMachine)); - } - - await Promise.all(results); - for (const result of results) { - expect(result).toBeTruthy(); - } - }); - - it('Should appear on workshop overview', async (): Promise => { - await WorkshopOverviewPage.navigateToOverview(); - await WorkshopOverviewPage.selectProject(); - await WorkshopOverviewPage.selectWorkshop(); - await WorkshopOverviewPage.workshopHasVms(); - }); - - it('Should login to resenv', async (): Promise => { - const resenvUrlAdmin: string = await WorkshopOverviewPage.getResenvUrlOfAdmin(); - const resenvUrlUser = await WorkshopOverviewPage.getResenvUrlOfUser(); - await browser.driver.get(resenvUrlAdmin); - await Util.waitForElementToBeClickableByName('continue'); - await Util.clickElementByName('continue'); - expect(await browser.getTitle()).toEqual('CWLab'); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - await browser.driver.get(resenvUrlUser); - await Util.waitForElementToBeClickableByName('continue'); - await Util.clickElementByName('continue'); - expect(await browser.getTitle()).toEqual('CWLab'); - }); - -}); diff --git a/e2e/tests/terminate_all_pt.ts b/e2e/tests/terminate_all_pt.ts deleted file mode 100644 index 4d1de923d4..0000000000 --- a/e2e/tests/terminate_all_pt.ts +++ /dev/null @@ -1,41 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { VoOverviewPage } from '../page_objects/vo_overview.po'; -import { ApplicationOverviewPage } from '../page_objects/application_overview.po'; -import { FacilityOverviewPage } from '../page_objects/facility_overview.po'; - -describe('Terminate all PT projects', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - }); - - it('should decline all open PT Applications', async (): Promise => { - await ApplicationOverviewPage.navigateToApplicationOverview(); - await ApplicationOverviewPage.declinePTApplications(); - }); - - it('should navigate to the vo overview', async (): Promise => { - await VoOverviewPage.navigateToVolumeOverview(); - }); - - it('should filter projects', async (): Promise => { - await VoOverviewPage.filterForPTProjets(); - }); - - it('should terminate vo projects', async (): Promise => { - await VoOverviewPage.terminateAllPTProjects(); - }); - - it('should relog with fm', async (): Promise => { - await LoginPage.login(browser.params.login.email_fm, browser.params.login.password_fm, browser.params.login.auth_fm, true); - }); - - it('should terminate fm projects', async (): Promise => { - await FacilityOverviewPage.navigateToFacilityOverview(); - await FacilityOverviewPage.terminatePTApplications(); - }); - -}); diff --git a/e2e/tests/terminate_all_pt_after.ts b/e2e/tests/terminate_all_pt_after.ts deleted file mode 100644 index 8be0e78e7a..0000000000 --- a/e2e/tests/terminate_all_pt_after.ts +++ /dev/null @@ -1,41 +0,0 @@ -// spec.js -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { VoOverviewPage } from '../page_objects/vo_overview.po'; -import { ApplicationOverviewPage } from '../page_objects/application_overview.po'; -import { FacilityOverviewPage } from '../page_objects/facility_overview.po'; - -describe('Terminate all PT projects after', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_vo, browser.params.login.password_vo, browser.params.login.auth_vo, true); - }); - - it('should decline all open PT Applications', async (): Promise => { - await ApplicationOverviewPage.navigateToApplicationOverview(); - await ApplicationOverviewPage.declinePTApplications(); - }); - - it('should navigate to the vo overview', async (): Promise => { - await VoOverviewPage.navigateToVolumeOverview(); - }); - - it('should filter projects', async (): Promise => { - await VoOverviewPage.filterForPTProjets(); - }); - - it('should terminate vo projects', async (): Promise => { - await VoOverviewPage.terminateAllPTProjects(); - }); - - it('should relog with fm', async (): Promise => { - await LoginPage.login(browser.params.login.email_fm, browser.params.login.password_fm, browser.params.login.auth_fm, true); - }); - - it('should terminate fm projects', async (): Promise => { - await FacilityOverviewPage.navigateToFacilityOverview(); - await FacilityOverviewPage.terminatePTApplications(); - }); - -}); diff --git a/e2e/tests/terminate_all_workshops_test.ts b/e2e/tests/terminate_all_workshops_test.ts deleted file mode 100644 index aed75b8ce1..0000000000 --- a/e2e/tests/terminate_all_workshops_test.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { browser } from 'protractor'; -import { LoginPage } from '../page_objects/login.po'; -import { WorkshopOverviewPage } from '../page_objects/workshop_overview.po'; -import { Util } from '../util'; - -describe('Workshop deletion test', (): void => { - - beforeAll(async (): Promise => { - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('Should delete a Workshop', async (): Promise => { - Util.logDebug('Testing deletion of workshop'); - await WorkshopOverviewPage.navigateToOverview(); - await WorkshopOverviewPage.selectProject(); - Util.logDebug('Deleting Workshop'); - const deletionSuccess: boolean = await WorkshopOverviewPage.deleteWorkshop(); - Util.logInfo('Checking if workshop deletion successful'); - expect(deletionSuccess).toBeTruthy(); - await WorkshopOverviewPage.closeWorkshopCleanupModal(); - }); - -}); diff --git a/e2e/tests/virtual_machine_tests.ts b/e2e/tests/virtual_machine_tests.ts deleted file mode 100644 index 498f52816c..0000000000 --- a/e2e/tests/virtual_machine_tests.ts +++ /dev/null @@ -1,201 +0,0 @@ -import { browser } from 'protractor'; -import { NewInstancePage } from '../page_objects/new_instance.po'; -import { LoginPage } from '../page_objects/login.po'; -import { VMOverviewPage } from '../page_objects/vm_overview.po'; -import { VMDetailPage } from '../page_objects/vm_detail.po'; -import { VolumeOverviewPage } from '../page_objects/volume_overview.po'; -import { SnapshotOverviewPage } from '../page_objects/vm_snapshot.po'; -import { Util } from '../util'; - -describe('Virtual Machine Tests', async (): Promise => { - - const vmOverviewPage: VMOverviewPage = new VMOverviewPage(); - const vmDetailPage: VMDetailPage = new VMDetailPage(); - - beforeAll(async (): Promise => { - Util.logDebug('------------------------------All virtual machine tests: started'); - await browser.waitForAngularEnabled(false); - await LoginPage.login(browser.params.login.email_user, browser.params.login.password_user, browser.params.login.auth_user, true); - }); - - it('should start a basic vm', async (): Promise => { - Util.logDebug('------------------------------Start virtual machine tests: started'); - Util.logDebug('Trying to start a vm with denbi default and Ubuntu 18.04.'); - await NewInstancePage.getNewInstanceTab(); - Util.logInfo('Choosing project'); - await NewInstancePage.chooseProject(); - Util.logInfo('Filling Form'); - await NewInstancePage.fillBasicForm(); - Util.logInfo('Starting'); - await NewInstancePage.submitAndStartVM(); - Util.logInfo('Redirect Modal should be present'); - await NewInstancePage.isRedirectModalPresent(); - await Util.waitForPage('/virtualmachines/vmOverview'); - - Util.logInfo('Saving basic vm name'); - const vm_name: string = await vmOverviewPage.getNewBasicVMName(); - Util.logInfo(vm_name); - await vmOverviewPage.setBasicVMName(vm_name); - }); - - it('should start a basic vm with a volume', async (): Promise => { - Util.logDebug('Trying to start a vm with denbi default and Ubuntu 18.04 and a volume'); - await NewInstancePage.getNewInstanceTab(); - Util.logInfo('Choosing project'); - await NewInstancePage.chooseProject(); - Util.logInfo('Filling Form'); - await NewInstancePage.fillBasicVolumeForm(); - Util.logInfo('Setting Volume'); - await NewInstancePage.setVolume(); - Util.logInfo('Starting'); - await NewInstancePage.submitAndStartVM(); - Util.logInfo('Redirect Modal should be present'); - await NewInstancePage.isRedirectModalPresent(); - const vm_name: string = await vmOverviewPage.getNewVolumeVMName(); - Util.logInfo(vm_name); - - await vmOverviewPage.setVolumeVMName(vm_name); - await browser.sleep(8000); - - Util.logInfo('Checking volume overview if volume present'); - await VolumeOverviewPage.navigateToVolumeOverview(); - await browser.sleep(8000); - const isVolumePresent: boolean = await VolumeOverviewPage.isVolumePresent(); - expect(isVolumePresent).toBeTruthy(); - Util.logInfo('------------------------------Start virtual machine tests: ended'); - }); - - it('should show all virtual machines as active', async (): Promise => { - Util.logDebug('------------------------------Overview virtual machine tests: started'); - await vmOverviewPage.navigateToOverview(); - Util.logInfo('Checking if every VM is active'); - const areActive: boolean = await vmOverviewPage.areAllVMActive(); - expect(areActive).toBeTruthy(); - }); - - it('should shutdown the basic vm', async (): Promise => { - Util.logDebug('Shutting down the basic vm'); - await vmOverviewPage.shutOffBasicVM(); - const isShutoff: boolean = await vmOverviewPage.isBasicVMShutoff(); - expect(isShutoff).toBeTruthy(); - }); - - it('should resume the basic vm', async (): Promise => { - Util.logDebug('Resuming the basic vm'); - await vmOverviewPage.resumeBasicVM(); - const isActive: boolean = await vmOverviewPage.isBasicVMActive(); - expect(isActive).toBeTruthy(); - }); - - it('should delete the volume vm without deleting the volume', async (): Promise => { - Util.logDebug('Deleting the volume vm'); - await vmOverviewPage.deleteVolumeVM(); - await VolumeOverviewPage.navigateToVolumeOverview(); - const isVolumePresent: boolean = await VolumeOverviewPage.isVolumePresent(); - expect(isVolumePresent).toBeTruthy(); - }); - - it('should delete the vm created volume', async (): Promise => { - Util.logDebug('Deleting the volume created in new instance tab'); - await VolumeOverviewPage.deleteVolume(); - const deleted: boolean = await VolumeOverviewPage.isVolumeDeleted(); - expect(deleted).toBeTruthy(); - }); - - it('should create a snapshot of the basic vm', async (): Promise => { - Util.logDebug('Creating a snapshot of the basic vm'); - await vmOverviewPage.navigateToOverview(); - await vmOverviewPage.createSnapshotOfBasicVM(); - await SnapshotOverviewPage.navigateToSnapshotOverview(); - const isPresent: boolean = await SnapshotOverviewPage.isBasicSnapshotPresent(); - const isActive: boolean = await SnapshotOverviewPage.isBasicSnapshotActive(); - expect(isPresent && isActive).toBeTruthy(); - }); - it('should start a vm with the snapshot', async (): Promise => { - Util.logDebug('Trying to start a vm with snapshot and Ubuntu 18.04 and a volume'); - await NewInstancePage.getNewInstanceTab(); - Util.logInfo('Choosing project'); - await NewInstancePage.chooseProject(); - Util.logInfo('Filling Form'); - await NewInstancePage.fillBasicForm(Util.BASIC_SNAPSHOT_NAME); - - Util.logInfo('Starting'); - await NewInstancePage.submitAndStartVM(); - await Util.waitForPage('/virtualmachines/vmOverview'); - Util.logInfo('Checking if every VM is active'); - const areActive: boolean = await vmOverviewPage.areAllVMActive(); - expect(areActive).toBeTruthy(); - - Util.logInfo('------------------------------Start virtual machine with snapshot ended'); - }); - - it('should create and attach a volume to basic vm', async (): Promise => { - Util.logDebug('Creating and attaching a volume to basic vm'); - await VolumeOverviewPage.navigateToVolumeOverview(); - await VolumeOverviewPage.createAndAttachVolumeToProjectVm(await vmOverviewPage.getBasicVMName()); - const present: boolean = await VolumeOverviewPage.isVolumePresent(); - const attached: boolean = await VolumeOverviewPage.isVolumeAttachedToVM(await vmOverviewPage.getBasicVMName()); - expect(present && attached).toBeTruthy(); - }); - - it('should delete the snapshot of the basic vm', async (): Promise => { - Util.logDebug('Deleting the snapshot of the basic vm'); - await SnapshotOverviewPage.navigateToSnapshotOverview(); - await SnapshotOverviewPage.deleteBasicSnapshot(); - const isDeleted: boolean = await SnapshotOverviewPage.isBasicSnapshotDeleted(); - expect(isDeleted).toBeTruthy(); - }); - - it('should should delete the basic vm without deleting the volume', async (): Promise => { - Util.logDebug('Deleting the volume vm'); - await vmOverviewPage.navigateToOverview(); - await vmOverviewPage.deleteBasicVM(); - await VolumeOverviewPage.navigateToVolumeOverview(); - const isVolumePresent: boolean = await VolumeOverviewPage.isVolumePresent(); - const notAttached: boolean = await VolumeOverviewPage.isVolumeFree(); - expect(isVolumePresent && notAttached).toBeTruthy(); - }); - - it('should delete the manually created volume', async (): Promise => { - Util.logDebug('Deleting the volume created by attachment'); - await VolumeOverviewPage.navigateToVolumeOverview(); - await VolumeOverviewPage.deleteVolume(); - const isVolumeDeleted: boolean = await VolumeOverviewPage.isVolumeDeleted(); - expect(isVolumeDeleted).toBeTruthy(); - - }); - - it('should start a new vm', async (): Promise => { - Util.logDebug('Starting new machine for VM Detail page'); - Util.logDebug('Trying to start a new vm with denbi default and Ubuntu 18.04.'); - await NewInstancePage.getNewInstanceTab(); - Util.logInfo('Choosing project'); - await NewInstancePage.chooseProject(); - Util.logInfo('Filling Form'); - await NewInstancePage.fillBasicForm(); - Util.logInfo('Starting'); - await NewInstancePage.submitAndStartVM(); - Util.logInfo('Redirect Modal should be present'); - await NewInstancePage.isRedirectModalPresent(); - await Util.waitForPage('/virtualmachines/vmOverview'); - - Util.logInfo('Saving basic vm name'); - const vm_name: string = await vmOverviewPage.getNewBasicVMName(); - Util.logInfo(vm_name); - await vmOverviewPage.setBasicVMName(vm_name); - }); - - it('should show vm detail page with base functions for virtual machines working', - async (): Promise => { - Util.logDebug('showing instance detail page'); - await vmOverviewPage.navigateToOverview(); - await vmOverviewPage.goToVmDetail(); - // TODO: test stop, restart and other basic functions of virtual machines on the vmDetailPage - await vmDetailPage.setBasicVMName((await vmOverviewPage.getBasicVMName())); - await vmDetailPage.stopBasicVM(); - await vmDetailPage.restartBasicVM(); - await vmDetailPage.createSnapshotBasicVM(); - await vmDetailPage.deleteBasicVM(); - }); - -}); diff --git a/e2e/tsconfig.e2e.json b/e2e/tsconfig.e2e.json deleted file mode 100644 index ac7a373257..0000000000 --- a/e2e/tsconfig.e2e.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": "../tsconfig.json", - "compilerOptions": { - "outDir": "../out-tsc/e2e", - "module": "commonjs", - "target": "es5", - "types":[ - "jasmine", - "node" - ] - } -} diff --git a/e2e/util.ts b/e2e/util.ts deleted file mode 100644 index 819df3c33a..0000000000 --- a/e2e/util.ts +++ /dev/null @@ -1,510 +0,0 @@ -import { - browser, by, element, ElementFinder, protractor, ProtractorExpectedConditions, -} from 'protractor'; -// tslint:disable-next-line:no-require-imports no-var-requires typedef -// const clc = require('cli-color'); -// tslint:disable-next-line:no-require-imports no-var-requires typedef -const log4jsGen = require('./log4jsGen'); - -/** - * Util test class. - */ -export class Util { - private static angular_url: string = browser.params.angular; - - private static auth: string = browser.params.login.auth; - private static _SIMPLE_VM_APPLICATION_NAME_NO_PI: string = 'PTSimpleVMNoPi'; - private static _OPENSTACK_APPLICATION_NAME: string = 'PTOpenStack'; - private static _SIMPLE_VM_APPLICATION_NAME: string = 'PTSimpleVM'; - private static _PI_EMAIL: string = 'test@test.com'; - private static _BASIC_VM_NAME: string = 'PTSIMPLEVM'; - private static _VOLUME_VM_NAME: string = 'ProtractorVMVolume'; - private static _VOLUME_NAME: string = 'ProtractorVolume'; - private static _VOLUME_SPACE: string = '1'; - private static _WORKSHOP_NAME: string = 'PTWS'; - private static _ONE_MINUTE_TIMEOUT: number = 60000; - private static _timeout: number = Util._ONE_MINUTE_TIMEOUT * 2; - private static _15_MIN_TIMEOUT: number = Util._ONE_MINUTE_TIMEOUT * 15; - private static _30_MIN_TIMEOUT: number = Util._ONE_MINUTE_TIMEOUT * 30; - private static _DEFAULT_FLAVOR_TITLE: string = 'de.NBI default'; - private static _UBUNTU_18_TITLE: string = 'Ubuntu 18.04 LTS (2021-12-13)'; - private static _CWLAB: string = 'cwlab'; - - private static _VOLUME_MOUNT_PATH_STRING: string = 'path'; - - private static _BASIC_SNAPSHOT_NAME: string = 'PTSnap'; - private static _ALTERNATIVE_SNAPSHOT_NAME: string = 'PTSnapTwo'; - - // tslint:disable-next-line:no-require-imports - static get PI_EMAIL(): string { - return this._PI_EMAIL; - } - - static get CWLAB(): string { - return this._CWLAB; - } - - static get USER_ACCOUNT_ELIXIR_ID(): string { - return browser.params.login.elixir_id_user; - } - - static get VO_ACCOUNT_ELIXIR_ID(): string { - return browser.params.login.elixir_id_vo; - } - - static get DEFAULT_FLAVOR_NAME(): string { - return this._DEFAULT_FLAVOR_TITLE; - } - - static get UBUNTU_18_TITLE(): string { - return this._UBUNTU_18_TITLE; - } - - static get VOLUME_MOUNT_PATH_STRING(): string { - return this._VOLUME_MOUNT_PATH_STRING; - } - - static get ALTERNATIVE_SNAPSHOT_NAME(): string { - return this._ALTERNATIVE_SNAPSHOT_NAME; - } - - static get SIMPLE_VM_APPLICATION_NAME_NO_PI(): string { - return this._SIMPLE_VM_APPLICATION_NAME_NO_PI; - } - - static get SIMPLE_VM_APPLICATION_NAME(): string { - return this._SIMPLE_VM_APPLICATION_NAME; - } - - static get MIN_TIMEOUT_1(): number { - return this._ONE_MINUTE_TIMEOUT; - } - - static get MIN_TIMEOUT_15(): number { - return this._15_MIN_TIMEOUT; - } - - static get MIN_TIMOEUT_30(): number { - return this._30_MIN_TIMEOUT; - } - - static get BASIC_SNAPSHOT_NAME(): string { - return this._BASIC_SNAPSHOT_NAME; - } - - static get OPENSTACK_APPLICATION_NAME(): string { - return this._OPENSTACK_APPLICATION_NAME; - } - - static get VOLUME_VM_NAME(): string { - return this._VOLUME_VM_NAME; - } - - static get BASIC_VM_NAME(): string { - return this._BASIC_VM_NAME; - } - - static get VOLUME_NAME(): string { - return this._VOLUME_NAME; - } - - static get timeout(): number { - return this._timeout; - } - - static get VOLUME_SPACE(): string { - return this._VOLUME_SPACE; - } - - static get WORKSHOP_NAME(): string { - return this._WORKSHOP_NAME; - } - - static logInfo(text: string): void { - log4jsGen.getLogger().info(text); - - } - - static logWarn(text: string): void { - log4jsGen.getLogger().warn(text); - - } - - static logDebug(text: string): void { - log4jsGen.getLogger().info(text); - - } - - static logError(text: string): void { - log4jsGen.getLogger().error(text); - - } - - static async scrollToElement(scrollTo: ElementFinder): Promise { - const location = await scrollTo.getLocation(); - this.logInfo(`Scroll to Element [X-${location.x} : Y-${location.y}] `); - await browser.sleep(500); - await browser.executeScript('arguments[0].scrollIntoView()', scrollTo.getWebElement()); - - } - - static async clickElementByLinkTextIgnoreError(text: string, timeout: number = this.timeout): Promise { - await Util.waitForElementToBeClickableByLinkText(text); - this.logInfo(`Clicking element with text: [${text}]`); - - try { - await this.scrollToElement(element(by.linkText(text))); - await element(by.linkText(text)).click(); - } catch (error) { - this.logInfo(`Coudln't click ${text} - Ignore Error`); - - return false; - } - - return true; - } - - static async waitForPageIgnoreError(url: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - await browser.sleep(2000); - - this.logInfo(`Waiting until page contains ${url}`); - try { - await browser.driver.wait(until_.urlContains(url), timeout); - } catch (error) { - this.logInfo(`Didn't load ${url} - Ignore Error`); - - return false; - } - - return true; - } - - static async waitForPage(url: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until page contains ${url}`); - await browser.sleep(2000); - - return await browser.driver.wait(until_.urlContains(url), timeout); - } - - static async sendTextToElementByName(name: string, text: string, show_output: boolean = true): Promise { - if (show_output) { - this.logInfo(`Send text [${text}] to element ${name}`); - - } - const elem: ElementFinder = element(by.name(name)); - - return await elem.sendKeys(text); - } - - static async sendTextToElementByNameWithoutLogging(name: string, text: string): Promise { - this.logInfo(`Sending text [redacted] to element ${name}`); - const elem: ElementFinder = element(by.name(name)); - - return await elem.sendKeys(text); - } - - static async sendTextToElementByElement(elem: any, text: string, show_output: boolean = true): Promise { - if (show_output) { - this.logInfo(`Send text [${text}] to element [${elem}]`); - - } - - return await elem.sendKeys(text); - } - - static async clickElementByLinkText(text: string): Promise { - await Util.waitForElementToBeClickableByLinkText(text); - await this.scrollToElement(element(by.linkText(text))); - - this.logInfo(`Clicking element with text: [${text}]`); - - return await element(by.linkText(text)).click(); - - } - - static async waitForElementToBeClickableByLinkText(text: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until element is clickable with text: ${text}`); - - const elem: ElementFinder = element(by.linkText(text)); - - return await browser.driver.wait(until_.elementToBeClickable(elem), timeout, `Element [${text}] taking too long to be clickable`); - } - - static async sendTextToElementByIdSecure(id: string, text: string): Promise { - await this.waitForVisibilityOfElementById(id); - const elem: ElementFinder = element(by.id(id)); - await elem.clear(); - await elem.sendKeys(text); - const str: string = await elem.getAttribute('value'); - - if (str !== text) { - this.logWarn('Text is not send by xpath in field so i will try to send string char by char!'); - - await elem.clear(); - for (let idx: number = 0; idx < text.length; idx++) { - // tslint:disable-next-line:prefer-template - await elem.sendKeys(`${text.charAt(idx)}`); - } - } - - } - - static async sendTextToElementByIdUnsecure(id: string, text: string): Promise { - await this.waitForVisibilityOfElementById(id); - this.logInfo(`Send text [${text}] to element ${id}`); - - const elem: ElementFinder = element(by.id(id)); - await elem.clear(); - await elem.sendKeys(text); - const str: string = await elem.getAttribute('value'); - - if (str !== text) { - this.logWarn('Text is not send by xpath in field so i will try to send string char by char!'); - - await elem.clear(); - for (let idx: number = 0; idx < text.length; idx++) { - // tslint:disable-next-line:prefer-template - await elem.sendKeys(`${text.charAt(idx)}`); - } - } - - } - - static async clickElementByName(name: string): Promise { - await this.waitForElementToBeClickableByName(name); - this.logInfo(`Clicking element ${name}`); - await this.scrollToElement(element(by.name(name))); - - return await element(by.name(name)).click(); - } - - static async checkInputsByIdsGotSameValue(id_1: string, id_2: string, timeout: number = this.timeout): Promise { - const val1: any = await this.getInputValueById(id_1); - const val2: any = await this.getInputValueById(id_2); - this.logInfo(`Val1 [${val1}] | Val2 [${val2}]`); - expect(val1).toEqual(val2); - } - - static async getInputValueById(id: string, timeout: number = this.timeout): Promise { - this.logInfo(`Get input value from ${id}`); - - await this.waitForVisibilityOfElementById(id, timeout); - - return await element(by.id(id)).getAttribute('value'); - } - - static async getElemTextById(id: string, timeout: number = this.timeout): Promise { - this.logInfo(`Get elem text from ${id}`); - - await this.waitForVisibilityOfElementById(id, timeout); - - return await element(by.id(id)).getText(); - } - - static async clickElementByElement( - elem: any, - timeout: number = this.timeout, - id: string = 'Elementfinder', - ): Promise { - await this.waitForElementToBeClickableByElement(elem, timeout, id); - await this.scrollToElement(elem); - - this.logInfo(`Clicking element ${id}`); - - return await elem.click(); - } - - static async clickElementById(id: string, timeout: number = this.timeout): Promise { - await this.waitForVisibilityOfElementById(id, timeout); - await this.waitForElementToBeClickableById(id, timeout); - await this.scrollToElement(element(by.id(id))); - - this.logInfo(`Clicking element ${id}`); - - return await element(by.id(id)).click(); - } - - static async waitForTextPresenceInElementById(id: string, text: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until text [${text}] appears in element ${id}`); - - const elem: ElementFinder = element(by.id(id)); - - return await browser.driver.wait(until_.textToBePresentInElement(elem, text), timeout, `Text [${id}] taking too long to appear in the Element`); - } - - static async waitForPresenceOfElementById(id: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until page contains element ${id}`); - - const elem: ElementFinder = element(by.id(id)); - - return await browser.driver.wait(until_.presenceOf(elem), timeout, `Element [${id}] taking too long to appear in the DOM`); - } - - static async waitForPresenceOfLinkByPartialId(prefix: string, id: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until page contains element ${id}`); - - const elem: ElementFinder = element(by.css(`a[id^=${prefix}${id}]`)); - - return await browser.driver.wait(until_.presenceOf(elem), timeout, `Element [${prefix}${id}] taking too long to appear in the DOM`); - } - - static async waitForPresenceOfElementsByPrefix(prefix: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until page contains elements with prefix ${prefix}`); - - await element.all(by.css(`[id^=${prefix}]`)).then( - async (elem) => { - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (let i: number = 0; i < elem.length; i += 1) { - // eslint-disable-next-line no-await-in-loop - await browser.driver.wait(until_.presenceOf(elem[i]), timeout, `Element [${prefix}] taking too long to appear in the DOM`); - } - }, - ); - - return true; - } - - static async waitForPresenceByElement(elem: any, timeout: number = this.timeout, id: string = 'Elementfinder'): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until page contains element ${id}`); - - return await browser.driver.wait(until_.presenceOf(elem), timeout, `Element [${id}] taking too long to appear in the DOM`); - } - - static async waitForAbsenceOfElementById(id: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until page does not contain element ${id}`); - - const elem: ElementFinder = element(by.id(id)); - - return await browser.driver.wait(until_.not(until_.presenceOf(elem)), timeout, `Element [${id}] taking too long to appear in the DOM`); - } - - static async waitForVisibilityOfElementById(id: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - - this.logInfo(`Waiting until element ${id} is visibile`); - - const elem: ElementFinder = element(by.id(id)); - - return await browser.driver.wait(until_.visibilityOf(elem), timeout, `Element [${id}] taking too long to be visibile`); - } - - static async waitForInvisibilityOfElementByElement( - elem: any, - timeout: number = this.timeout, - id: string = 'Elementfinder', - ): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until element ${id} is invisibile`); - - return await browser.driver.wait(until_.invisibilityOf(elem), timeout, `Element [${id}] taking too long to be invisibile`); - } - - static async waitForInvisibilityOfElementById(id: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until element ${id} is invisibile`); - - const elem: any = element(by.id(id)); - - return await browser.driver.wait(until_.invisibilityOf(elem), timeout, `Element [${id}] taking too long to be invisibile`); - } - - static async waitForElementToBeClickableById(id: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - - this.logInfo(`Waiting until element is clickable ${id}`); - - const elem: ElementFinder = element(by.id(id)); - - return await browser.driver.wait(until_.elementToBeClickable(elem), timeout, `Element [${id}] taking too long to be clickable`); - } - - static async waitForElementToBeClickableByElement( - elem: any, - timeout: number = this.timeout, - id: string = 'Elementfinder', - ): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until element is clickable ${id}`); - - return await browser.driver.wait(until_.elementToBeClickable(elem), timeout, `Element [${id}] taking too long to be clickable`); - } - - static async navigateToAngularPage(url_suffix: string): Promise { - this.logInfo(`Navigating to ${this.angular_url}#/${url_suffix}`); - - return await browser.get(`${this.angular_url}#/${url_suffix}`); - } - - static async waitForTextInUrl(text: string): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - - return browser.wait(until_.urlContains(text), this.timeout); - } - - static async clickOptionOfSelect(option: string, selectId: string): Promise { - this.logInfo(`Getting option ${option} from select ${selectId}`); - - await this.waitForPresenceOfElementById(selectId); - await this.scrollToElement(element(by.id(selectId)).element(by.id(option))); - - const elem: any = element(by.id(selectId)).element(by.id(option)); - - return await elem.click(); - } - - static async waitForElementToBeClickableByName(name: string, timeout: number = this.timeout): Promise { - const until_: ProtractorExpectedConditions = protractor.ExpectedConditions; - this.logInfo(`Waiting until element is clickable ${name}`); - - const elem: ElementFinder = element(by.name(name)); - - return await browser.driver.wait(until_.elementToBeClickable(elem), timeout, `Element [${name}]taking too long to be clickable`); - } - - static async getTextFromLinkElement(prefix: string, name: string): Promise { - - await this.waitForPresenceOfLinkByPartialId(prefix, name); - const elem: ElementFinder = element(by.css(`a[id^=${prefix}${name}]`)); - - return elem.getText(); - } - - static async getTextFromElementsByIdPrefix(prefix: string): Promise { - await this.waitForPresenceOfElementsByPrefix(prefix); - // const elements: ElementArrayFinder = element.all(by.css(`[id^=${prefix}]`)); - - const elementsText: string[] = []; - await element.all(by.css(`[id^=${prefix}]`)).then( - async (elem) => { - // eslint-disable-next-line @typescript-eslint/prefer-for-of - for (let i: number = 0; i < elem.length; i += 1) { - // eslint-disable-next-line no-await-in-loop - elem[i].getText().then( - (text) => { - elementsText.push(text); - }, - ); - } - }, - ); - - return elementsText; - } - - static async getElementsByIdPrefix(prefix: string): Promise { - return await element.all(by.css(`[id^=${prefix}]`)); - } - - static async isElementPresentById(id: string): Promise { - return await element(by.id(id)).isPresent(); - } -} diff --git a/src/app/applications/applications.component.html b/src/app/applications/applications.component.html index 1b4d996025..60c897c8bd 100644 --- a/src/app/applications/applications.component.html +++ b/src/app/applications/applications.component.html @@ -188,11 +188,7 @@ {{ application?.project_application_compute_center?.Name @@ -288,7 +286,7 @@ showClientsLimitsModal(selectedCenter[application.project_application_id], application); switchApproveLocked(true) " - [disabled]="approveLocked" + [disabled]="!selectedCenter[application.project_application_id] || approveLocked" type="button" class="btn btn-success" > diff --git a/src/app/layouts/full-layout.component.ts b/src/app/layouts/full-layout.component.ts index b7f15f4387..1c93f97c0e 100644 --- a/src/app/layouts/full-layout.component.ts +++ b/src/app/layouts/full-layout.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { ChangeDetectorRef, Component, OnInit } from '@angular/core'; import * as moment from 'moment'; import { ApiSettings } from '../api-connector/api-settings.service'; import { ClientService } from '../api-connector/client.service'; @@ -73,12 +73,14 @@ export class FullLayoutComponent extends ApplicationBaseClassComponent implement facilityService: FacilityService, applicationsService: ApplicationsService, private virtualMachineService: VirtualmachineService, + private cd: ChangeDetectorRef, ) { super(userService, applicationsService, facilityService); } componentAdded(component: any): void { this.TITLE = component.title; + this.cd.detectChanges(); } public get_is_vo_admin(): boolean { diff --git a/src/app/projectmanagement/computecenter.component.ts b/src/app/projectmanagement/computecenter.component.ts index 4b137ab3b6..787cb88ac3 100644 --- a/src/app/projectmanagement/computecenter.component.ts +++ b/src/app/projectmanagement/computecenter.component.ts @@ -2,12 +2,22 @@ * ComputeCenter component. */ export class ComputecenterComponent { - - constructor(FacilityId: string, Name: string, Login: string, Support: string) { + constructor(FacilityId: string, Name: string, Login: string, Support: string, Client?: any) { this._FacilityId = FacilityId; this._Name = Name; this._Login = Login; this._Support = Support; + this._hasClient = Client !== undefined && Client !== null; + } + + private _hasClient: boolean; + + get hasClient(): boolean { + return this._hasClient; + } + + set hasClient(value: boolean) { + this._hasClient = value; } private _FacilityId: string; diff --git a/src/app/shared/shared_modules/baseClass/application-base-class.component.ts b/src/app/shared/shared_modules/baseClass/application-base-class.component.ts index 78d35fdd6b..9a0801c0bf 100644 --- a/src/app/shared/shared_modules/baseClass/application-base-class.component.ts +++ b/src/app/shared/shared_modules/baseClass/application-base-class.component.ts @@ -127,6 +127,7 @@ export class ApplicationBaseClassComponent extends AbstractBaseClass { cc['compute_center_name'], cc['compute_center_login'], cc['compute_center_support_mail'], + cc['compute_center_client'], ); this.computeCenters.push(compute_center); } From e39f908d80a00b21959df093dc81488ce6a8c1d8 Mon Sep 17 00:00:00 2001 From: dweinholz Date: Tue, 21 Mar 2023 14:48:00 +0100 Subject: [PATCH 02/22] feat(Consent):added consent info to userinfo and info icon to Profile if consent is missing --- src/app/api-connector/user.service.ts | 6 ++++++ src/app/layouts/full-layout.component.html | 13 ++++++++++++- src/app/layouts/full-layout.component.ts | 9 +++++++++ src/app/userinfo/userinfo.component.html | 20 +++++++++++++++++++- src/app/userinfo/userinfo.component.ts | 8 +++++++- src/app/userinfo/userinfo.model.ts | 2 ++ src/app/vo_manager/voOverview.component.html | 14 +++++++++++++- src/links/check_links.sh | 1 + src/links/links.ts | 1 + 9 files changed, 70 insertions(+), 4 deletions(-) diff --git a/src/app/api-connector/user.service.ts b/src/app/api-connector/user.service.ts index de12a37f03..0449e80cee 100644 --- a/src/app/api-connector/user.service.ts +++ b/src/app/api-connector/user.service.ts @@ -31,6 +31,12 @@ export class UserService { }); } + getMissingConsents(): Observable { + return this.http.get(`${ApiSettings.getApiBaseURL()}users/current/consents/`, { + withCredentials: true, + }); + } + getPreferredMailUser(): Observable { return this.http.get(`${ApiSettings.getApiBaseURL()}users/current/preferredEmail/`, { withCredentials: true, diff --git a/src/app/layouts/full-layout.component.html b/src/app/layouts/full-layout.component.html index eff53b57f6..c2c0a988f6 100644 --- a/src/app/layouts/full-layout.component.html +++ b/src/app/layouts/full-layout.component.html @@ -13,8 +13,19 @@ routerLinkActive="active" [routerLink]="['/userinfo']" href="#" - >Profile + + Profile + + + +