var helix_web_services_client = require('../../index.js'); function createClient() { return new helix_web_services_client.ApiClient('http://localhost:9000'); } function clientAsJdoe(callback) { var client = createClient(); var api = client.createDefaultApi(); var loginRequest = new helix_web_services_client.models.LoginRequest({ user: 'jdoe', password: 'johndoe1A!' }); api.loginPost(loginRequest, function (err, loginResponse) { if (err) { callback(err); return; } client.apiKey = loginResponse.ticket; callback(null, client); }); } function clientAsSuper(callback) { var client = createClient(); var api = client.createDefaultApi(); var loginRequest = new helix_web_services_client.models.LoginRequest({ user: 'super', password: 'superuser1A!' }); api.loginPost(loginRequest, function (err, loginResponse) { if (err) { callback(err); return; } client.apiKey = loginResponse.ticket; callback(null, client); }); } module.exports = { clientAsJdoe: clientAsJdoe, clientAsSuper: clientAsSuper, createClient: createClient };
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 19553 | swellard | Move and rename clients | ||
//guest/perforce_software/helix-web-services/main/source/clients/2016.1.0/javascript/test/util/test_methods.js | |||||
#2 | 19097 | tjuricek | JavaScript Client SDK tests for client and depot specs | ||
#1 | 19053 | tjuricek |
Rebuild JavaScript Client SDK. The JavaScript client now is a "typed" approach that tends to be similar in approach to the other clients, based on the swagger definition for the platform version. Importantly, client SDK tests are individual scripts (that run under node) that are actually controlled via TestNG. This approach now lets us use a consistent test reporting format so we can at least collect reports from each of the jobs. The documentation is still in progress, that I want to validate as the tests are generated. |