Commit 3f42646b authored by Laurent's avatar Laurent

iguana tests fix

parent 8164f545
......@@ -105,7 +105,10 @@ export class Account extends Persistable {
public findHolds(datasource: DataSource): Array<Hold> {
return this._findAll(datasource, Hold);
return this._findAll(datasource, Hold)
.sort((a, b) => {
return a.getStatus().localeCompare(b.getStatus());
})
}
......
......@@ -176,7 +176,6 @@ export class IguanaV3 extends PortalAdapter {
headers: {"Content-Type": "text/xml; charset=UTF-8",
SOAPAction: soap_action} })
.then( (response) => {
console.dir([response.content.toString()]);
let datas = xmljs.xml2js(response.content.toString(),
{compact: true,
ignoreAttributes: true});
......
......@@ -18,7 +18,7 @@ export class IguanaV3LoansAndHoldsWithSuccessfulLogin extends HTTPScenario {
public setup(base_url:string) {
this
.expect({ url: base_url + '/iguana/www.main.cls?surl=accueil' },
.expect({ url: base_url },
{ content: this.homePage() })
.then({ url: base_url + '/iguana/Proxy.UserActivities.cls',
......@@ -30,16 +30,32 @@ export class IguanaV3LoansAndHoldsWithSuccessfulLogin extends HTTPScenario {
+ '<LogonId>marco</LogonId>'
+ '<Password>secret</Password>'
+ '</CheckCredentials>'),
headers: {"Content-Type": "text/xml; charset=UTF-8"} },
headers: {"Content-Type": "text/xml; charset=UTF-8",
SOAPAction: 'CheckCredentials'}
},
{ content: this.checkCredentialsResponse() })
.then({ url: base_url + '/iguana/Proxy.SetLogon.cls',
method: 'POST',
content: 'BorrowerId=9088&Category=ABO&CspSessionId=2pu4GQqnf0&Digital=0&Email=marco%40somewhere.fr&HomeLocation=HERE&Language=fre&PasswordExpired=0&Profile=Iguana&SessionId=12345678&tempList=&Token=undefined&UserAge=30&UserName=POLO%20Marco&ValidRequests=Welcome%2CCurrentLoans%2CLoanHistory%2CPaymentsHistory%2CCurrentReservations%2CInterests%2CReadingLists%2CLinkedAccounts%2CSearchFilter%2CViewId&ViewId=',
headers:{"headers":{"Content-Type":"application/x-www-form-urlencoded"}}
},
{ content: '' }
)
.then({ url: base_url + '/iguana/Proxy.UserActivities.cls',
method: 'POST',
content: this.soapEnvelope('<CurrentLoans>'
+ '<SessionId>12345678</SessionId>'
+ '<Data><From>1</From><To>20</To></Data>'
+ '</CurrentLoans>'),
headers: {"Content-Type": "text/xml; charset=UTF-8"}
headers: {"Content-Type": "text/xml; charset=UTF-8",
SOAPAction: 'CurrentLoans'
}
},
{ content: this.loansResponse()})
.then({ url: base_url + '/iguana/Proxy.UserActivities.cls',
method: 'POST',
......@@ -47,7 +63,9 @@ export class IguanaV3LoansAndHoldsWithSuccessfulLogin extends HTTPScenario {
+ '<SessionId>12345678</SessionId>'
+ '<Data><From>1</From><To>20</To></Data>'
+ '</CurrentReservations>'),
headers: {"Content-Type": "text/xml; charset=UTF-8"}
headers: {"Content-Type": "text/xml; charset=UTF-8",
SOAPAction: 'CurrentReservations'
}
},
{ content: this.holdsResponse()})
}
......@@ -58,9 +76,16 @@ export class IguanaV3LoansAndHoldsWithSuccessfulLogin extends HTTPScenario {
+ '<CheckCredentialsResult>'
+ '<Result>1</Result>'
+ '<UserName>POLO Marco</UserName>'
+ '<Category>ABO</Category>'
+ '<Digital>0</Digital>'
+ '<Email>marco@somewhere.fr</Email>'
+ '<HomeLocation>HERE</HomeLocation>'
+ '<SessionId>12345678</SessionId>'
+ '<BorrowerId>9088</BorrowerId>'
+ '<Token>tok</Token>'
+ '<UserAge>30</UserAge>'
+ '<Avatar/>'
+ '<SearchFilter/>'
+ '<SessionId>12345678</SessionId>'
+ '<Token>TK123</Token>'
+ '</CheckCredentialsResult>'
+ '</CheckCredentialsResponse>');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment