Skip to content

Commit da75e5b

Browse files
committed
Fixing afterTest
1 parent a4673da commit da75e5b

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

eform-client/wdio-headless-plugin-step2.conf.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import type { Options } from '@wdio/types'
33
import { $ } from '@wdio/globals';
44

5-
export const config: Options.Testrunner = {
6-
runner: 'local',
7-
path: '/',
5+
export const config: WebdriverIO.Config = {
6+
runner: 'local',
7+
path: '/',
88
//
99
// ==================
1010
// Specify Test Files
@@ -238,29 +238,30 @@ export const config: Options.Testrunner = {
238238
}
239239

240240
/*
241-
* get the current date and clean it
242-
* const date = (new Date()).toString().replace(/\s/g, '-').replace(/-\(\w+\)/, '');
243-
*/
241+
* get the current date and clean it
242+
* const date = (new Date()).toString().replace(/\s/g, '-').replace(/-\(\w+\)/, '');
243+
*/
244244
//const { browserName } = browser.desiredCapabilities;
245245
const timestamp = new Date().toLocaleString('iso', {
246246
year: 'numeric',
247247
month: '2-digit',
248248
day: '2-digit',
249249
hour: '2-digit',
250250
minute: '2-digit',
251+
second: '2-digit',
251252
hour12: false
252253
}).replace(/[ ]/g, '--').replace(':', '-');
253254

254255
// get current test title and clean it, to use it as file name
255256
const filename = encodeURIComponent(
256-
`${
257-
test.fullTitle.replace(/\s+/g, '-')
258-
}-chrome-${timestamp}`.replace(/[/]/g, '__')
257+
`chrome-${timestamp}`.replace(/[/]/g, '__')
259258
).replace(/%../, '.');
260259

261260
const filePath = path.resolve(this.screenshotPath, `${filename}.png`);
262261

262+
console.log('Saving screenshot to:', filePath);
263263
browser.saveScreenshot(filePath);
264+
console.log('Saved screenshot to:', filePath);
264265
},
265266
/**
266267
* Hook that gets executed after the suite has ended

0 commit comments

Comments
 (0)