@mirai/core 0.3.381 → 0.3.383
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 +24 -0
- package/__tests__/Booking/__mocks__/booking-delete.json +1 -0
- package/__tests__/Booking/__mocks__/booking-get.json +105 -0
- package/__tests__/Booking/booking.constants.js +8 -0
- package/__tests__/Booking/workflows/cancel.workflow.js +20 -0
- package/__tests__/Booking/workflows/index.js +5 -0
- package/__tests__/Booking/workflows/openMobileMenu.workflow.js +4 -0
- package/__tests__/Booking/workflows/print.workflow.js +13 -0
- package/__tests__/Booking/workflows/resend.workflow.js +18 -0
- package/__tests__/Booking/workflows/review.workflow.js +17 -0
- package/__tests__/Checkout/workflows/form.workflow.js +1 -1
- package/__tests__/Checkout/workflows/review.workflow.js +1 -1
- package/__tests__/Session/workflows/bookings.workflow.js +3 -3
- package/__tests__/Session/workflows/logout.workflow.js +3 -3
- package/__tests__/Session/workflows/profile.workflow.js +3 -3
- package/__tests__/Signup/workflows/index.js +1 -0
- package/__tests__/Signup/workflows/signup.workflow.js +3 -3
- package/__tests__/Signup/workflows/signupError.workflow.js +22 -0
- package/__tests__/booking.spec.jsx +34 -0
- package/__tests__/{bookingQuery/bookingQuey._spec.js → bookingQuey._spec.js} +1 -2
- package/__tests__/buttonFinder.spec.js +16 -0
- package/__tests__/{Checkout/checkout.spec.jsx → checkout.spec.jsx} +6 -4
- package/__tests__/constants.js +3 -1
- package/__tests__/{Finder/finder.spec.js → finder.spec.js} +14 -13
- package/__tests__/{Rates/rates.spec.jsx → rates.spec.jsx} +1 -1
- package/__tests__/session.spec.js +32 -0
- package/__tests__/{Signup/signup.spec.js → signup.spec.js} +8 -4
- package/build/components/Booking/Booking.js +1 -0
- package/build/components/Booking/Booking.js.map +1 -1
- package/build/components/Booking/partials/Booking.Menu.js +4 -2
- package/build/components/Booking/partials/Booking.Menu.js.map +1 -1
- package/build/components/Booking/partials/Booking.Modal.js +4 -2
- package/build/components/Booking/partials/Booking.Modal.js.map +1 -1
- package/build/components/Booking/partials/__tests__/__snapshots__/Booking.Menu.test.js.snap +20 -0
- package/build/components/Booking/partials/__tests__/__snapshots__/Booking.Modal.test.js.snap +8 -0
- package/build/components/BookingQuery/BookingQuery.js +1 -1
- package/build/components/BookingQuery/BookingQuery.js.map +1 -1
- package/build/components/ButtonFinder/ButtonFinder.js +59 -0
- package/build/components/ButtonFinder/ButtonFinder.js.map +1 -0
- package/build/components/ButtonFinder/ButtonFinder.l10n.js +13 -0
- package/build/components/ButtonFinder/ButtonFinder.l10n.js.map +1 -0
- package/build/components/ButtonFinder/ButtonFinder.module.css +17 -0
- package/build/components/ButtonFinder/__tests__/__snapshots__/ButtonFinder.test.js.snap +8380 -0
- package/build/components/ButtonFinder/index.js +13 -0
- package/build/components/ButtonFinder/index.js.map +1 -0
- package/build/components/Session/Session.Account.js +2 -3
- package/build/components/Session/Session.Account.js.map +1 -1
- package/build/components/Session/__tests__/__snapshots__/Session.test.js.snap +2 -2
- package/build/components/__shared__/ButtonPayment/components/FormSipay/__tests__/__snapshots__/FormSipay.test.js.snap +6 -6
- package/build/components/__shared__/Occupation/__tests__/__snapshots__/Occupation.test.js.snap +4 -4
- package/build/components/index.js +2 -0
- package/build/components/index.js.map +1 -1
- package/build/helpers/sanitizeComponent.js +1 -0
- package/build/helpers/sanitizeComponent.js.map +1 -1
- package/package.json +1 -1
- package/public/routes/Home.jsx +2 -1
- package/public/routes/routes.module.css +4 -1
- package/public/themes/monalisa.theme.css +11 -30
- package/__tests__/Session/session.spec.js +0 -17
package/README.md
CHANGED
|
@@ -255,6 +255,30 @@ We can also bind the elements of the session. Example:
|
|
|
255
255
|
|
|
256
256
|
@todo
|
|
257
257
|
|
|
258
|
+
## 2.13 `<ButtonFinder>`
|
|
259
|
+
|
|
260
|
+
This component is designed to encapsulate the finder component within a modal, which becomes visible when the button is pressed. This component is useful for situations where you want to present a search interface discreetly, without taking up space in the main interface until needed.
|
|
261
|
+
|
|
262
|
+
```html
|
|
263
|
+
<div data-mirai-component="button-finder"></div>
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
Similar to other components, supports ghosting.
|
|
267
|
+
|
|
268
|
+
```html
|
|
269
|
+
<div data-mirai-component="session">
|
|
270
|
+
<div data-ghost>
|
|
271
|
+
<button data-ghost>[[common.action.reserve]]</button>
|
|
272
|
+
</div>
|
|
273
|
+
</div>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
The `data-text` property allows you to change the caption of the button. This provides flexibility to customize the button text based on your needs.
|
|
277
|
+
|
|
278
|
+
```html
|
|
279
|
+
<div data-mirai-component="button-finder" data-text="Start Search"></div>
|
|
280
|
+
```
|
|
281
|
+
|
|
258
282
|
# 3. Development
|
|
259
283
|
|
|
260
284
|
You have to follow the next steps:
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{ "status": "UNKNOWN", "message": null, "data": null }
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"status": "OK",
|
|
3
|
+
"message": "",
|
|
4
|
+
"data": {
|
|
5
|
+
"id": 24080753785,
|
|
6
|
+
"pinCode": 3518230,
|
|
7
|
+
"state": 1,
|
|
8
|
+
"checkIn": "10/04/2025",
|
|
9
|
+
"checkOut": "15/04/2025",
|
|
10
|
+
"checkInTime": "12:00",
|
|
11
|
+
"checkOutTime": "17:00",
|
|
12
|
+
"currency": "EUR",
|
|
13
|
+
"contact": [{ "name": "Hal Finney" }, { "email": "hello@soyjavi.com" }, { "phone": "+1 8185551234" }],
|
|
14
|
+
"hotel": {
|
|
15
|
+
"address": "Mariano Pola, 13",
|
|
16
|
+
"city": "33212, Gijón, Asturias",
|
|
17
|
+
"country": "Spain",
|
|
18
|
+
"email": "info@mirai.com",
|
|
19
|
+
"location": [43.5402473, -5.6783805],
|
|
20
|
+
"name": "Hotel Monalisa Test ***",
|
|
21
|
+
"phone": "+34 915 91 35 00",
|
|
22
|
+
"site": "https://monalisa.mirai.com/"
|
|
23
|
+
},
|
|
24
|
+
"details": [
|
|
25
|
+
{
|
|
26
|
+
"amount": 1,
|
|
27
|
+
"image": "https://images.mirai.com/INFOROOMS/100379008/c26IDLXClcR4v3KTbRmK/c26IDLXClcR4v3KTbRmK_medium.jpg",
|
|
28
|
+
"observations": [],
|
|
29
|
+
"occupation": { "adults": 3, "children": 0, "babies": 1 },
|
|
30
|
+
"rate": "Pay now",
|
|
31
|
+
"type": "Suite",
|
|
32
|
+
"items": [
|
|
33
|
+
{ "date": "10/04/2025", "description": "", "price": 58.4, "summary": "Breakfast Included" },
|
|
34
|
+
{ "date": "11/04/2025", "description": "", "price": 58.4, "summary": "Breakfast Included" },
|
|
35
|
+
{ "date": "12/04/2025", "description": "", "price": 58.4, "summary": "Breakfast Included" },
|
|
36
|
+
{ "date": "13/04/2025", "description": "", "price": 58.4, "summary": "Breakfast Included" },
|
|
37
|
+
{ "date": "14/04/2025", "description": "", "price": 58.4, "summary": "Breakfast Included" }
|
|
38
|
+
],
|
|
39
|
+
"extras": []
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
"extras": [
|
|
43
|
+
{
|
|
44
|
+
"amount": 2,
|
|
45
|
+
"description": "Sólo si falta alguna condición o restricción que quieres que quede por escrito (este texto irá en las confirmaciones de reservas).",
|
|
46
|
+
"id": 69632,
|
|
47
|
+
"price": 40.0,
|
|
48
|
+
"summary": "For 2 adults",
|
|
49
|
+
"title": "only adults, choose adults",
|
|
50
|
+
"type": "PERSON_ONCE"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"amount": 1,
|
|
54
|
+
"id": 65573,
|
|
55
|
+
"summary": "For 1 apartment",
|
|
56
|
+
"title": "free- Por habitación / una vez:",
|
|
57
|
+
"type": "ROOM_ONCE"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"amount": 1,
|
|
61
|
+
"description": "Proin ullamcorper fringilla dui, sit amet sagittis ante porttitor ac. Phasellus at porta tellus, at ultricies neque.",
|
|
62
|
+
"id": 65349,
|
|
63
|
+
"price": 100.0,
|
|
64
|
+
"summary": "",
|
|
65
|
+
"title": "Una unidad por reserva:",
|
|
66
|
+
"type": "RESERVE_ONCE"
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"otherConditions": "This is a example of other conditions",
|
|
70
|
+
"paymentsConditions": "Prepayment required of 100%: Book now, provide your card details later. Possibility of providing the card details within 5 days.",
|
|
71
|
+
"price": {
|
|
72
|
+
"value": 565.2,
|
|
73
|
+
"base": 432.0,
|
|
74
|
+
"description": "+43.20 € VAT, +90.00 € Local taxes",
|
|
75
|
+
"prepayment": { "TPV": { "value": 475.2, "currency": "EUR" } }
|
|
76
|
+
},
|
|
77
|
+
"priceBreakdown": {
|
|
78
|
+
"basePrice": 432.0,
|
|
79
|
+
"taxes": [{ "amount": 10.0, "price": 43.2, "type": 0, "applyTo": [1, 2] }],
|
|
80
|
+
"fees": [{ "price": 90.0, "type": 1, "age": 16 }]
|
|
81
|
+
},
|
|
82
|
+
"cancelationPolicy": {
|
|
83
|
+
"summary": "Special conditions: Penalty if canceled",
|
|
84
|
+
"detail": "When the hotel receives your reservation, the total amount will be charged on your card. No refund will be made in case of cancellation, early departure or no-show (the reservation is kept up to the 1st night). If the charge to your card is denied, the hotel will cancel your reservation. "
|
|
85
|
+
},
|
|
86
|
+
"units": 1,
|
|
87
|
+
"payment": {
|
|
88
|
+
"config": {
|
|
89
|
+
"cards": ["AMERICAN_EXPRESS", "VISA", "MASTERCARD"],
|
|
90
|
+
"currencyDecimals": 2,
|
|
91
|
+
"provider": "REDUNIQ",
|
|
92
|
+
"publicKey": {},
|
|
93
|
+
"showCVV": true
|
|
94
|
+
},
|
|
95
|
+
"info": {
|
|
96
|
+
"amount": 475.2,
|
|
97
|
+
"amountRaw": 47520,
|
|
98
|
+
"cardValidation": false,
|
|
99
|
+
"time": { "value": 1723499999999, "now": 1722998010821, "deadlineExpired": false }
|
|
100
|
+
},
|
|
101
|
+
"methods": ["TPV"]
|
|
102
|
+
},
|
|
103
|
+
"postponable": false
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const PAGE_URL = 'http://local.mirai.com:8080/step3-booking';
|
|
2
|
+
|
|
3
|
+
const URL_PARAMS = {
|
|
4
|
+
DEFAULT:
|
|
5
|
+
'?code=49BBD2F87DBE604D1BBD734D12CB6F2C7682B94B&env=dev&home=http%3A%2F%2Flocal.mirai.com%3A8080%2F&idHotel=100379008&lang=en&reservationCode=24080695775&type=hotel&version=2&serverNameForSSL=reservation.mirai.com&outsideHotelDomain=true',
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export { PAGE_URL, URL_PARAMS };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
import { openMobileMenu } from './openMobileMenu.workflow';
|
|
4
|
+
|
|
5
|
+
export const cancel = async ({ isMobile, page }) => {
|
|
6
|
+
if (isMobile) await openMobileMenu({ page });
|
|
7
|
+
await page.getByTestId('booking-menu-2').click();
|
|
8
|
+
|
|
9
|
+
await page.locator('input[type="radio"][name="cancel"][value="5"]').check();
|
|
10
|
+
await page.fill(
|
|
11
|
+
'input[name="comments"]',
|
|
12
|
+
'Due to unforeseen circumstances, I need to cancel my hotel reservation. Thank you for your understanding.',
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const [response] = await Promise.all([
|
|
16
|
+
page.waitForResponse((response) => response.url().includes('/reservation') && !!response.status()),
|
|
17
|
+
await page.getByTestId('submit-button').click(),
|
|
18
|
+
]);
|
|
19
|
+
expect(response.status()).toBe(200);
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { openMobileMenu } from './openMobileMenu.workflow';
|
|
2
|
+
|
|
3
|
+
export const print = async ({ isMobile, page }) => {
|
|
4
|
+
if (isMobile) await openMobileMenu({ page });
|
|
5
|
+
|
|
6
|
+
page.on('dialog', async (dialog) => {
|
|
7
|
+
if (dialog.type() === 'print') {
|
|
8
|
+
await dialog.dismiss();
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
await page.getByTestId('booking-menu-0').click();
|
|
13
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
import { openMobileMenu } from './openMobileMenu.workflow';
|
|
4
|
+
import { USER } from '../../constants';
|
|
5
|
+
|
|
6
|
+
export const resend = async ({ isMobile, page }) => {
|
|
7
|
+
if (isMobile) await openMobileMenu({ page });
|
|
8
|
+
|
|
9
|
+
await page.getByTestId('booking-menu-1').click();
|
|
10
|
+
await page.fill('input[name="email"]', USER.email);
|
|
11
|
+
|
|
12
|
+
const [response] = await Promise.all([
|
|
13
|
+
page.waitForResponse((response) => response.url().includes('/resend_reservation') && !!response.status()),
|
|
14
|
+
page.getByTestId('submit-button').click(),
|
|
15
|
+
]);
|
|
16
|
+
|
|
17
|
+
expect(response.status()).toBe(200);
|
|
18
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
export const review = async ({ isMobile, page }) => {
|
|
4
|
+
// Expand more info
|
|
5
|
+
if (!isMobile) {
|
|
6
|
+
expect(await page.locator('text="Booking extras"').count()).toEqual(0);
|
|
7
|
+
await page.getByTestId('button-more').click();
|
|
8
|
+
}
|
|
9
|
+
await page.locator('text="Booking extras"').isVisible();
|
|
10
|
+
|
|
11
|
+
// Change language
|
|
12
|
+
const [responseError] = await Promise.all([
|
|
13
|
+
page.waitForResponse((response) => response.url().includes('/dictionary?locale=es-ES') && !!response.status()),
|
|
14
|
+
page.locator('select[name="locale"]').selectOption('Español'),
|
|
15
|
+
]);
|
|
16
|
+
expect(responseError.status()).toBe(200);
|
|
17
|
+
};
|
|
@@ -12,6 +12,6 @@ export const form = async ({ page }) => {
|
|
|
12
12
|
|
|
13
13
|
// User submits but forgots privacy policy
|
|
14
14
|
await page.getByTestId('checkout-button').click();
|
|
15
|
-
await page.waitForSelector('ui-notification', { state: 'visible' });
|
|
15
|
+
await page.waitForSelector('ui-notification-error', { state: 'visible' });
|
|
16
16
|
await page.locator('ui-checkout form input[name="privacyPolicy"]').check();
|
|
17
17
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect } from '@playwright/test';
|
|
2
2
|
|
|
3
|
-
export const bookings = async ({ page }) => {
|
|
4
|
-
await page.getByTestId('show-
|
|
5
|
-
await page.getByTestId(
|
|
3
|
+
export const bookings = async ({ isMobile, page }) => {
|
|
4
|
+
await page.getByTestId('show-profile-menu').click();
|
|
5
|
+
await page.getByTestId(`profile-menu-${isMobile ? 2 : 1}`).click();
|
|
6
6
|
|
|
7
7
|
await page.waitForURL(/\/profile/, { waitUntil: 'networkidle', timeout: 10000 });
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { expect } from '@playwright/test';
|
|
2
2
|
|
|
3
|
-
export const logout = async ({ page }) => {
|
|
4
|
-
await page.getByTestId('show-
|
|
5
|
-
await page.getByTestId(
|
|
3
|
+
export const logout = async ({ isMobile, page }) => {
|
|
4
|
+
await page.getByTestId('show-profile-menu').click();
|
|
5
|
+
await page.getByTestId(`profile-menu-${isMobile ? 3 : 2}`).click();
|
|
6
6
|
|
|
7
7
|
await expect(page.getByTestId('show-login')).toBeVisible();
|
|
8
8
|
};
|
|
@@ -5,9 +5,9 @@ import { SESSION, USER } from '../../constants';
|
|
|
5
5
|
// ! TODO: Somehow we should close the notifications
|
|
6
6
|
// import { closeNotification } from '../../helpers';
|
|
7
7
|
|
|
8
|
-
export const profile = async ({ page }) => {
|
|
9
|
-
await page.getByTestId('show-
|
|
10
|
-
await page.getByTestId(
|
|
8
|
+
export const profile = async ({ isMobile, page }) => {
|
|
9
|
+
await page.getByTestId('show-profile-menu').click();
|
|
10
|
+
await page.getByTestId(`profile-menu-${isMobile ? 1 : 0}`).click();
|
|
11
11
|
|
|
12
12
|
await page.waitForURL(/\/profile/, { waitUntil: 'networkidle', timeout: 10000 });
|
|
13
13
|
|
|
@@ -5,7 +5,7 @@ import { USER } from '../../constants';
|
|
|
5
5
|
export const signup = async ({ page }) => {
|
|
6
6
|
await page.fill('ui-signup input[name="firstName"]', USER.firstName);
|
|
7
7
|
await page.fill('ui-signup input[name="lastName"]', USER.lastName);
|
|
8
|
-
await page.fill('ui-signup input[name="email"]',
|
|
8
|
+
await page.fill('ui-signup input[name="email"]', `${new Date().getTime()}@mail.com`);
|
|
9
9
|
await page.fill('ui-signup input[name="dateOfBirth"]', USER.dateOfBirth);
|
|
10
10
|
await page.locator('ui-signup select[name="country"]').selectOption('United States');
|
|
11
11
|
await page.fill('ui-signup input[name="password"]', USER.password);
|
|
@@ -13,7 +13,7 @@ export const signup = async ({ page }) => {
|
|
|
13
13
|
|
|
14
14
|
// User forgot some fields
|
|
15
15
|
await page.getByTestId('signup-button').click();
|
|
16
|
-
await page.waitForSelector('ui-notification', { state: 'visible' });
|
|
16
|
+
await page.waitForSelector('ui-notification-error', { state: 'visible' });
|
|
17
17
|
await page.locator('input[name="privacy"]').check();
|
|
18
18
|
|
|
19
19
|
// Success
|
|
@@ -22,5 +22,5 @@ export const signup = async ({ page }) => {
|
|
|
22
22
|
page.getByTestId('signup-button').click(),
|
|
23
23
|
]);
|
|
24
24
|
|
|
25
|
-
expect(responseError.status()).toBe(
|
|
25
|
+
expect(responseError.status()).toBe(201);
|
|
26
26
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { expect } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
import { USER } from '../../constants';
|
|
4
|
+
|
|
5
|
+
export const signupError = async ({ page }) => {
|
|
6
|
+
await page.fill('ui-signup input[name="firstName"]', USER.firstName);
|
|
7
|
+
await page.fill('ui-signup input[name="lastName"]', USER.lastName);
|
|
8
|
+
await page.fill('ui-signup input[name="email"]', USER.email);
|
|
9
|
+
await page.fill('ui-signup input[name="dateOfBirth"]', USER.dateOfBirth);
|
|
10
|
+
await page.locator('ui-signup select[name="country"]').selectOption('United States');
|
|
11
|
+
await page.fill('ui-signup input[name="password"]', USER.password);
|
|
12
|
+
await page.locator('ui-signup input[name="subscribed"]').check();
|
|
13
|
+
await page.locator('input[name="privacy"]').check();
|
|
14
|
+
|
|
15
|
+
// Success
|
|
16
|
+
const [responseError] = await Promise.all([
|
|
17
|
+
page.waitForResponse((response) => response.url().includes('/join') && !!response.status()),
|
|
18
|
+
page.getByTestId('signup-button').click(),
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
expect(responseError.status()).toBe(409);
|
|
22
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { test } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
import { PAGE_URL, URL_PARAMS } from './Booking/booking.constants';
|
|
4
|
+
import { cancel, print, resend, review } from './Booking/workflows';
|
|
5
|
+
|
|
6
|
+
test.beforeEach(async ({ context, page }) => {
|
|
7
|
+
await context.addInitScript(() => (window.IS_PLAYWRIGHT = true));
|
|
8
|
+
|
|
9
|
+
await page.route('https://reservation.mirai.com/XMAS/reservation/v2/booking/*', (route) => {
|
|
10
|
+
route.fulfill({
|
|
11
|
+
status: 200,
|
|
12
|
+
contentType: 'application/json',
|
|
13
|
+
body: JSON.stringify(require(`./Booking/__mocks__/booking-${route.request().method().toLowerCase()}.json`)),
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
await page.goto(`${PAGE_URL}${URL_PARAMS.DEFAULT}`, { waitUntil: 'networkidle', timeout: 10000 });
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test(`Review`, async ({ isMobile, page }) => {
|
|
21
|
+
await review({ isMobile, page });
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test(`Print`, async ({ isMobile, page }) => {
|
|
25
|
+
await print({ isMobile, page });
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test(`Resend`, async ({ isMobile, page }) => {
|
|
29
|
+
await resend({ isMobile, page });
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
test(`Cancel`, async ({ isMobile, page }) => {
|
|
33
|
+
await cancel({ isMobile, page });
|
|
34
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { test } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
const testId = `button-finder`;
|
|
4
|
+
|
|
5
|
+
test.beforeEach(async ({ context, page }) => {
|
|
6
|
+
await context.addInitScript(() => (window.IS_PLAYWRIGHT = true));
|
|
7
|
+
|
|
8
|
+
await page.goto('http://local.mirai.com:8080', { waitUntil: 'networkidle', timeout: 10000 });
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('Open & Close', async ({ page }) => {
|
|
12
|
+
await page.getByTestId(`${testId}-button-modal`).click();
|
|
13
|
+
await page.waitForTimeout(300);
|
|
14
|
+
await page.getByTestId(`${testId}-modal-button-close`).click();
|
|
15
|
+
await page.waitForTimeout(300);
|
|
16
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { test } from '@playwright/test';
|
|
2
2
|
|
|
3
|
-
import { PAGE_URL, URL_PARAMS } from './checkout.constants';
|
|
4
|
-
import { form, payment, review, submit } from './workflows';
|
|
3
|
+
import { PAGE_URL, URL_PARAMS } from './Checkout/checkout.constants';
|
|
4
|
+
import { form, payment, review, submit } from './Checkout/workflows';
|
|
5
5
|
|
|
6
6
|
const PAYMENTS = ['PAYLATER', 'TPV', 'TRANSFER'];
|
|
7
7
|
|
|
@@ -16,7 +16,9 @@ const enviroment = async ({ page, payment }) => {
|
|
|
16
16
|
route.fulfill({
|
|
17
17
|
status: 200,
|
|
18
18
|
contentType: 'application/json',
|
|
19
|
-
body: JSON.stringify(
|
|
19
|
+
body: JSON.stringify(
|
|
20
|
+
require(`./Checkout/__mocks__/checkout-${method}${method === 'post' ? `-${payment}` : ''}.json`),
|
|
21
|
+
),
|
|
20
22
|
});
|
|
21
23
|
});
|
|
22
24
|
|
|
@@ -24,7 +26,7 @@ const enviroment = async ({ page, payment }) => {
|
|
|
24
26
|
};
|
|
25
27
|
|
|
26
28
|
PAYMENTS.forEach((paymentId) => {
|
|
27
|
-
test(`
|
|
29
|
+
test(`Payment w/ ${paymentId}`, async ({ page }) => {
|
|
28
30
|
await enviroment({ page, payment: paymentId });
|
|
29
31
|
|
|
30
32
|
await form({ page });
|
package/__tests__/constants.js
CHANGED
|
@@ -1,40 +1,41 @@
|
|
|
1
1
|
import { expect, test } from '@playwright/test';
|
|
2
2
|
|
|
3
|
-
import { calendar, occupation, promocode } from './workflows';
|
|
3
|
+
import { calendar, occupation, promocode } from './Finder/workflows';
|
|
4
4
|
|
|
5
5
|
const testId = 'finder';
|
|
6
6
|
|
|
7
7
|
test.beforeEach(async ({ context, page }) => {
|
|
8
8
|
await context.addInitScript(() => (window.IS_PLAYWRIGHT = true));
|
|
9
|
-
|
|
9
|
+
|
|
10
|
+
await page.goto('http://local.mirai.com:8080', { waitUntil: 'networkidle', timeout: 10000 });
|
|
10
11
|
});
|
|
11
12
|
|
|
12
|
-
test('
|
|
13
|
+
test('Search (default)', async ({ page }) => {
|
|
13
14
|
await calendar({ page, testId });
|
|
14
15
|
await page.getByTestId(`${testId}-submit`).click();
|
|
15
16
|
|
|
16
|
-
await expect(page).toHaveURL(/.*step1-rates/, { timeout:
|
|
17
|
+
await expect(page).toHaveURL(/.*step1-rates/, { timeout: 10000 });
|
|
17
18
|
});
|
|
18
19
|
|
|
19
|
-
test('
|
|
20
|
+
test('Search w/ +1 adult', async ({ isMobile, page }) => {
|
|
20
21
|
await calendar({ isMobile, page, testId });
|
|
21
22
|
await occupation({ addAdult: true, isMobile, page, testId });
|
|
22
23
|
|
|
23
24
|
await page.getByTestId(`${testId}-submit`).click();
|
|
24
25
|
|
|
25
|
-
await expect(page).toHaveURL(/.*step1-rates/, { timeout:
|
|
26
|
+
await expect(page).toHaveURL(/.*step1-rates/, { timeout: 10000 });
|
|
26
27
|
});
|
|
27
28
|
|
|
28
|
-
test('
|
|
29
|
+
test('Search w/ +1 child', async ({ isMobile, page }) => {
|
|
29
30
|
await calendar({ isMobile, page, testId });
|
|
30
31
|
await occupation({ addChild: true, isMobile, page, testId });
|
|
31
32
|
|
|
32
33
|
await page.getByTestId(`${testId}-submit`).click();
|
|
33
34
|
|
|
34
|
-
await expect(page).toHaveURL(/.*step1-rates/, { timeout:
|
|
35
|
+
await expect(page).toHaveURL(/.*step1-rates/, { timeout: 10000 });
|
|
35
36
|
});
|
|
36
37
|
|
|
37
|
-
test('
|
|
38
|
+
test('Search w/ +1 child widhout age', async ({ isMobile, page }) => {
|
|
38
39
|
await calendar({ isMobile, page, testId });
|
|
39
40
|
await occupation({ addAgeChild: false, addChild: true, isMobile, page, testId });
|
|
40
41
|
|
|
@@ -44,21 +45,21 @@ test('Finder search with child added and not age', async ({ isMobile, page }) =>
|
|
|
44
45
|
else await expect(page.getByTestId(`${testId}-occupation`)).toBeVisible();
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
test('
|
|
48
|
+
test('Search w/ promocode', async ({ isMobile, page }) => {
|
|
48
49
|
await calendar({ isMobile, page, testId });
|
|
49
50
|
await promocode({ isMobile, page, testId });
|
|
50
51
|
|
|
51
52
|
await page.getByTestId(`${testId}-submit`).click();
|
|
52
53
|
|
|
53
|
-
await expect(page).toHaveURL(/.*step1-rates/, { timeout:
|
|
54
|
+
await expect(page).toHaveURL(/.*step1-rates/, { timeout: 10000 });
|
|
54
55
|
});
|
|
55
56
|
|
|
56
|
-
test('
|
|
57
|
+
test('Search w/ +1 adult & promocode', async ({ isMobile, page }) => {
|
|
57
58
|
await calendar({ isMobile, page, testId });
|
|
58
59
|
await occupation({ addAdult: true, isMobile, page, testId });
|
|
59
60
|
await promocode({ isMobile, page, testId });
|
|
60
61
|
|
|
61
62
|
await page.getByTestId(`${testId}-submit`).click();
|
|
62
63
|
|
|
63
|
-
await expect(page).toHaveURL(/.step1-rates/, { timeout:
|
|
64
|
+
await expect(page).toHaveURL(/.step1-rates/, { timeout: 10000 });
|
|
64
65
|
});
|
|
@@ -9,7 +9,7 @@ test('Rates workflows', async ({ page }) => {
|
|
|
9
9
|
route.fulfill({
|
|
10
10
|
status: 200,
|
|
11
11
|
contentType: 'application/json',
|
|
12
|
-
body: JSON.stringify(require('./__mocks__/rates-success.json')),
|
|
12
|
+
body: JSON.stringify(require('./Rates/__mocks__/rates-success.json')),
|
|
13
13
|
});
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { test } from '@playwright/test';
|
|
2
|
+
|
|
3
|
+
import { bookings, forgotPassword, login, logout, profile } from './Session/workflows';
|
|
4
|
+
|
|
5
|
+
test.beforeEach(async ({ context, page }) => {
|
|
6
|
+
await context.addInitScript(() => (window.IS_PLAYWRIGHT = true));
|
|
7
|
+
|
|
8
|
+
await page.goto('http://local.mirai.com:8080', { waitUntil: 'networkidle', timeout: 10000 });
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
test('Login', async ({ isMobile, page }) => {
|
|
12
|
+
await login({ isMobile, page });
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
test('Edit profile', async ({ isMobile, page }) => {
|
|
16
|
+
await login({ isMobile, page });
|
|
17
|
+
await profile({ isMobile, page });
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test('View bookings', async ({ isMobile, page }) => {
|
|
21
|
+
await login({ isMobile, page });
|
|
22
|
+
await bookings({ isMobile, page });
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test('Logout', async ({ isMobile, page }) => {
|
|
26
|
+
await login({ isMobile, page });
|
|
27
|
+
await logout({ isMobile, page });
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('Forgot password', async ({ isMobile, page }) => {
|
|
31
|
+
await forgotPassword({ isMobile, page });
|
|
32
|
+
});
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { test } from '@playwright/test';
|
|
2
2
|
|
|
3
|
-
import { signup } from './workflows';
|
|
3
|
+
import { signup, signupError } from './Signup/workflows';
|
|
4
4
|
|
|
5
|
-
test.beforeEach(async ({ context }) => {
|
|
5
|
+
test.beforeEach(async ({ context, page }) => {
|
|
6
6
|
await context.addInitScript(() => (window.IS_PLAYWRIGHT = true));
|
|
7
|
-
});
|
|
8
7
|
|
|
9
|
-
test('Signup workflows', async ({ page }) => {
|
|
10
8
|
await page.goto('http://local.mirai.com:8080/signup', { waitUntil: 'networkidle', timeout: 10000 });
|
|
9
|
+
});
|
|
11
10
|
|
|
11
|
+
test('Signup', async ({ page }) => {
|
|
12
12
|
await signup({ page });
|
|
13
13
|
});
|
|
14
|
+
|
|
15
|
+
test('User already exists', async ({ page }) => {
|
|
16
|
+
await signupError({ page });
|
|
17
|
+
});
|
|
@@ -130,6 +130,7 @@ const Booking = _ref => {
|
|
|
130
130
|
}), /*#__PURE__*/_react.default.createElement(_shared__.BookingDetails, {
|
|
131
131
|
dataSource,
|
|
132
132
|
expanded,
|
|
133
|
+
expanded: isMobile,
|
|
133
134
|
className: style.box
|
|
134
135
|
}), /*#__PURE__*/_react.default.createElement(_shared__.BookingTerms, {
|
|
135
136
|
dataSource: dataSource,
|