@mirai/core 0.1.11 → 0.1.13

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/.env CHANGED
@@ -3,6 +3,7 @@ BUNDLE_LOCALHOST=http://local.mirai.com:9090/dist/index.js?version=localhost
3
3
 
4
4
  METRICS=8499ad730df132d03f1d532e287a9920
5
5
 
6
+ SERVICE_BOOKING=https://reservation-pre.mirai.com/XMAS/reservation
6
7
  SERVICE_CLUB=https://api.mirai.com
7
8
  SERVICE_ENGINE=https://engine.mirai.com
8
9
  SERVICE_STATIC=https://static.mirai.com
package/README.md CHANGED
@@ -1 +1,104 @@
1
1
  # @mirai/core
2
+
3
+ # 1. Installation
4
+
5
+ The installation of the new mirai's core is very simple. You will simply have to add 2 files inside your html page.
6
+
7
+ ## 1.1 Requirements
8
+
9
+ The first one will be our styles file for the default theme. This file only contains css variable assignments, so it will never conflict with any other css files you have. Here you have an example of how you should instantiate it:
10
+
11
+ ```html
12
+ <head>
13
+ <link rel="stylesheet" href="https://static.mirai.com/core/theme.css" rel="preload" defer />
14
+ ...
15
+ </head>
16
+ ```
17
+
18
+ The next file we need is our component repository file. This JavaScript file provides an asynchronous loading system for components, so it will not influence the overall loading of your html page much. Here you have an example of how you should instantiate it:
19
+
20
+ ```html
21
+ ...
22
+ <script type="module" defer src="https://static.mirai.com/core/index.js"></script>
23
+ </body>
24
+ ```
25
+
26
+ ## 1.2 Creating a data repository instance
27
+
28
+ Once the two main files of our new core are instantiated, we need to indicate which data repository we want to load. For this we will use an html element within our html page:
29
+
30
+ ```html
31
+ <body>
32
+ <div data-mirai-id="501404" hidden></div>
33
+ ...
34
+ </body>
35
+ ```
36
+
37
+ The attributes that we can set in this instance are:
38
+
39
+ - `data-mirai-id`: the hotel or chain identifier.
40
+ - `data-type`: `hotel` or `chain` instance type (default is `hotel`)
41
+ - `data-locale`: in case we want to set a different language locale than the default.
42
+ - `data-currency`: in case we want to set a currency than the default.
43
+
44
+ Here you have an complete example using all these attributes:
45
+
46
+ ```html
47
+ <body>
48
+ <div data-mirai-id="500255" data-type="chain" data-currency="JPY" data-locale="ja-JA" hidden></div>
49
+ ...
50
+ </body>
51
+ ```
52
+
53
+ ## 1.3 Environments
54
+
55
+ Our new core has different execution environments. These differ for the most part in the way they have been compiled.
56
+
57
+ - `production` (https://static.mirai.com) the bundle has been generated by minifying and obfuscating the largest code base possible.
58
+ - `development` (https://static-pre.mirai.com) the bundle has been generated in development mode with _sourceMaps_ as well as the access to the services is also in development mode.
59
+
60
+ # 2. Components
61
+
62
+ To instantiate any component from the core repository we have to take into account these properties common to all components:
63
+
64
+ - `data-mirai-component:string`: ndicates the name of the component to instantiate
65
+ - `data-mobile:bool`: if you only want to instantiate the component in a mobile environment.
66
+ - `data-desktop:bool`: if you only want to instantiate the component in a non mobile environment.
67
+
68
+ Here you have an example of how you should instantiate it:
69
+
70
+ ```html
71
+ <div data-mirai-component="finder" data-mobile="true"></div>
72
+ ```
73
+
74
+ It should also be noted that some components may offer the _ghosting_ system. This means that that component can receive different html markup than the default component provides. Let's see a naive example:
75
+
76
+ ```html
77
+ <div data-mirai-component="session">
78
+ <button>Login here</button>
79
+ </div>
80
+ ```
81
+
82
+ > In this example we replace the html markup with a `<button>` with the content `Login Here`
83
+
84
+ ## 2.1 `<BookingQuery>`
85
+
86
+ This component shows a modal in which it asks the user for the `bookingId` and `pinCode` if both fields are correct, it redirects to the page to manage the reservation.
87
+
88
+ ```html
89
+ <div data-mirai-component="bookingQuery"></div>
90
+ ```
91
+
92
+ ## 2.2 `<Deals>`
93
+
94
+ This component displays a form to be able to search for rooms with a certain offer. This form contains 3 fields:
95
+
96
+ - `calendar` (check-in & check-out)
97
+ - `occupation`
98
+ - `promocode`
99
+
100
+ ```html
101
+ <div data-mirai-component="deals" data-id="293842"></div>
102
+ ```
103
+
104
+ This component needs a `data-id` property that will contain the `id` of the offer to display.
@@ -0,0 +1,52 @@
1
+ // @ts-check
2
+ const { test, expect } = require('@playwright/test');
3
+
4
+ const BOOKING_QUERY = 'bookingQuery';
5
+ const CORRECT_ID = '23011372299';
6
+ const CORRECT_PIN_CODE = '7950376';
7
+ const INCORRECT_ID = '123456789';
8
+ const INCORRECT_PIN_CODE = '123456';
9
+
10
+ //TODO: The tests execute in NODE_ENV=production but we don't have a booking in production yet. In preproduction we have a booking
11
+ process.env.SERVICE_USER = 'https://api-pre.mirai.com';
12
+
13
+ const executeTest = async (id, page, pinCode) => {
14
+ await page.goto('http://localhost:8080/e2e');
15
+
16
+ await expect(page.locator('form')).not.toBeVisible();
17
+ await page.getByTestId(`${BOOKING_QUERY}-button-open-modal`).click();
18
+ await expect(page.locator('form')).toBeVisible();
19
+ await expect(page.getByTestId(`${BOOKING_QUERY}-button-cta`)).toBeDisabled();
20
+
21
+ await page.getByTestId(`${BOOKING_QUERY}-input-id`).click();
22
+ await page.getByTestId(`${BOOKING_QUERY}-input-id`).fill(id);
23
+ await expect(page.getByTestId(`${BOOKING_QUERY}-button-cta`)).toBeDisabled();
24
+
25
+ await page.getByTestId(`${BOOKING_QUERY}-input-pinCode`).click();
26
+ await page.getByTestId(`${BOOKING_QUERY}-input-pinCode`).fill(pinCode);
27
+ await expect(page.getByTestId(`${BOOKING_QUERY}-button-cta`)).toBeEnabled();
28
+
29
+ await expect(page.getByTestId(`${BOOKING_QUERY}-notification-error`)).not.toBeVisible();
30
+ await page.getByTestId(`${BOOKING_QUERY}-button-cta`).click();
31
+ await page.waitForResponse((response) => response.url().includes('login_reservation') && response.status() === 200);
32
+ };
33
+
34
+ test('incorrect id and pinCode booking', async ({ page }) => {
35
+ await executeTest(INCORRECT_ID, page, INCORRECT_PIN_CODE);
36
+ await expect(page.getByTestId(`${BOOKING_QUERY}-notification-error`)).toBeVisible();
37
+ });
38
+
39
+ test('incorrect id and correct pinCode booking', async ({ page }) => {
40
+ await executeTest(INCORRECT_ID, page, CORRECT_PIN_CODE);
41
+ await expect(page.getByTestId(`${BOOKING_QUERY}-notification-error`)).toBeVisible();
42
+ });
43
+
44
+ test('correct id and incorrect pinCode booking', async ({ page }) => {
45
+ await executeTest(CORRECT_ID, page, INCORRECT_PIN_CODE);
46
+ await expect(page.getByTestId(`${BOOKING_QUERY}-notification-error`)).toBeVisible();
47
+ });
48
+
49
+ test('correct id and correct pinCode booking', async ({ page }) => {
50
+ await executeTest(CORRECT_ID, page, CORRECT_PIN_CODE);
51
+ await expect(page).toHaveURL(/.*forwarder_manage_reservation*/);
52
+ });
package/build/Core.js CHANGED
@@ -60,6 +60,7 @@ const Core = _ref => {
60
60
  fallback: /*#__PURE__*/_react.default.createElement("small", null, "Loading...")
61
61
  }, /*#__PURE__*/_react.default.createElement(_components.default[component], {
62
62
  ...props,
63
+ ['data-testid']: (process && process.env && process.env.NODE_ENV || "production") === 'production' ? component : undefined,
63
64
  ghost: ghosts[index],
64
65
  el
65
66
  })), el);
