import { element , by , ElementFinder } from 'protractor' ; export class BankAccountComponentsPage { createButton = element ( by . id ( 'jh-create-entity' ) ) ; deleteButtons = element . all ( by . css ( 'jhi-bank-account div table .btn-danger' ) ) ; title = element . all ( by . css ( 'jhi-bank-account div h2#page-heading span' ) ) . first ( ) ; noResult = element ( by . id ( 'no-result' ) ) ; entities = element ( by . id ( 'entities' ) ) ; async clickOnCreateButton ( ) { await this . createButton . click ( ) ; } async clickOnLastDeleteButton ( ) { await this . deleteButtons . last ( ) . click ( ) ; } async countDeleteButtons ( ) { return this . deleteButtons . count ( ) ; } async getTitle ( ) { return this . title . getAttribute ( 'jhiTranslate' ) ; } } export class BankAccountUpdatePage { pageTitle = element ( by . id ( 'jhi-bank-account-heading' ) ) ; saveButton = element ( by . id ( 'save-entity' ) ) ; cancelButton = element ( by . id ( 'cancel-save' ) ) ; idInput = element ( by . id ( 'field_id' ) ) ; nameInput = element ( by . id ( 'field_name' ) ) ; balanceInput = element ( by . id ( 'field_balance' ) ) ; userSelect = element ( by . id ( 'field_user' ) ) ; async getPageTitle ( ) { return this . pageTitle . getAttribute ( 'jhiTranslate' ) ; } async setIdInput ( id ) { await this . idInput . sendKeys ( id ) ; } async getIdInput ( ) { return await this . idInput . getAttribute ( 'value' ) ; } async setNameInput ( name ) { await this . nameInput . sendKeys ( name ) ; } async getNameInput ( ) { return await this . nameInput . getAttribute ( 'value' ) ; } async setBalanceInput ( balance ) { await this . balanceInput . sendKeys ( balance ) ; } async getBalanceInput ( ) { return await this . balanceInput . getAttribute ( 'value' ) ; } async userSelectLastOption ( ) { await this . userSelect . all ( by . tagName ( 'option' ) ) . last ( ) . click ( ) ; } async userSelectOption ( option ) { await this . userSelect . sendKeys ( option ) ; } getUserSelect ( ) { return this . userSelect ; } async getUserSelectedOption ( ) { return await this . userSelect . element ( by . css ( 'option:checked' ) ) . getText ( ) ; } async save ( ) { await this . saveButton . click ( ) ; } async cancel ( ) { await this . cancelButton . click ( ) ; } getSaveButton ( ) { return this . saveButton ; } } export class BankAccountDeleteDialog { private dialogTitle = element ( by . id ( 'jhi-delete-bankAccount-heading' ) ) ; private confirmButton = element ( by . id ( 'jhi-confirm-delete-bankAccount' ) ) ; async getDialogTitle ( ) { return this . dialogTitle . getAttribute ( 'jhiTranslate' ) ; } async clickOnConfirmButton ( ) { await this . confirmButton . click ( ) ; } }