import { AbstractPageObject } from "./abstract-po" ; import { ICompileKeyData , IIncludeData } from "./interface-po" ; export class CompileKeyPageObject extends AbstractPageObject { async fillCompileKeyPage ( data ) { await this . beginWebView ( ) ; await this . setValue ( "compileKeyFile" , `${ data . compileKeyFile }\t` ) ; await this . endWebView ( ) ; } async getCompileKeyPage ( close = false ) { const result = { machineId : "" , compileKeyFile : "" , key : "" , generatedIn : "" , expireIn : "" , token : "" , overwrite : "" } ; await this . beginWebView ( ) ; result . machineId = await this . getValue ( "MachineID" ) ; result . compileKeyFile = await this . getValue ( "compileKeyFile" ) ; result . key = await this . getValue ( "KeyID" ) ; result . generatedIn = await this . getValue ( "GeneratedInID" ) ; result . expireIn = await this . getValue ( "ExpireInID" ) ; result . token = await this . getValue ( "TokenID" ) ; result . overwrite = await this . getValue ( "OverwriteID" ) ; if ( close ) { await this . click ( "submitCloseID" ) ; } await this . endWebView ( ) ; return result ; } async isValidKey ( ) { await this . beginWebView ( ) ; const message = await this . getValue ( "OutputMessage" ) ; await this . endWebView ( ) ; return message === "Key successfully validated" ; } async fireClear ( ) { await this . beginWebView ( ) ; await this . click ( "cleanID" ) ; await this . endWebView ( ) ; } async fireSave ( close ) { await this . beginWebView ( ) ; await this . click ( close ? "submitCloseID" : "submitID" ) ; await this . endWebView ( ) ; } }