Skip to content

Commit b88f31b

Browse files
committed
playwright/cdp.js add more assertions
1 parent 2188ad0 commit b88f31b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

playwright/cdp.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,24 @@ for (var run = 0; run<runs; run++) {
8989

9090
// console.log(res);
9191

92+
// assertions
93+
if (res['price'] != 244.99) {
94+
console.log(res);
95+
throw new Error("invalid product price");
96+
}
97+
if (res['image'] != "images/nomad_000.jpg") {
98+
console.log(res);
99+
throw new Error("invalid product image");
100+
}
101+
if (res['related'].length != 3) {
102+
console.log(res);
103+
throw new Error("invalid products related length");
104+
}
105+
if (res['reviews'].length != 3) {
106+
console.log(res);
107+
throw new Error("invalid reviews length");
108+
}
109+
92110
process.stderr.write('.');
93111
if(run > 0 && run % 80 == 0) process.stderr.write('\n');
94112

0 commit comments

Comments
 (0)