package/build/Core.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Core.js","names":["ghosts","Core","children","components","value","currency","locale","DEFAULT_LOCALE","useStore","isMobile","isDesktop","useDevice","dictionary","setDictionary","useState","useEffect","next","ServiceDictionary","get","filter","desktop","mobile","map","index","el","component","props","getGhost","ReactDOM","createPortal","React","createElement","COMPONENTS","ghost","propTypes","PropTypes","node","arrayOf","shape","oneOf","Object","keys","any"],"sources":["../src/Core.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { DEFAULT_LOCALE, LocaleProvider } from '@mirai/locale';\nimport { ServiceDictionary } from '@mirai/services';\nimport { useDevice } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useState, Suspense } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport COMPONENTS from './components';\nimport { getGhost } from './helpers';\n\nconst ghosts = {};\n\nconst Core = ({ children, components = [] }) => {\n const {\n value: { currency, locale = DEFAULT_LOCALE },\n } = useStore();\n\n const { isMobile, isDesktop } = useDevice();\n const [dictionary, setDictionary] = useState();\n\n useEffect(() => {\n (async () => {\n const next = await ServiceDictionary.get(locale);\n if (next) setDictionary(next);\n })();\n }, [locale]);\n\n return (\n <LocaleProvider {...{ currency, dictionary, locale }}>\n <>\n {components\n .filter(({ desktop, mobile }) => !(isMobile && mobile === 'false') && !(isDesktop && desktop === 'false'))\n .map(({ el, component, ...props }, index) => {\n if (!ghosts[index]) ghosts[index] = getGhost(el);\n\n return ReactDOM.createPortal(\n <Suspense fallback={<small>Loading...</small>}>\n {React.createElement(COMPONENTS[component], { ...props, ghost: ghosts[index], el })}\n </Suspense>,\n el,\n );\n })}\n </>\n {children}\n </LocaleProvider>\n );\n};\n\nCore.propTypes = {\n children: PropTypes.node,\n components: PropTypes.arrayOf(\n PropTypes.shape({\n component: PropTypes.oneOf(Object.keys(COMPONENTS)),\n el: PropTypes.any,\n }),\n ),\n};\n\nexport { Core };\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAqC;AAAA;AAAA;AAErC,MAAMA,MAAM,GAAG,CAAC,CAAC;AAEjB,MAAMC,IAAI,GAAG,QAAmC;EAAA,IAAlC;IAAEC,QAAQ;IAAEC,UAAU,GAAG;EAAG,CAAC;EACzC,MAAM;IACJC,KAAK,EAAE;MAAEC,QAAQ;MAAEC,MAAM,GAAGC;IAAe;EAC7C,CAAC,GAAG,IAAAC,qBAAQ,GAAE;EAEd,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAG,IAAAC,aAAS,GAAE;EAC3C,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,GAAE;EAE9C,IAAAC,gBAAS,EAAC,MAAM;IACd,CAAC,YAAY;MACX,MAAMC,IAAI,GAAG,MAAMC,2BAAiB,CAACC,GAAG,CAACZ,MAAM,CAAC;MAChD,IAAIU,IAAI,EAAEH,aAAa,CAACG,IAAI,CAAC;IAC/B,CAAC,GAAG;EACN,CAAC,EAAE,CAACV,MAAM,CAAC,CAAC;EAEZ,oBACE,6BAAC,sBAAc;IAAOD,QAAQ;IAAEO,UAAU;IAAEN;EAAM,gBAChD,4DACGH,UAAU,CACRgB,MAAM,CAAC;IAAA,IAAC;MAAEC,OAAO;MAAEC;IAAO,CAAC;IAAA,OAAK,EAAEZ,QAAQ,IAAIY,MAAM,KAAK,OAAO,CAAC,IAAI,EAAEX,SAAS,IAAIU,OAAO,KAAK,OAAO,CAAC;EAAA,EAAC,CACzGE,GAAG,CAAC,QAA8BC,KAAK,KAAK;IAAA,IAAvC;MAAEC,EAAE;MAAEC,SAAS;MAAE,GAAGC;IAAM,CAAC;IAC/B,IAAI,CAAC1B,MAAM,CAACuB,KAAK,CAAC,EAAEvB,MAAM,CAACuB,KAAK,CAAC,GAAG,IAAAI,iBAAQ,EAACH,EAAE,CAAC;IAEhD,oBAAOI,iBAAQ,CAACC,YAAY,eAC1B,6BAAC,eAAQ;MAAC,QAAQ,eAAE;IAA0B,gBAC3CC,cAAK,CAACC,aAAa,CAACC,mBAAU,CAACP,SAAS,CAAC,EAAE;MAAE,GAAGC,KAAK;MAAEO,KAAK,EAAEjC,MAAM,CAACuB,KAAK,CAAC;MAAEC;IAAG,CAAC,CAAC,CAC1E,EACXA,EAAE,CACH;EACH,CAAC,CAAC,CACH,EACFtB,QAAQ,CACM;AAErB,CAAC;AAAC;AAEFD,IAAI,CAACiC,SAAS,GAAG;EACfhC,QAAQ,EAAEiC,kBAAS,CAACC,IAAI;EACxBjC,UAAU,EAAEgC,kBAAS,CAACE,OAAO,CAC3BF,kBAAS,CAACG,KAAK,CAAC;IACdb,SAAS,EAAEU,kBAAS,CAACI,KAAK,CAACC,MAAM,CAACC,IAAI,CAACT,mBAAU,CAAC,CAAC;IACnDR,EAAE,EAAEW,kBAAS,CAACO;EAChB,CAAC,CAAC;AAEN,CAAC"}
1
+ {"version":3,"file":"Core.js","names":["ghosts","Core","children","components","value","currency","locale","DEFAULT_LOCALE","useStore","isMobile","isDesktop","useDevice","dictionary","setDictionary","useState","useEffect","next","ServiceDictionary","get","filter","desktop","mobile","map","index","el","component","props","getGhost","ReactDOM","createPortal","React","createElement","COMPONENTS","undefined","ghost","propTypes","PropTypes","node","arrayOf","shape","oneOf","Object","keys","any"],"sources":["../src/Core.jsx"],"sourcesContent":["import { useStore } from '@mirai/data-sources';\nimport { DEFAULT_LOCALE, LocaleProvider } from '@mirai/locale';\nimport { ServiceDictionary } from '@mirai/services';\nimport { useDevice } from '@mirai/ui';\nimport PropTypes from 'prop-types';\nimport React, { useEffect, useState, Suspense } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport COMPONENTS from './components';\nimport { getGhost } from './helpers';\n\nconst ghosts = {};\n\nconst Core = ({ children, components = [] }) => {\n const {\n value: { currency, locale = DEFAULT_LOCALE },\n } = useStore();\n\n const { isMobile, isDesktop } = useDevice();\n const [dictionary, setDictionary] = useState();\n\n useEffect(() => {\n (async () => {\n const next = await ServiceDictionary.get(locale);\n if (next) setDictionary(next);\n })();\n }, [locale]);\n\n return (\n <LocaleProvider {...{ currency, dictionary, locale }}>\n <>\n {components\n .filter(({ desktop, mobile }) => !(isMobile && mobile === 'false') && !(isDesktop && desktop === 'false'))\n .map(({ el, component, ...props }, index) => {\n if (!ghosts[index]) ghosts[index] = getGhost(el);\n\n return ReactDOM.createPortal(\n <Suspense fallback={<small>Loading...</small>}>\n {React.createElement(COMPONENTS[component], {\n ...props,\n ['data-testid']: process.env.NODE_ENV === 'production' ? component : undefined,\n ghost: ghosts[index],\n el,\n })}\n </Suspense>,\n el,\n );\n })}\n </>\n {children}\n </LocaleProvider>\n );\n};\n\nCore.propTypes = {\n children: PropTypes.node,\n components: PropTypes.arrayOf(\n PropTypes.shape({\n component: PropTypes.oneOf(Object.keys(COMPONENTS)),\n el: PropTypes.any,\n }),\n ),\n};\n\nexport { Core };\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAAqC;AAAA;AAAA;AAErC,MAAMA,MAAM,GAAG,CAAC,CAAC;AAEjB,MAAMC,IAAI,GAAG,QAAmC;EAAA,IAAlC;IAAEC,QAAQ;IAAEC,UAAU,GAAG;EAAG,CAAC;EACzC,MAAM;IACJC,KAAK,EAAE;MAAEC,QAAQ;MAAEC,MAAM,GAAGC;IAAe;EAC7C,CAAC,GAAG,IAAAC,qBAAQ,GAAE;EAEd,MAAM;IAAEC,QAAQ;IAAEC;EAAU,CAAC,GAAG,IAAAC,aAAS,GAAE;EAC3C,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAG,IAAAC,eAAQ,GAAE;EAE9C,IAAAC,gBAAS,EAAC,MAAM;IACd,CAAC,YAAY;MACX,MAAMC,IAAI,GAAG,MAAMC,2BAAiB,CAACC,GAAG,CAACZ,MAAM,CAAC;MAChD,IAAIU,IAAI,EAAEH,aAAa,CAACG,IAAI,CAAC;IAC/B,CAAC,GAAG;EACN,CAAC,EAAE,CAACV,MAAM,CAAC,CAAC;EAEZ,oBACE,6BAAC,sBAAc;IAAOD,QAAQ;IAAEO,UAAU;IAAEN;EAAM,gBAChD,4DACGH,UAAU,CACRgB,MAAM,CAAC;IAAA,IAAC;MAAEC,OAAO;MAAEC;IAAO,CAAC;IAAA,OAAK,EAAEZ,QAAQ,IAAIY,MAAM,KAAK,OAAO,CAAC,IAAI,EAAEX,SAAS,IAAIU,OAAO,KAAK,OAAO,CAAC;EAAA,EAAC,CACzGE,GAAG,CAAC,QAA8BC,KAAK,KAAK;IAAA,IAAvC;MAAEC,EAAE;MAAEC,SAAS;MAAE,GAAGC;IAAM,CAAC;IAC/B,IAAI,CAAC1B,MAAM,CAACuB,KAAK,CAAC,EAAEvB,MAAM,CAACuB,KAAK,CAAC,GAAG,IAAAI,iBAAQ,EAACH,EAAE,CAAC;IAEhD,oBAAOI,iBAAQ,CAACC,YAAY,eAC1B,6BAAC,eAAQ;MAAC,QAAQ,eAAE;IAA0B,gBAC3CC,cAAK,CAACC,aAAa,CAACC,mBAAU,CAACP,SAAS,CAAC,EAAE;MAC1C,GAAGC,KAAK;MACR,CAAC,aAAa,GAAG,qEAAyB,YAAY,GAAGD,SAAS,GAAGQ,SAAS;MAC9EC,KAAK,EAAElC,MAAM,CAACuB,KAAK,CAAC;MACpBC;IACF,CAAC,CAAC,CACO,EACXA,EAAE,CACH;EACH,CAAC,CAAC,CACH,EACFtB,QAAQ,CACM;AAErB,CAAC;AAAC;AAEFD,IAAI,CAACkC,SAAS,GAAG;EACfjC,QAAQ,EAAEkC,kBAAS,CAACC,IAAI;EACxBlC,UAAU,EAAEiC,kBAAS,CAACE,OAAO,CAC3BF,kBAAS,CAACG,KAAK,CAAC;IACdd,SAAS,EAAEW,kBAAS,CAACI,KAAK,CAACC,MAAM,CAACC,IAAI,CAACV,mBAAU,CAAC,CAAC;IACnDR,EAAE,EAAEY,kBAAS,CAACO;EAChB,CAAC,CAAC;AAEN,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mirai/core",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "source": "src/index.js",
5
5
  "repository": "https://gitlab.com/miraicorp/dev/frontend/core",
6
6
  "author": "JΛVI <hello@soyjavi.com>",
@@ -16,6 +16,9 @@
16
16
  "test": "node scripts/test.js --watchAll=false --silent",
17
17
  "test:coverage": "node scripts/test.js --coverage --coverageReporters=text --detectOpenHandles --forceExit --silent",
18
18
  "test:watch": "node scripts/test.js",
19
+ "test:e2e": "yarn playwright test",
20
+ "test:e2e:recorder": "yarn playwright codegen",
21
+ "test:e2e:report": "yarn playwright show-report",
19
22
  "pipeline": "yarn lint && yarn test && yarn build",
20
23
  "release": "yarn version --patch && yarn publish --access public"
21
24
  },
@@ -37,6 +40,7 @@
37
40
  "@babel/preset-env": "7.20.2",
38
41
  "@babel/preset-react": "7.18.6",
39
42
  "@mirai/eslint": "^0.1",
43
+ "@playwright/test": "^1.29.2",
40
44
  "@testing-library/react": "12.1.5",
41
45
  "@testing-library/react-hooks": "7.0.2",
42
46
  "babel-plugin-inline-dotenv": "1.7.0",
@@ -0,0 +1,110 @@
1
+ // @ts-check
2
+ const { devices } = require('@playwright/test');
3
+
4
+ /**
5
+ * Read environment variables from file.
6
+ * https://github.com/motdotla/dotenv
7
+ */
8
+ // require('dotenv').config();
9
+
10
+ /**
11
+ * @see https://playwright.dev/docs/test-configuration
12
+ * @type {import('@playwright/test').PlaywrightTestConfig}
13
+ */
14
+ const config = {
15
+ testDir: './__tests__',
16
+ /* Maximum time one test can run for. */
17
+ timeout: 30 * 1000,
18
+ expect: {
19
+ /**
20
+ * Maximum time expect() should wait for the condition to be met.
21
+ * For example in `await expect(locator).toHaveText();`
22
+ */
23
+ timeout: 5000,
24
+ },
25
+ /* Run tests in files in parallel */
26
+ fullyParallel: true,
27
+ /* Fail the build on CI if you accidentally left test.only in the source code. */
28
+ forbidOnly: !!process.env.CI,
29
+ /* Retry on CI only */
30
+ retries: process.env.CI ? 2 : 0,
31
+ /* Opt out of parallel tests on CI. */
32
+ workers: process.env.CI ? 1 : undefined,
33
+ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
34
+ reporter: 'html',
35
+ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
36
+ use: {
37
+ /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
38
+ actionTimeout: 0,
39
+ /* Base URL to use in actions like `await page.goto('/')`. */
40
+ // baseURL: 'http://localhost:3000',
41
+
42
+ /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
43
+ trace: 'on-first-retry',
44
+ video: 'on',
45
+ },
46
+
47
+ /* Configure projects for major browsers */
48
+ projects: [
49
+ {
50
+ name: 'chromium',
51
+ use: {
52
+ ...devices['Desktop Chrome'],
53
+ },
54
+ },
55
+
56
+ // {
57
+ // name: 'firefox',
58
+ // use: {
59
+ // ...devices['Desktop Firefox'],
60
+ // },
61
+ // },
62
+
63
+ // {
64
+ // name: 'webkit',
65
+ // use: {
66
+ // ...devices['Desktop Safari'],
67
+ // },
68
+ // },
69
+
70
+ /* Test against mobile viewports. */
71
+ // {
72
+ // name: 'Mobile Chrome',
73
+ // use: {
74
+ // ...devices['Pixel 5'],
75
+ // },
76
+ // },
77
+ // {
78
+ // name: 'Mobile Safari',
79
+ // use: {
80
+ // ...devices['iPhone 12'],
81
+ // },
82
+ // },
83
+
84
+ /* Test against branded browsers. */
85
+ // {
86
+ // name: 'Microsoft Edge',
87
+ // use: {
88
+ // channel: 'msedge',
89
+ // },
90
+ // },
91
+ // {
92
+ // name: 'Google Chrome',
93
+ // use: {
94
+ // channel: 'chrome',
95
+ // },
96
+ // },
97
+ ],
98
+
99
+ /* Folder for test artifacts such as screenshots, videos, traces, etc. */
100
+ // outputDir: 'test-results/',
101
+
102
+ /* Run your local dev server before starting the tests */
103
+ webServer: {
104
+ command:
105
+ 'rm -rf dist && NODE_ENV=production parcel build public/e2e.html --no-cache --no-source-maps --no-autoinstall --detailed-report && serve dist -p 8080 -u -n',
106
+ port: 8080,
107
+ },
108
+ };
109
+
110
+ module.exports = config;
@@ -0,0 +1,29 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="utf-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
7
+ <title>@mirai/core - e2e</title>
8
+ <link rel="stylesheet" href="../src/theme.css" rel="preload" defer />
9
+ <link rel="stylesheet" href="index.css" />
10
+ </head>
11
+
12
+ <body>
13
+ <noscript>You need to enable JavaScript to run this app.</noscript>
14
+ <!-- Hotel Moderno -->
15
+ <div data-mirai-id="10030559" data-type="hotel" data-locale="en-GB" hidden></div>
16
+
17
+ <header>
18
+ <h1>@mirai/core</h1>
19
+ <nav>
20
+ <div data-mirai-component="bookingQuery"></div>
21
+ </nav>
22
+ </header>
23
+ <footer>
24
+ <small>Copyright, 2023</small>
25
+ </footer>
26
+ <script type="module" defer src="../src/index.js"></script>
27
+ </body>
28
+
29
+ </html>