@@ -9,6 +9,8 @@ import using from 'jasmine-data-provider';
9
9
import cucumberImport from '../../data/import/cucumber.json' ;
10
10
import syncImport from '../../data/import/oneTestCucumber.json' ;
11
11
import users from '../../data/users.json' ;
12
+ import { TestRun } from '../../../src/app/shared/models/testRun' ;
13
+ import { EditorAPI } from '../../api/editor.api' ;
12
14
13
15
const editorExamples = {
14
16
localAdmin : users . localAdmin ,
@@ -30,6 +32,12 @@ const isTestRunCorrect = (testResults: TestResult[], includedTests: string[], re
30
32
return included && removed ;
31
33
} ;
32
34
35
+ const updateTestRunDates = ( api : EditorAPI , testRun : TestRun , started : Date , finished : Date ) => {
36
+ testRun . start_time = started ;
37
+ testRun . finish_time = finished ;
38
+ return api . createTestRun ( testRun ) ;
39
+ } ;
40
+
33
41
const testSuite = 'Sync Test Suite' ;
34
42
const defaultNumberOfTestRuns = '5' ;
35
43
const numberOfTestRunsForSync = '2' ;
@@ -80,6 +88,9 @@ describe('Sync Test Suite', () => {
80
88
notSyncTestRun = await projectHelper . importer . executeCucumberImport ( testSuite , [ cucumberImport ] , [ builds . filenames [ 0 ] ] ) ;
81
89
syncTestRuns = await projectHelper . importer . executeCucumberImport (
82
90
testSuite , [ syncImport , syncImport ] , [ builds . filenames [ 1 ] , builds . filenames [ 2 ] ] ) ;
91
+ await updateTestRunDates ( projectHelper . editorAPI , notSyncTestRun [ 0 ] , new Date ( '03/09/2020' ) , new Date ( '03/10/2020' ) ) ;
92
+ await updateTestRunDates ( projectHelper . editorAPI , syncTestRuns [ 0 ] , new Date ( '03/10/2020' ) , new Date ( '03/11/2020' ) ) ;
93
+ await updateTestRunDates ( projectHelper . editorAPI , syncTestRuns [ 1 ] , new Date ( '03/11/2020' ) , new Date ( '03/12/2020' ) ) ;
83
94
await logIn . logInAs ( user . user_name , user . password ) ;
84
95
return projectHelper . openProject ( ) ;
85
96
} ) ;
0 commit comments