aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2018-08-29 17:01:32 +0300
committerIttay Stern <ittay.stern@att.com>2019-02-18 18:35:30 +0200
commit6f900cc45d7dd7f97430812b86b5c1d1693c8ae3 (patch)
tree936005c364dc5a7264d6304d4777c3d83494db22 /vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts
parent67d99f816cc583643c35193197594cf78d8ce60a (diff)
merge from ecomp a88f0072 - Modern UI
Issue-ID: VID-378 Change-Id: Ibcb23dd27f550cf32ce2fe0239f0f496ae014ff6 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts')
-rw-r--r--vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts b/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts
index 0bab4e1da..2583d46a1 100644
--- a/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts
+++ b/vid-webpack-master/cypress/support/jsonBuilders/jsonBuilder.ts
@@ -1,6 +1,9 @@
export class JsonBuilder<T> implements IJsonBuilder<T>{
- currentValue: T;
+ currentValue?: T;
+ constructor(currentValue ?: T){
+ this.currentValue = currentValue;
+ }
public basicJson(json: JSON, url: string, status: number, delay: number, alias: string, changeResFunc?: Function) : void {
this.currentValue = <T>JSON.parse(JSON.stringify(json));
this.currentValue = changeResFunc ? changeResFunc(this.currentValue) : this.currentValue;
@@ -17,9 +20,9 @@ export class JsonBuilder<T> implements IJsonBuilder<T>{
response: JSON.stringify(this.currentValue)
}).as(alias);
}
- public basicMock(jsonPath: string, url: string) {
+ public basicMock(jsonPath: string, url: string ,changeResFunc?: Function) {
cy.readFile(jsonPath).then((res) => {
- this.basicJson(res, url, 200, 0, url,);
+ this.basicJson(res, url, 200, 0, url, changeResFunc);
})
}
}