@@ -5,15 +5,15 @@ const uuidv1 = require('uuid/v1')
55
66const Workfront = require ( './../' )
77
8- describe ( 'E2E Tests' , function ( ) {
8+ describe ( 'E2E Tests' , function ( ) {
99 const objToRemove = [ ]
1010 const rootTestTitle = this . title
1111 let customerID , resellerID , accountRepID
1212 let USERNAME = 'new@user.attask' ,
1313 PASSWORD = 'user'
1414
1515 if ( process . env . CI ) {
16- before ( 'Create Test Customer' , function ( ) {
16+ before ( 'Create Test Customer' , function ( ) {
1717 this . aspInstance = new Workfront . Api ( {
1818 url : 'http://localhost:8080' ,
1919 version : 'asp'
@@ -35,7 +35,7 @@ describe('E2E Tests', function() {
3535 firstName : 'Test' ,
3636 lastName : 'Test' ,
3737 username : 'Test' + uuid ,
38- password : 'password '
38+ password : 'aHardPasswordW!7hSymb0ls '
3939 } )
4040 . then ( data => {
4141 accountRepID = data . ID
@@ -75,7 +75,7 @@ describe('E2E Tests', function() {
7575 } )
7676 } )
7777 } )
78- after ( 'Delete Test Customer' , function ( ) {
78+ after ( 'Delete Test Customer' , function ( ) {
7979 return this . aspInstance
8080 . edit ( 'Customer' , customerID , {
8181 isDisabled : true ,
@@ -94,7 +94,7 @@ describe('E2E Tests', function() {
9494 } )
9595 }
9696
97- beforeEach ( function ( ) {
97+ beforeEach ( function ( ) {
9898 this . instance = new Workfront . Api ( {
9999 url : 'http://localhost:8080' ,
100100 version : '8.0'
@@ -106,19 +106,19 @@ describe('E2E Tests', function() {
106106 return obj
107107 }
108108
109- beforeEach ( function ( ) {
109+ beforeEach ( function ( ) {
110110 objToRemove . length = 0
111111 } )
112- afterEach ( function ( ) {
112+ afterEach ( function ( ) {
113113 let queue = Promise . resolve ( )
114114 objToRemove . reverse ( ) . forEach ( ( [ objCode , objID ] ) => {
115115 queue = queue . then ( ( ) => this . instance . remove ( objCode , objID , true ) )
116116 } )
117117 return queue
118118 } )
119119
120- describe ( 'Login with username and password' , function ( ) {
121- beforeEach ( function ( ) {
120+ describe ( 'Login with username and password' , function ( ) {
121+ beforeEach ( function ( ) {
122122 return this . instance
123123 . login ( USERNAME , PASSWORD )
124124 . then ( data => {
@@ -128,7 +128,7 @@ describe('E2E Tests', function() {
128128 . catch ( err => console . error ( err . message ) )
129129 } )
130130
131- it . skip ( 'Loads list of user notes, then calls acknowledge action for the one' , function ( ) {
131+ it . skip ( 'Loads list of user notes, then calls acknowledge action for the one' , function ( ) {
132132 const query = { }
133133 query [ ApiConstants . LIMIT ] = 1
134134 return this . instance . search ( 'USRNOT' , query ) . then ( data => {
@@ -145,7 +145,7 @@ describe('E2E Tests', function() {
145145 } )
146146 } )
147147
148- it ( 'Loads list of active users, then calls assignUserToken action for the first user' , function ( ) {
148+ it ( 'Loads list of active users, then calls assignUserToken action for the first user' , function ( ) {
149149 const query = { }
150150 query [ 'isActive' ] = true
151151 query [ ApiConstants . LIMIT ] = 1
@@ -158,7 +158,7 @@ describe('E2E Tests', function() {
158158 } )
159159 } )
160160
161- it ( 'Creates a new template with name "API Template", then removes it' , function ( ) {
161+ it ( 'Creates a new template with name "API Template", then removes it' , function ( ) {
162162 return this . instance
163163 . create ( 'tmpl' , {
164164 name : 'API Template' ,
@@ -172,15 +172,15 @@ describe('E2E Tests', function() {
172172 } )
173173 } )
174174
175- it ( 'Creates a group "Api Group", edits the name to read "Api Group 2", then deletes it' , function ( ) {
175+ it ( 'Creates a group "Api Group", edits the name to read "Api Group 2", then deletes it' , function ( ) {
176176 return this . instance . create ( 'group' , { name : 'Api Group' } ) . then ( data => {
177177 return this . instance
178178 . edit ( 'group' , data . ID , { name : 'Api Group 2' } , [ 'ID' ] )
179179 . then ( data => this . instance . remove ( 'group' , data . ID ) )
180180 } )
181181 } )
182182
183- it ( 'Creates a new project with name "API Project"' , function ( ) {
183+ it ( 'Creates a new project with name "API Project"' , function ( ) {
184184 const name = 'API Project'
185185 const description = 'This project has been created using API'
186186 const objCode = 'PROJ'
@@ -193,7 +193,7 @@ describe('E2E Tests', function() {
193193 } )
194194 } )
195195
196- it ( 'Creates a new project with name "API Project Shared" and then shares it' , function ( ) {
196+ it ( 'Creates a new project with name "API Project Shared" and then shares it' , function ( ) {
197197 const name = 'API Project'
198198 const description = 'This project has been created using API'
199199 const objCode = 'PROJ'
@@ -237,7 +237,7 @@ describe('E2E Tests', function() {
237237 } )
238238 } )
239239
240- it ( 'Creates a new project with name "API Project", then copies it without any option' , function ( ) {
240+ it ( 'Creates a new project with name "API Project", then copies it without any option' , function ( ) {
241241 const name = 'API Project'
242242 const copyName = 'API Project Copy'
243243 const description = 'This project has been created using API'
@@ -257,7 +257,7 @@ describe('E2E Tests', function() {
257257 } )
258258 } )
259259 } )
260- it ( 'Copies a project with options' , function ( ) {
260+ it ( 'Copies a project with options' , function ( ) {
261261 const name = 'API Project'
262262 const copyName = 'API Project Copy'
263263 const description = 'This project has been created using API'
@@ -279,7 +279,7 @@ describe('E2E Tests', function() {
279279 } )
280280 } )
281281
282- it ( 'Deletes all projects with name containing "API Project' , function ( ) {
282+ it ( 'Deletes all projects with name containing "API Project' , function ( ) {
283283 const query = { }
284284 query [ 'name' ] = 'API Project'
285285 query [ 'name' + ApiConstants . MOD ] = ApiConstants . Operators . CONTAINS
@@ -309,15 +309,15 @@ describe('E2E Tests', function() {
309309 } )
310310 } )
311311
312- it ( 'Returns metadata about available API resources' , function ( ) {
312+ it ( 'Returns metadata about available API resources' , function ( ) {
313313 return this . instance . metadata ( ) . then ( data => {
314314 should ( data ) . have . propertyByPath ( 'objects' , 'Project' )
315315 should ( data ) . have . propertyByPath ( 'objects' , 'User' )
316316 should ( data ) . have . propertyByPath ( 'objects' , 'Task' )
317317 } )
318318 } )
319319
320- it ( 'Queries details of multiple tasks' , function ( ) {
320+ it ( 'Queries details of multiple tasks' , function ( ) {
321321 return this . instance
322322 . create ( 'PROJ' , { name : 'baz' } )
323323 . then ( putObjToRemoveQueue )
@@ -357,7 +357,7 @@ describe('E2E Tests', function() {
357357 } )
358358 } )
359359
360- it ( 'Queries project and project owner details by project id' , function ( ) {
360+ it ( 'Queries project and project owner details by project id' , function ( ) {
361361 return this . instance
362362 . create ( 'PROJ' , { name : 'baz' } )
363363 . then ( putObjToRemoveQueue )
@@ -372,7 +372,7 @@ describe('E2E Tests', function() {
372372 } )
373373 } )
374374
375- it ( 'Queries metadata for the task object (objCode: TASK)' , function ( ) {
375+ it ( 'Queries metadata for the task object (objCode: TASK)' , function ( ) {
376376 return this . instance . metadata ( 'TASK' ) . then ( data => {
377377 should ( data )
378378 . have . property ( 'name' )
@@ -386,7 +386,7 @@ describe('E2E Tests', function() {
386386 } )
387387 } )
388388
389- it ( 'Returns number of active users' , function ( ) {
389+ it ( 'Returns number of active users' , function ( ) {
390390 const query = { }
391391 query [ 'isActive' ] = true
392392 query [ 'isActive' + ApiConstants . MOD ] = ApiConstants . Operators . EQUAL
@@ -395,13 +395,13 @@ describe('E2E Tests', function() {
395395 } )
396396 } )
397397
398- it ( 'Calls myWork named query for Work object (Items in My Work)' , function ( ) {
398+ it ( 'Calls myWork named query for Work object (Items in My Work)' , function ( ) {
399399 return this . instance . namedQuery ( 'work' , 'myWork' ) . then ( data => {
400400 should ( data ) . be . Array ( )
401401 } )
402402 } )
403403
404- it ( 'Returns list of hours grouped by project names' , function ( ) {
404+ it ( 'Returns list of hours grouped by project names' , function ( ) {
405405 const query = { }
406406 query [ 'project:name_1' + ApiConstants . GROUPBY ] = true
407407 query [ 'hours' + ApiConstants . AGGFUNC ] = ApiConstants . Functions . SUM
@@ -410,15 +410,15 @@ describe('E2E Tests', function() {
410410 } )
411411 } )
412412
413- it ( 'Search for projects with percentComplete > 0' , function ( ) {
413+ it ( 'Search for projects with percentComplete > 0' , function ( ) {
414414 this . instance
415415 . search ( 'PROJ' , { percentComplete : 0 , percentComplete_Mod : 'gt' } )
416416 . then ( data => {
417417 should ( data ) . be . Array ( )
418418 } )
419419 } )
420420
421- it ( 'Uploads an image and delete it afterwards' , function ( ) {
421+ it ( 'Uploads an image and delete it afterwards' , function ( ) {
422422 const stream = fs . createReadStream ( __dirname + '/../examples/node/image.jpg' )
423423 return this . instance
424424 . create ( 'PROJ' , {
@@ -451,7 +451,7 @@ describe('E2E Tests', function() {
451451 } )
452452 } )
453453
454- it ( 'Creates Rate executing setRatesForRole action' , function ( ) {
454+ it ( 'Creates Rate executing setRatesForRole action' , function ( ) {
455455 return Promise . all ( [
456456 this . instance
457457 . create ( 'PROJ' , { name : 'BillingRate Project' } )
@@ -486,8 +486,8 @@ describe('E2E Tests', function() {
486486 } )
487487 } )
488488
489- describe ( 'With no auto-login in beforeEach' , function ( ) {
490- it ( "Gets apiKey for the User, gets user's details, clear the apiKey" , function ( ) {
489+ describe ( 'With no auto-login in beforeEach' , function ( ) {
490+ it ( "Gets apiKey for the User, gets user's details, clear the apiKey" , function ( ) {
491491 return this . instance . getApiKey ( USERNAME , PASSWORD ) . then ( data => {
492492 should ( data )
493493 . be . String ( )
@@ -502,7 +502,7 @@ describe('E2E Tests', function() {
502502 } )
503503 } )
504504
505- it ( 'Creates a new project with name "API Project" using a GET request' , function ( ) {
505+ it ( 'Creates a new project with name "API Project" using a GET request' , function ( ) {
506506 const instance = new Workfront . Api ( {
507507 url : 'http://localhost:8080' ,
508508 version : '7.0' ,
@@ -521,7 +521,7 @@ describe('E2E Tests', function() {
521521 )
522522 } )
523523
524- it ( 'Creates a group "Api Group", edits the name to read "Api Group 2", then deletes it -- Chained' , function ( ) {
524+ it ( 'Creates a group "Api Group", edits the name to read "Api Group 2", then deletes it -- Chained' , function ( ) {
525525 const login = ( ) => this . instance . login ( USERNAME , PASSWORD )
526526 const createGroup = ( ) => this . instance . create ( 'group' , { name : 'Api Group' } )
527527 const editGroup = data =>
@@ -534,7 +534,7 @@ describe('E2E Tests', function() {
534534 . then ( deleteGroup )
535535 } )
536536
537- it ( 'Logs in and logs out' , function ( ) {
537+ it ( 'Logs in and logs out' , function ( ) {
538538 return this . instance . login ( USERNAME , PASSWORD ) . then ( data => {
539539 should ( data ) . have . properties ( 'userID' , 'sessionID' )
540540 return this . instance . logout ( )
0 commit comments