diff --git a/src/api.js b/src/api.js index 8f9ba13..310f8a2 100644 --- a/src/api.js +++ b/src/api.js @@ -184,7 +184,7 @@ class API { async getItems(projectName, launchId) { try { - const response = await this.client.get(`/v1/${projectName}/item?filter.eq.launchId=${launchId}&isLatest=false&launchesLimit=0`)//filter.eq.launchId=${launchId}&isLatest=false&launchesLimit=0`); + const response = await this.client.get(`/v1/${projectName}/item?filter.eq.launchId=${launchId}&isLatest=false&launchesLimit=0`); return this.handleResponse(response).content; } catch (error) { diff --git a/src/index.js b/src/index.js index b4cf762..b1d9037 100644 --- a/src/index.js +++ b/src/index.js @@ -78,7 +78,7 @@ exports['default'] = () => { async reportLogs(testId, level, message, time, attachment) { if(message !== undefined) { const isJSON = this.reporter.client.isJSON(message) || Array.isArray(message); - const isException = isJSON && JSON.parse(message).errMsg !== undefined + const isException = isJSON && JSON.parse(message).errMsg !== undefined; //If the log is a stacktrace, and we want to focus on printing the error message itself. if(isException) message = JSON.parse(message).errMsg; //If the log is a JS Object diff --git a/src/uat.js b/src/uat.js index 128a03e..5cd2577 100644 --- a/src/uat.js +++ b/src/uat.js @@ -61,12 +61,10 @@ class UAT { }); const token = Buffer.from('ui:uiman').toString('base64'); this.setUiToken(token); - const response = await this.client.post(`/sso/oauth/token?${encodedURI}`); - console.log(response); + const response = await this.client.post(`uat/sso/oauth/token?${encodedURI}`); return this.handleResponse(response); } catch (error) { - console.log(error); return this.handleError(error); } } @@ -79,11 +77,10 @@ class UAT { async generateApiToken(token) { this.setApiToken(token); try { - const response = await this.client.post('/sso/me/apitoken?authenticated=true'); + const response = await this.client.post('uat/sso/me/apitoken?authenticated=true'); return this.handleResponse(response); } catch(error) { - console.log(error); return this.handleError(error); } } @@ -91,8 +88,7 @@ class UAT { async getApiKeys(token, userId) { try { this.setApiToken(token); - const response = await this.client.get(`api/users/${userId}/api-keys`) - console.log(response); + const response = await this.client.get(`uat/api/users/${userId}/api-keys`); return this.handleResponse(response).items; } catch (error) { @@ -103,8 +99,7 @@ class UAT { async createApiToken(token, userId, name) { try { this.setApiToken(token); - const response = await this.client.post(`api/users/${userId}/api-keys`, {name: name}) - console.log(response); + const response = await this.client.post(`api/users/${userId}/api-keys`, {name: name}); return this.handleResponse(response); } catch (error) { diff --git a/tests/integration/integration.executor.ts b/tests/integration/integration.executor.ts index c1a8fc5..e0d929c 100644 --- a/tests/integration/integration.executor.ts +++ b/tests/integration/integration.executor.ts @@ -10,21 +10,13 @@ describe('Performing Integration testing', async function() { before(async () => { loadArguments(); let client = new UAT({ - protocol: 'http', - domain: 'localhost:8080', - apiPath: '/uat', - }); - const token = await client.getApiToken('default', '1q2w3e'); - console.log(`Got the following token: ${JSON.stringify(token)}`) - client = new UAT({ protocol: 'http', domain: 'localhost:8080', apiPath: '/', }); + const token = await client.getApiToken('default', '1q2w3e'); const apiToken = await client.createApiToken(token.access_token, 1, 'testing'+new Date().getTime() ); - console.log(`Generated the following report portal token: ${JSON.stringify(apiToken)}`) cliArguments.rtoken = apiToken.api_key; - console.log(`List of arguments: ${JSON.stringify(cliArguments)}`) testcafeServer = await createTestCafe('localhost', 1337, 1338); });