import { by } from 'protractor' ; import { GenericDialog } from '../dialog/generic-dialog' ; import { isPresentAndEnabled , typeText } from '../../utilities/utils' ; export class UploadNewVersionDialog extends GenericDialog { cancelButton = this . childElement ( by . cssContainingText ( '.mat-button-wrapper' , 'Cancel' ) ) ; uploadButton = this . childElement ( by . cssContainingText ( '.mat-button-wrapper' , 'Upload' ) ) ; majorOption = this . childElement ( by . cssContainingText ( `.mat-radio-label` , 'major' ) ) ; minorOption = this . childElement ( by . cssContainingText ( `.mat-radio-label` , 'minor' ) ) ; description = this . childElement ( by . css ( 'textarea' ) ) ; constructor ( ) { super ( '.adf-version-manager-dialog-panel-upload' ) ; } async isCancelButtonEnabled ( ) { return isPresentAndEnabled ( this . cancelButton ) ; } async isUploadButtonEnabled ( ) { return isPresentAndEnabled ( this . uploadButton ) ; } async clickCancel ( ) { await this . cancelButton . click ( ) ; await this . waitForDialogToClose ( ) ; } async enterDescription ( description ) { await typeText ( this . description , description ) ; } }