@smartbit4all/playwright-qa 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -1
- package/dist/core/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,10 +41,15 @@ import { initSuite } from '@smartbit4all/playwright-qa';
|
|
|
41
41
|
// With screenshots — cleans the directory and initializes it
|
|
42
42
|
initSuite({ screenshotDir: './screenshots' });
|
|
43
43
|
|
|
44
|
+
// Keep previous runs — each run creates a new timestamped subdirectory, latest symlink is updated
|
|
45
|
+
initSuite({ screenshotDir: './screenshots', cleanScreenshots: false });
|
|
46
|
+
|
|
44
47
|
// Without screenshots — tests run normally, screenshot calls return null
|
|
45
48
|
initSuite();
|
|
46
49
|
```
|
|
47
50
|
|
|
51
|
+
By default, `initSuite` deletes the screenshot directory before each run. Set `cleanScreenshots: false` to keep previous runs — useful for comparing results across runs. The `latest` symlink always points to the most recent run.
|
|
52
|
+
|
|
48
53
|
When no `screenshotDir` is provided, all screenshot functions (`screenshot`, `screenshotHighlight`, `screenshotRegion`, `screenshotRegionHighlight`) become no-ops and return `null` instead of a file path. This means TestSteps that include screenshot calls work without modification — no conditional logic needed.
|
|
49
54
|
|
|
50
55
|
## API Reference
|
|
@@ -176,7 +181,7 @@ export async function fillCompanyForm(page: Page, company: Company) {
|
|
|
176
181
|
}
|
|
177
182
|
```
|
|
178
183
|
|
|
179
|
-
##
|
|
184
|
+
## Test Designer Guide — Writing TestSuites
|
|
180
185
|
|
|
181
186
|
TestSuites are Playwright `test.describe` blocks that read like a scenario script.
|
|
182
187
|
|
package/dist/core/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface SuiteConfig {
|
|
|
6
6
|
export interface InitSuiteOptions {
|
|
7
7
|
screenshotDir?: string | null;
|
|
8
8
|
autoPrefix?: boolean;
|
|
9
|
+
cleanScreenshots?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare function initSuite(options?: InitSuiteOptions): void;
|
|
11
12
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/core/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAgB,SAAS,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAkB1D"}
|
package/dist/core/index.js
CHANGED
|
@@ -46,7 +46,8 @@ function initSuite(options) {
|
|
|
46
46
|
(0, seed_1.resetSeedHandlers)();
|
|
47
47
|
const screenshotDir = options?.screenshotDir;
|
|
48
48
|
if (screenshotDir) {
|
|
49
|
-
|
|
49
|
+
const clean = options?.cleanScreenshots ?? true;
|
|
50
|
+
if (clean && fs.existsSync(screenshotDir)) {
|
|
50
51
|
fs.rmSync(screenshotDir, { recursive: true });
|
|
51
52
|
}
|
|
52
53
|
(0, screenshot_1.initScreenshotDir)(screenshotDir);
|
package/dist/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,8BAkBC;AApCD,uCAAyB;AACzB,sCAAwC;AACxC,0CAAkD;AAClD,8CAAqF;AACrF,kCAA4C;AAc5C,SAAgB,SAAS,CAAC,OAA0B;IAClD,IAAA,oBAAW,GAAE,CAAC;IACd,IAAA,8BAAmB,GAAE,CAAC;IACtB,IAAA,+BAAkB,GAAE,CAAC;IACrB,IAAA,wBAAiB,GAAE,CAAC;IAEpB,MAAM,aAAa,GAAG,OAAO,EAAE,aAAa,CAAC;IAC7C,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,KAAK,GAAG,OAAO,EAAE,gBAAgB,IAAI,IAAI,CAAC;QAChD,IAAI,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;YAC1C,EAAE,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,CAAC;QACD,IAAA,8BAAiB,EAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED,IAAI,OAAO,EAAE,UAAU,EAAE,CAAC;QACxB,IAAA,0BAAa,EAAC,IAAI,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED