@skyramp/skyramp 1.2.31 → 1.2.33
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/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
-
export function newSkyrampPlaywrightPage(page: any): any;
|
|
2
|
+
export function newSkyrampPlaywrightPage(page: any, testInfo?: any): any;
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
5
|
export function expect(obj: any): any;
|
|
@@ -357,6 +357,11 @@ class SkyrampPlaywrightLocator {
|
|
|
357
357
|
if (error.message.includes("strict mode violation")) {
|
|
358
358
|
return this._retryWithLLM(error, this.newMultiLocatorErrorMsg());
|
|
359
359
|
}
|
|
360
|
+
if (error.message.includes("Unknown key")) {
|
|
361
|
+
let msg = error.message.split("\n")[0];
|
|
362
|
+
console.log(`${msg}, continue without execution`);
|
|
363
|
+
return undefined
|
|
364
|
+
}
|
|
360
365
|
// we do not handle the rest of the error cases, but simply forward error
|
|
361
366
|
throw error;
|
|
362
367
|
}
|
|
@@ -836,6 +841,9 @@ class SkyrampPageAssertions {
|
|
|
836
841
|
* Auto-generates baseline screenshots if missing
|
|
837
842
|
*/
|
|
838
843
|
async toHaveScreenshot(nameOrOptions, options) {
|
|
844
|
+
// wait for some time before taking snapshot
|
|
845
|
+
await this._actualObject.waitForTimeout(2000);
|
|
846
|
+
|
|
839
847
|
// If auto-baseline disabled or no testInfo, use standard Playwright behavior
|
|
840
848
|
if (!this._autoBaseline || !this._testInfo) {
|
|
841
849
|
return await this._playwrightExpectation.toHaveScreenshot(nameOrOptions, options);
|
|
@@ -892,6 +900,8 @@ function expect(obj, testInfo) {
|
|
|
892
900
|
if (!extractedTestInfo && obj._skyrampPage && obj._skyrampPage._testInfo) {
|
|
893
901
|
extractedTestInfo = obj._skyrampPage._testInfo;
|
|
894
902
|
}
|
|
903
|
+
const playwrightExpectation = playwrightExpect(actualObject);
|
|
904
|
+
return new SkyrampPageAssertions(playwrightExpectation, actualObject, extractedTestInfo);
|
|
895
905
|
}
|
|
896
906
|
if (obj instanceof SkyrampPlaywrightPage) {
|
|
897
907
|
actualObject = obj.unwrap();
|
|
@@ -899,10 +909,10 @@ function expect(obj, testInfo) {
|
|
|
899
909
|
if (!extractedTestInfo && obj._testInfo) {
|
|
900
910
|
extractedTestInfo = obj._testInfo;
|
|
901
911
|
}
|
|
912
|
+
const playwrightExpectation = playwrightExpect(actualObject);
|
|
913
|
+
return new SkyrampPageAssertions(playwrightExpectation, actualObject, extractedTestInfo);
|
|
902
914
|
}
|
|
903
|
-
|
|
904
|
-
const playwrightExpectation = playwrightExpect(actualObject);
|
|
905
|
-
return new SkyrampPageAssertions(playwrightExpectation, actualObject, extractedTestInfo);
|
|
915
|
+
return playwrightExpect(obj);
|
|
906
916
|
}
|
|
907
917
|
|
|
908
918
|
module.exports = {
|