11import { assert } from '../deps.ts'
22import type { By , ThenableWebDriver } from '../deps.ts'
33
4- export type TDriverParams = {
5- browser : TDriverBrowser
4+ export type DriverParams = {
5+ browser : DriverBrowser
66}
77
8- export type TDriverBrowser = 'chrome' | 'firefox' | 'safari' | 'edge'
8+ export type DriverBrowser = 'chrome' | 'firefox' | 'safari' | 'edge'
99
10- export type TConfigJSON = {
10+ export type ConfigJSON = {
1111 url : string
1212 exportPdf : boolean
1313}
1414
15- export type TDataResult = {
15+ export type DataResult = {
1616 id ?: string
1717 name : string
1818 status : string
1919 timestamp ?: Date
2020 duration : number
2121 month_of_test ?: string
22- browser : TDriverBrowser
22+ browser : DriverBrowser
2323}
2424
25- export type TData = {
25+ export type Data = {
2626 url : string
27- results : Array < TDataResult >
27+ results : Array < DataResult >
2828}
2929
30- export type TDrowserThenableWebDriver = ThenableWebDriver
30+ export type DrowserThenableWebDriver = ThenableWebDriver
3131
32- export type TDrowserBuilder = Omit <
32+ export type DrowserBuilder = Omit <
3333 ThenableWebDriver ,
3434 'get'
3535>
3636
37- export type TDriverServiceCaseParamsBuilder = Omit <
37+ export type DriverServiceCaseParamsBuilder = Omit <
3838 ThenableWebDriver ,
3939 'get' | 'quit' | 'then' | 'catch' | 'close' | 'finally'
4040>
4141
42- export type TDriverServiceCaseParamsAssert = typeof assert
42+ export type DriverServiceCaseParamsAssert = typeof assert
4343
44- export type TDriverServiceCaseParamsBy = typeof By
44+ export type DriverServiceCaseParamsBy = typeof By
4545
46- export type TDriverBrowserCaseParams = {
47- builder : TDriverServiceCaseParamsBuilder
48- assert : TDriverServiceCaseParamsAssert
49- by : TDriverServiceCaseParamsBy
46+ export type DriverBrowserCaseParams = {
47+ builder : DriverServiceCaseParamsBuilder
48+ assert : DriverServiceCaseParamsAssert
49+ by : DriverServiceCaseParamsBy
5050}
5151
52- export type TDrowserServiceCase = {
52+ export type DrowserServiceCase = {
5353 name : string
5454 fn : (
55- params : TDriverBrowserCaseParams ,
55+ params : DriverBrowserCaseParams ,
5656 ) => void
5757}
5858
59- export type TDrowserService = {
60- cases : Array < TDrowserServiceCase >
59+ export type DrowserService = {
60+ cases : Array < DrowserServiceCase >
6161}
6262
63- export type TCaseFn = (
64- params : TDriverBrowserCaseParams ,
63+ export type CaseFn = (
64+ params : DriverBrowserCaseParams ,
6565) => Promise < void >
6666
67- export type TDrowserDriverResponse = {
68- service : TDrowserService
67+ export type DrowserDriverResponse = {
68+ service : DrowserService
6969}
7070
71- export type TAssertFunction = (
71+ export type AssertFunction = (
7272 actual : unknown ,
7373 expected : unknown ,
7474 msg ?: string ,
7575) => void
7676
77- export type TAssertError = {
77+ export type AssertError = {
7878 name : string
7979}
8080
81- export type TIsValidHttpUrlParams = {
81+ export type IsValidHttpUrlParams = {
8282 url : string
8383}
8484
@@ -102,7 +102,7 @@ export type MonthValue = {
102102 value : number
103103}
104104
105- export type TJSON = {
105+ export type ReportSchema = {
106106 drowser : {
107107 metadata : {
108108 current_month : string
@@ -131,35 +131,36 @@ export type TJSON = {
131131 coverage : number
132132 flaky : number
133133 month_of_test : string
134- browser : TDriverBrowser
135- cases : Array < TDataResult >
134+ browser : DriverBrowser
135+ cases : Array < DataResult >
136136 } ,
137137 ]
138138 }
139139}
140140
141141const types = {
142- TDriverParams : { } as TDriverParams ,
143- TDriverBrowser : { } as TDriverBrowser ,
144- TConfigJSON : { } as TConfigJSON ,
145- TData : { } as TData ,
146- TDrowserThenableWebDriver : { } as TDrowserThenableWebDriver ,
147- TDrowserBuilder : { } as TDrowserBuilder ,
148- TDriverServiceCaseParamsBuilder : { } as TDriverServiceCaseParamsBuilder ,
149- TDriverServiceCaseParamsAssert : { } as TDriverServiceCaseParamsAssert ,
150- TDriverServiceCaseParamsBy : { } as TDriverServiceCaseParamsBy ,
151- TDriverBrowserCaseParams : { } as TDriverBrowserCaseParams ,
152- TDrowserServiceCase : { } as TDrowserServiceCase ,
153- TDrowserService : { } as TDrowserService ,
154- TCaseFn : { } as TCaseFn ,
155- TDrowserDriverResponse : { } as TDrowserDriverResponse ,
156- TAssertFunction : { } as TAssertFunction ,
157- TAssertError : { } as TAssertError ,
158- TIsValidHttpUrlParams : { } as TIsValidHttpUrlParams ,
142+ TDriverParams : { } as DriverParams ,
143+ DriverBrowser : { } as DriverBrowser ,
144+ ConfigJSON : { } as ConfigJSON ,
145+ Data : { } as Data ,
146+ DrowserThenableWebDriver : { } as DrowserThenableWebDriver ,
147+ DrowserBuilder : { } as DrowserBuilder ,
148+ DriverServiceCaseParamsBuilder : { } as DriverServiceCaseParamsBuilder ,
149+ DriverServiceCaseParamsAssert : { } as DriverServiceCaseParamsAssert ,
150+ DriverServiceCaseParamsBy : { } as DriverServiceCaseParamsBy ,
151+ DriverBrowserCaseParams : { } as DriverBrowserCaseParams ,
152+ DrowserServiceCase : { } as DrowserServiceCase ,
153+ DrowserService : { } as DrowserService ,
154+ CaseFn : { } as CaseFn ,
155+ DrowserDriverResponse : { } as DrowserDriverResponse ,
156+ AssertFunction : { } as AssertFunction ,
157+ AssertError : { } as AssertError ,
158+ IsValidHttpUrlParams : { } as IsValidHttpUrlParams ,
159159 DataPoint : { } as DataPoint ,
160160 DataSet : { } as DataSet ,
161161 MonthCount : { } as MonthCount ,
162162 MonthValue : { } as MonthValue ,
163+ ReportSchema : { } as ReportSchema ,
163164}
164165
165166export default types
0 commit comments