Fixed waiting issue, added test retry number to screenshot path.

This commit is contained in:
Michel Kaporin 2017-06-21 11:11:03 +02:00
parent 919d3feca4
commit 264b773bf2
2 changed files with 5 additions and 5 deletions

View file

@ -12,11 +12,11 @@ export class Screenshot {
private index: number = 0;
private testPath: string;
constructor(private spectron: SpectronApplication, testName: string) {
constructor(private spectron: SpectronApplication, testName: string, testRetry: number) {
const testTime = this.sanitizeFolderName(__testTime);
testName = this.sanitizeFolderName(testName);
this.testPath = `test_data/screenshots/${testTime}/${testName}`;
this.testPath = `test_data/screenshots/${testTime}/${testName}/${testRetry}`;
this.createFolder(this.testPath);
}

View file

@ -54,9 +54,9 @@ export class SpectronApplication {
args: args,
chromeDriverArgs: chromeDriverArgs
});
this.screenshot = new Screenshot(this, testName);
this.client = new SpectronClient(this.spectron, this.screenshot);
this.testRetry += 1; // avoid multiplication by 0 for wait times
this.screenshot = new Screenshot(this, testName, testRetry);
this.client = new SpectronClient(this.spectron, this.screenshot);
this.retrieveKeybindings();
}
@ -129,7 +129,7 @@ export class SpectronApplication {
break;
}
this.wait();
await this.wait();
trial++;
}
});