import { element , by , ElementFinder } from 'protractor' ; export class LabelComponentsPage { createButton = element ( by . id ( 'jh-create-entity' ) ) ; deleteButtons = element . all ( by . css ( 'jhi-label div table .btn-danger' ) ) ; title = element . all ( by . css ( 'jhi-label 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 LabelUpdatePage { pageTitle = element ( by . id ( 'jhi-label-heading' ) ) ; saveButton = element ( by . id ( 'save-entity' ) ) ; cancelButton = element ( by . id ( 'cancel-save' ) ) ; idInput = element ( by . id ( 'field_id' ) ) ; labelInput = element ( by . id ( 'field_label' ) ) ; async getPageTitle ( ) { return this . pageTitle . getAttribute ( 'jhiTranslate' ) ; } async setIdInput ( id ) { await this . idInput . sendKeys ( id ) ; } async getIdInput ( ) { return await this . idInput . getAttribute ( 'value' ) ; } async setLabelInput ( label ) { await this . labelInput . sendKeys ( label ) ; } async getLabelInput ( ) { return await this . labelInput . getAttribute ( 'value' ) ; } async save ( ) { await this . saveButton . click ( ) ; } async cancel ( ) { await this . cancelButton . click ( ) ; } getSaveButton ( ) { return this . saveButton ; } } export class LabelDeleteDialog { private dialogTitle = element ( by . id ( 'jhi-delete-label-heading' ) ) ; private confirmButton = element ( by . id ( 'jhi-confirm-delete-label' ) ) ; async getDialogTitle ( ) { return this . dialogTitle . getAttribute ( 'jhiTranslate' ) ; } async clickOnConfirmButton ( ) { await this . confirmButton . click ( ) ; } }