Skip to content

Commit b6bacdd

Browse files
author
Hung Dao
committed
initial
0 parents  commit b6bacdd

13 files changed

+1490
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
/test-results/
3+
/playwright-report/
4+
/blob-report/
5+
/playwright/.cache/

data/helper/generateData.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import moment from "moment";
2+
import { faker } from "@faker-js/faker";
3+
4+
const now = moment().format("YYYY-MM-DD");
5+
const nextOneWeek = moment().add(1, "week").format("YYYY-MM-DD");
6+
7+
export function generateValidJsonBookingPayload() {
8+
return {
9+
firstname: faker.person.firstName(),
10+
lastname: faker.person.lastName(),
11+
totalprice: faker.number.int() * 2,
12+
depositpaid: true,
13+
bookingdates: {
14+
checkin: now,
15+
checkout: nextOneWeek,
16+
},
17+
};
18+
}
19+
20+
export function generateValidXmlBookingPayload() {
21+
return `<booking>
22+
<firstname>${faker.person.firstName()}</firstname>
23+
<lastname>${faker.person.lastName()}</lastname>
24+
<totalprice>${faker.number.int() * 2}</totalprice>
25+
<depositpaid>true</depositpaid>
26+
<bookingdates>
27+
<checkin>${now}</checkin>
28+
<checkout>${nextOneWeek}</checkout>
29+
</bookingdates>
30+
31+
</booking>`;
32+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"firstname": "Jim",
3+
"lastname": "Brown",
4+
"totalprice": 111,
5+
"depositpaid": true,
6+
"bookingdates": {
7+
"checkin": "2018-01-01",
8+
"checkout": "2019-01-01"
9+
}
10+
11+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<booking>
2+
<firstname>Jim</firstname>
3+
<lastname>Brown</lastname>
4+
<totalprice>111</totalprice>
5+
<depositpaid>true</depositpaid>
6+
<bookingdates>
7+
<checkin>2018-01-01</checkin>
8+
<checkout>2019-01-01</checkout>
9+
</bookingdates>
10+
<additionalneeds>Breakfast</additionalneeds>
11+
</booking>

0 commit comments

Comments
 (0)