@bikdotai/bik-widgets 1.0.0 → 1.0.2
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/dist-package/index.css +95 -0
- package/dist-package/index.js +2 -0
- package/package.json +17 -4
- package/.eslintrc +0 -22
- package/.eslintrc.js +0 -19
- package/.github/workflows/main.yml +0 -293
- package/.prettierignore +0 -13
- package/.prettierrc +0 -10
- package/cypress/apiHelper/endpoints.ts +0 -21
- package/cypress/apiHelper/executor.ts +0 -42
- package/cypress/e2e/bottomDrawer.cy.ts +0 -49
- package/cypress/e2e/directReward.cy.ts +0 -67
- package/cypress/e2e/scratchTheCard.cy.ts +0 -68
- package/cypress/e2e/stw.cy.ts +0 -82
- package/cypress/e2e/waRedirection.cy.ts +0 -46
- package/cypress/fixtures/payloads.ts +0 -330
- package/cypress/support/commands.ts +0 -37
- package/cypress/support/e2e.ts +0 -20
- package/cypress.staging.config.ts +0 -23
- package/jsconfig.json +0 -6
- package/localtest.sh +0 -10
- package/log-server.js +0 -86
- package/postcss.config.js +0 -8
- package/src/Globals.d.ts +0 -2
- package/src/assets/lottie/santa.json +0 -11722
- package/src/assets/svg/CalendarClockIcon.tsx +0 -30
- package/src/assets/svg/CalendarIcon.tsx +0 -24
- package/src/assets/svg/CheckIcon.tsx +0 -17
- package/src/assets/svg/ChevronIcon.tsx +0 -21
- package/src/assets/svg/Close.tsx +0 -39
- package/src/assets/svg/Confetti.tsx +0 -140
- package/src/assets/svg/Copy.tsx +0 -26
- package/src/assets/svg/DropdownCheckIcon.tsx +0 -35
- package/src/assets/svg/ErrorIcon.tsx +0 -27
- package/src/assets/svg/RadioIcon.tsx +0 -25
- package/src/assets/svg/UncheckedCheckboxIcon.tsx +0 -28
- package/src/assets/svg/UncheckedRadioIcon.tsx +0 -26
- package/src/assets/svg/info.tsx +0 -30
- package/src/assets/svg/qrcode.svg +0 -14
- package/src/bootstrap.tsx +0 -8
- package/src/components/CtaCard/index.tsx +0 -37
- package/src/components/CtaCard/preview.module.css +0 -32
- package/src/components/CtaCard/style.module.css +0 -32
- package/src/components/EmailInput/emailInputBox.tsx +0 -95
- package/src/components/Fab/index.tsx +0 -224
- package/src/components/Fab/preview.module.css +0 -28
- package/src/components/Fab/style.module.css +0 -37
- package/src/components/Icons/Call.tsx +0 -26
- package/src/components/Icons/Cross.tsx +0 -24
- package/src/components/Icons/Gmail.tsx +0 -61
- package/src/components/Icons/Instagram.tsx +0 -60
- package/src/components/Icons/LiveChat.tsx +0 -43
- package/src/components/Icons/Messenger.tsx +0 -57
- package/src/components/Icons/Send.tsx +0 -22
- package/src/components/Icons/Whatsapp.tsx +0 -24
- package/src/components/Shimmer/index.tsx +0 -12
- package/src/components/Shimmer/style.module.css +0 -37
- package/src/components/SmsInput/smsInputBox.tsx +0 -135
- package/src/components/UserDetailsV2/userDetailsV2.desktop.module.css +0 -52
- package/src/components/UserDetailsV2/userDetailsV2.mobile.module.css +0 -52
- package/src/components/UserDetailsV2/userDetailsV2.module.css +0 -81
- package/src/components/UserDetailsV2/userDetailsV2.tsx +0 -527
- package/src/components/WhatsappInput/Spinner.tsx +0 -26
- package/src/components/WhatsappInput/whatsappInput.module.css +0 -106
- package/src/components/WhatsappInput/whatsappInputBox.tsx +0 -155
- package/src/components/WhatsappInput/whatsappInputPreviewDesktop.module.css +0 -71
- package/src/components/WhatsappInput/whatsappInputPreviewMobile.module.css +0 -65
- package/src/components/checkbox/checkbox.module.css +0 -19
- package/src/components/checkbox/checkbox.tsx +0 -88
- package/src/components/countryCodePicker/countriesDropdown.module.css +0 -77
- package/src/components/countryCodePicker/countriesDropdown.tsx +0 -81
- package/src/components/couponDetails/coupon.module.css +0 -208
- package/src/components/couponDetails/coupon.tsx +0 -210
- package/src/components/couponDetails/couponPreviewDesktop.module.css +0 -158
- package/src/components/couponDetails/couponPreviewMobile.module.css +0 -164
- package/src/components/index.ts +0 -3
- package/src/components/inputComponents/Checkbox.module.css +0 -197
- package/src/components/inputComponents/Checkbox.tsx +0 -85
- package/src/components/inputComponents/DatePicker.module.css +0 -565
- package/src/components/inputComponents/DatePicker.tsx +0 -278
- package/src/components/inputComponents/Dropdown.module.css +0 -796
- package/src/components/inputComponents/Dropdown.tsx +0 -630
- package/src/components/inputComponents/InputBox.module.css +0 -401
- package/src/components/inputComponents/InputBox.tsx +0 -209
- package/src/components/selectedCountry/selectedCountry.module.css +0 -76
- package/src/components/selectedCountry/selectedCountry.tsx +0 -76
- package/src/components/selectedCountry/selectedCountryPreviewDesktop.module.css +0 -56
- package/src/components/selectedCountry/selectedCountryPreviewMobile.module.css +0 -57
- package/src/components/userDetailsForm/RenderCustomFields.tsx +0 -333
- package/src/components/userDetailsForm/userDetailsForm.tsx +0 -675
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useExitIntent.ts +0 -452
- package/src/hooks/useIsMobile.tsx +0 -21
- package/src/hooks/useMessageEvent.ts +0 -8
- package/src/hooks/useTriggeredIntentDetails.ts +0 -43
- package/src/hooks/useUrlListerner.ts +0 -30
- package/src/hooks/useWebSocketLogger.ts +0 -59
- package/src/hooks/useWindowEvent.ts +0 -8
- package/src/icons/copyIcon.tsx +0 -26
- package/src/icons/crossIconDesktop.tsx +0 -20
- package/src/icons/crossIconMobile.tsx +0 -20
- package/src/index.html +0 -30
- package/src/index.ts +0 -32
- package/src/index.tsx +0 -1
- package/src/repo/widgetRepo.ts +0 -21
- package/src/types/customFields.ts +0 -73
- package/src/utilities/cookie.ts +0 -70
- package/src/utilities/customFieldTypeMapping.ts +0 -67
- package/src/utilities/customFieldValidation.ts +0 -201
- package/src/utilities/encryption.ts +0 -21
- package/src/utilities/exitIntentUtils.ts +0 -31
- package/src/utilities/global.css +0 -11
- package/src/utilities/languageUtilities.ts +0 -235
- package/src/utilities/localRunner.js +0 -26
- package/src/utilities/localRunner.ts +0 -27
- package/src/utilities/localStorage.ts +0 -40
- package/src/utilities/script.tsx +0 -15
- package/src/utilities/stringUtils.ts +0 -5
- package/src/utilities/styleUtils.ts +0 -134
- package/src/utilities/variables.ts +0 -11
- package/src/utilities/widgetUtils.js +0 -342
- package/src/utilities/widgetUtils.ts +0 -313
- package/src/widgets/BottomDrawer/config.ts +0 -41
- package/src/widgets/BottomDrawer/index.tsx +0 -116
- package/src/widgets/BottomDrawer/modal.tsx +0 -286
- package/src/widgets/BottomDrawer/preview.module.css +0 -122
- package/src/widgets/BottomDrawer/previewMobile.module.css +0 -124
- package/src/widgets/BottomDrawer/style.module.css +0 -279
- package/src/widgets/CaptivateBanner/captivateBanner.tsx +0 -200
- package/src/widgets/CaptivateBanner/config.ts +0 -72
- package/src/widgets/CaptivateBanner/index.tsx +0 -204
- package/src/widgets/CaptivateBanner/previewDesktop.module.css +0 -51
- package/src/widgets/CaptivateBanner/previewMobile.module.css +0 -51
- package/src/widgets/CaptivateBanner/style.module.css +0 -77
- package/src/widgets/CaptivateBanner/utils.ts +0 -104
- package/src/widgets/CentrallyAlignedPopup/config.ts +0 -42
- package/src/widgets/CentrallyAlignedPopup/index.tsx +0 -109
- package/src/widgets/CentrallyAlignedPopup/modal.tsx +0 -269
- package/src/widgets/CentrallyAlignedPopup/preview.module.css +0 -153
- package/src/widgets/CentrallyAlignedPopup/previewMobile.module.css +0 -153
- package/src/widgets/CentrallyAlignedPopup/style.module.css +0 -283
- package/src/widgets/DirectReward/components/couponDetails.tsx +0 -265
- package/src/widgets/DirectReward/components/userDetails.tsx +0 -117
- package/src/widgets/DirectReward/config.ts +0 -186
- package/src/widgets/DirectReward/directReward.tsx +0 -350
- package/src/widgets/DirectReward/index.tsx +0 -579
- package/src/widgets/DirectReward/previewStyles/thankYouPreviewDesktop.module.css +0 -276
- package/src/widgets/DirectReward/previewStyles/thankYouPreviewMobile.module.css +0 -303
- package/src/widgets/DirectReward/previewStyles/userDetailsPreviewDesktop.module.css +0 -511
- package/src/widgets/DirectReward/previewStyles/userDetailsPreviewMobile.module.css +0 -462
- package/src/widgets/DirectReward/style.module.css +0 -836
- package/src/widgets/ExitIntentHook.tsx +0 -28
- package/src/widgets/STW/api.ts +0 -70
- package/src/widgets/STW/components/svgFactory.tsx +0 -44
- package/src/widgets/STW/config.ts +0 -193
- package/src/widgets/STW/context.ts +0 -7
- package/src/widgets/STW/couponDetails.tsx +0 -121
- package/src/widgets/STW/index.tsx +0 -733
- package/src/widgets/STW/previewStyles/thankyouPreviewDesktop.module.css +0 -215
- package/src/widgets/STW/previewStyles/thankyouPreviewMobile.module.css +0 -205
- package/src/widgets/STW/previewStyles/userInputsPreviewDesktop.module.css +0 -732
- package/src/widgets/STW/previewStyles/userInputsPreviewMobile.module.css +0 -661
- package/src/widgets/STW/previewStyles/wheelPreviewDesktop.module.css +0 -498
- package/src/widgets/STW/previewStyles/wheelPreviewMobile.module.css +0 -497
- package/src/widgets/STW/stw1.tsx +0 -119
- package/src/widgets/STW/stw2Components/wheelDesign.tsx +0 -183
- package/src/widgets/STW/stw2Pages/couponDetails.tsx +0 -72
- package/src/widgets/STW/stw2Pages/stw2.tsx +0 -212
- package/src/widgets/STW/stw2Pages/style.module.css +0 -1226
- package/src/widgets/STW/stw2Pages/userDetails.tsx +0 -86
- package/src/widgets/STW/stw2Pages/wheel.tsx +0 -117
- package/src/widgets/STW/stw2PreviewStyles/thankyouPreviewDesktop.module.css +0 -835
- package/src/widgets/STW/stw2PreviewStyles/thankyouPreviewMobile.module.css +0 -787
- package/src/widgets/STW/stw2PreviewStyles/userInputsPreviewDesktop.module.css +0 -867
- package/src/widgets/STW/stw2PreviewStyles/userInputsPreviewMobile.module.css +0 -798
- package/src/widgets/STW/stw2PreviewStyles/wheelPreviewDesktop.module.css +0 -572
- package/src/widgets/STW/stw2PreviewStyles/wheelPreviewMobile.module.css +0 -559
- package/src/widgets/STW/style.module.css +0 -901
- package/src/widgets/STW/userDetails.tsx +0 -150
- package/src/widgets/STW/utility.ts +0 -664
- package/src/widgets/STW/wheel.tsx +0 -304
- package/src/widgets/ScratchCard/ScratchOff/scratchOff.tsx +0 -157
- package/src/widgets/ScratchCard/config.ts +0 -152
- package/src/widgets/ScratchCard/globalStyle.module.css +0 -931
- package/src/widgets/ScratchCard/index.tsx +0 -546
- package/src/widgets/ScratchCard/modal.tsx +0 -225
- package/src/widgets/ScratchCard/preview.module.css +0 -250
- package/src/widgets/ScratchCard/previewMobile.module.css +0 -247
- package/src/widgets/ScratchCard/previewStyles/userDetailsPreviewDesktop.module.css +0 -537
- package/src/widgets/ScratchCard/previewStyles/userDetailsPreviewMobile.module.css +0 -463
- package/src/widgets/ScratchCard/style.module.css +0 -220
- package/src/widgets/ShopifyForm/config.ts +0 -168
- package/src/widgets/ShopifyForm/index.tsx +0 -214
- package/src/widgets/ShopifyForm/previewDesktop.module.css +0 -117
- package/src/widgets/ShopifyForm/previewMobile.module.css +0 -131
- package/src/widgets/ShopifyForm/shopifyForm.tsx +0 -445
- package/src/widgets/ShopifyForm/style.module.css +0 -161
- package/src/widgets/SingleButtonRedirection/config.ts +0 -47
- package/src/widgets/SingleButtonRedirection/index.tsx +0 -121
- package/src/widgets/WebStories/config.ts +0 -105
- package/src/widgets/WebStories/index.css +0 -3
- package/src/widgets/WebStories/index.tsx +0 -282
- package/src/widgets/WebStories/style.module.css +0 -26
- package/src/widgets/index.tsx +0 -3
- package/src/widgets/utility.ts +0 -31
- package/tsconfig.json +0 -12
- package/webpack.config.js +0 -239
package/package.json
CHANGED
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bikdotai/bik-widgets",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Follow below steps",
|
|
5
|
-
"main": "index.js",
|
|
5
|
+
"main": "dist-package/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"require": "./dist-package/index.js",
|
|
9
|
+
"default": "./dist-package/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./styles.css": "./dist-package/index.css"
|
|
12
|
+
},
|
|
13
|
+
"style": "dist-package/index.css",
|
|
14
|
+
"files": [
|
|
15
|
+
"dist-package"
|
|
16
|
+
],
|
|
6
17
|
"scripts": {
|
|
7
18
|
"stats": "webpack --profile --json > stats.json",
|
|
8
19
|
"start": "webpack serve --mode=development --env stage=dev",
|
|
9
|
-
"build
|
|
10
|
-
"build
|
|
20
|
+
"build:package": "rm -rf dist-package && webpack --mode production --env stage=package infra=production",
|
|
21
|
+
"build": "npm run build:package",
|
|
22
|
+
"prepublishOnly": "npm run build:package",
|
|
11
23
|
"build-widgets": "rm -rf dist && webpack --mode production --env stage=widgets infra=staging",
|
|
12
24
|
"build-widgets-prod": "rm -rf dist && webpack --mode production --env stage=widgets infra=production",
|
|
13
25
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
@@ -47,6 +59,7 @@
|
|
|
47
59
|
"mocha": "^10.2.0",
|
|
48
60
|
"mochawesome": "^7.1.3",
|
|
49
61
|
"mochawesome-merge": "^4.3.0",
|
|
62
|
+
"mini-css-extract-plugin": "^2.9.4",
|
|
50
63
|
"nodemon": "^2.0.21",
|
|
51
64
|
"postcss": "^8.5.6",
|
|
52
65
|
"postcss-loader": "^8.2.0",
|
package/.eslintrc
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es2021": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"eslint:recommended",
|
|
8
|
-
"plugin:react/recommended"
|
|
9
|
-
],
|
|
10
|
-
"overrides": [
|
|
11
|
-
],
|
|
12
|
-
"parserOptions": {
|
|
13
|
-
"ecmaVersion": "latest",
|
|
14
|
-
"sourceType": "module"
|
|
15
|
-
},
|
|
16
|
-
"plugins": [
|
|
17
|
-
"react"
|
|
18
|
-
],
|
|
19
|
-
"rules": {
|
|
20
|
-
"react/prop-types": "off"
|
|
21
|
-
}
|
|
22
|
-
}
|
package/.eslintrc.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
env: {
|
|
3
|
-
browser: true,
|
|
4
|
-
es2021: true,
|
|
5
|
-
},
|
|
6
|
-
extends: [
|
|
7
|
-
'eslint:recommended',
|
|
8
|
-
'plugin:react/recommended',
|
|
9
|
-
'plugin:@typescript-eslint/recommended',
|
|
10
|
-
],
|
|
11
|
-
overrides: [],
|
|
12
|
-
parser: '@typescript-eslint/parser',
|
|
13
|
-
parserOptions: {
|
|
14
|
-
ecmaVersion: 'latest',
|
|
15
|
-
sourceType: 'module',
|
|
16
|
-
},
|
|
17
|
-
plugins: ['react', '@typescript-eslint'],
|
|
18
|
-
rules: {},
|
|
19
|
-
};
|
|
@@ -1,293 +0,0 @@
|
|
|
1
|
-
name: CI/CD
|
|
2
|
-
on:
|
|
3
|
-
pull_request:
|
|
4
|
-
types: [labeled]
|
|
5
|
-
env:
|
|
6
|
-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
7
|
-
GCP_SERVICE_ACCOUNT_JSON: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
test-widgets:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
if: ${{ github.event.label.name == 'test:stage' }}
|
|
13
|
-
steps:
|
|
14
|
-
- name: Set Run ID Variable
|
|
15
|
-
run: echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV
|
|
16
|
-
- name: Display Run ID
|
|
17
|
-
run: echo $GITHUB_RUN_ID
|
|
18
|
-
- name: Checkout code
|
|
19
|
-
uses: actions/checkout@v3
|
|
20
|
-
- name: Set up Node.js
|
|
21
|
-
uses: actions/setup-node@v3
|
|
22
|
-
with:
|
|
23
|
-
node-version: '16'
|
|
24
|
-
- name: Install dependencies
|
|
25
|
-
run: npm install --force
|
|
26
|
-
- name: Test widgets
|
|
27
|
-
run: npm run cypress-staging
|
|
28
|
-
|
|
29
|
-
build-widgets:
|
|
30
|
-
runs-on: ubuntu-latest
|
|
31
|
-
if: ${{ github.event.label.name == 'build:stage' }}
|
|
32
|
-
steps:
|
|
33
|
-
- name: Set Run ID Variable
|
|
34
|
-
run: echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV
|
|
35
|
-
- name: Display Run ID
|
|
36
|
-
run: echo $GITHUB_RUN_ID
|
|
37
|
-
- name: Checkout code
|
|
38
|
-
uses: actions/checkout@v3
|
|
39
|
-
- name: Set up Node.js
|
|
40
|
-
uses: actions/setup-node@v3
|
|
41
|
-
with:
|
|
42
|
-
node-version: '16'
|
|
43
|
-
- name: Install dependencies
|
|
44
|
-
run: npm install --force
|
|
45
|
-
- name: Build widgets
|
|
46
|
-
run: npm run build-widgets
|
|
47
|
-
- name: Upload artifacts
|
|
48
|
-
uses: actions/upload-artifact@v4
|
|
49
|
-
with:
|
|
50
|
-
name: dist
|
|
51
|
-
path: dist/
|
|
52
|
-
|
|
53
|
-
build-mfe:
|
|
54
|
-
runs-on: ubuntu-latest
|
|
55
|
-
if: ${{ github.event.label.name == 'build:stage' }}
|
|
56
|
-
steps:
|
|
57
|
-
- name: Set Run ID Variable
|
|
58
|
-
run: echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV
|
|
59
|
-
- name: Display Run ID
|
|
60
|
-
run: echo $GITHUB_RUN_ID
|
|
61
|
-
- name: Checkout code
|
|
62
|
-
uses: actions/checkout@v3
|
|
63
|
-
- name: Set up Node.js
|
|
64
|
-
uses: actions/setup-node@v3
|
|
65
|
-
with:
|
|
66
|
-
node-version: '16'
|
|
67
|
-
- name: Install dependencies
|
|
68
|
-
run: npm install --force
|
|
69
|
-
- name: Build mfe
|
|
70
|
-
run: npm run build-mfe
|
|
71
|
-
- name: Upload artifacts
|
|
72
|
-
uses: actions/upload-artifact@v4
|
|
73
|
-
with:
|
|
74
|
-
name: dist-mfe
|
|
75
|
-
path: dist-mfe/
|
|
76
|
-
|
|
77
|
-
build-widgets-prod:
|
|
78
|
-
runs-on: ubuntu-latest
|
|
79
|
-
if: ${{ github.event.label.name == 'build:prod'}}
|
|
80
|
-
steps:
|
|
81
|
-
- name: Set Run ID Variable
|
|
82
|
-
run: echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV
|
|
83
|
-
- name: Display Run ID
|
|
84
|
-
run: echo $GITHUB_RUN_ID
|
|
85
|
-
- name: Checkout code
|
|
86
|
-
uses: actions/checkout@v3
|
|
87
|
-
- name: Set up Node.js
|
|
88
|
-
uses: actions/setup-node@v3
|
|
89
|
-
with:
|
|
90
|
-
node-version: '16'
|
|
91
|
-
- name: Install dependencies
|
|
92
|
-
run: npm install --force
|
|
93
|
-
- name: Build widgets prod
|
|
94
|
-
run: npm run build-widgets-prod
|
|
95
|
-
- name: Upload artifacts
|
|
96
|
-
uses: actions/upload-artifact@v4
|
|
97
|
-
with:
|
|
98
|
-
name: dist
|
|
99
|
-
path: dist/
|
|
100
|
-
|
|
101
|
-
build-mfe-prod:
|
|
102
|
-
runs-on: ubuntu-latest
|
|
103
|
-
if: ${{ github.event.label.name == 'build:prod'}}
|
|
104
|
-
steps:
|
|
105
|
-
- name: Set Run ID Variable
|
|
106
|
-
run: echo "GITHUB_RUN_ID=${{ github.run_id }}" >> $GITHUB_ENV
|
|
107
|
-
- name: Display Run ID
|
|
108
|
-
run: echo $GITHUB_RUN_ID
|
|
109
|
-
- name: Checkout code
|
|
110
|
-
uses: actions/checkout@v3
|
|
111
|
-
- name: Set up Node.js
|
|
112
|
-
uses: actions/setup-node@v3
|
|
113
|
-
with:
|
|
114
|
-
node-version: '16'
|
|
115
|
-
- name: Install dependencies
|
|
116
|
-
run: npm install --force
|
|
117
|
-
- name: Build mfe prod
|
|
118
|
-
run: npm run build-mfe-prod
|
|
119
|
-
- name: Upload artifacts
|
|
120
|
-
uses: actions/upload-artifact@v4
|
|
121
|
-
with:
|
|
122
|
-
name: dist-mfe
|
|
123
|
-
path: dist-mfe/
|
|
124
|
-
|
|
125
|
-
upload-widgets:
|
|
126
|
-
needs: build-widgets
|
|
127
|
-
runs-on: ubuntu-latest
|
|
128
|
-
if: ${{ github.event.label.name == 'build:stage' }}
|
|
129
|
-
steps:
|
|
130
|
-
- name: Checkout repository
|
|
131
|
-
uses: actions/checkout@v3
|
|
132
|
-
- name: Authenticate with Google Cloud
|
|
133
|
-
uses: google-github-actions/auth@v2
|
|
134
|
-
with:
|
|
135
|
-
project_id: staging-bikayi
|
|
136
|
-
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
|
|
137
|
-
- name: Set up Google Cloud SDK
|
|
138
|
-
uses: google-github-actions/setup-gcloud@v2
|
|
139
|
-
- name: Download artifacts
|
|
140
|
-
uses: actions/download-artifact@v4
|
|
141
|
-
with:
|
|
142
|
-
name: dist
|
|
143
|
-
path: dist/
|
|
144
|
-
- name: Clear existing old chunks folder
|
|
145
|
-
run: |
|
|
146
|
-
gsutil -m rm -r gs://bik-widget-mfe/bap/old-chunks/*
|
|
147
|
-
- name: Copy current chucks folder to old chunks folder
|
|
148
|
-
run: |
|
|
149
|
-
gsutil -m cp gs://bik-widget-mfe/bap/chunks/* gs://bik-widget-mfe/bap/old-chunks
|
|
150
|
-
- name: Clear existing chunks folder
|
|
151
|
-
run: |
|
|
152
|
-
gsutil -m rm -r gs://bik-widget-mfe/bap/chunks/*
|
|
153
|
-
- name: Upload artifacts to Google Cloud Storage
|
|
154
|
-
run: |
|
|
155
|
-
gsutil -m cp dist/chunks/* gs://bik-widget-mfe/bap/chunks
|
|
156
|
-
gsutil -m cp dist/chunks/*.map gs://bik-widget-mfe/bap/source-map
|
|
157
|
-
gsutil cp dist/vendor.js gs://bik-widget-mfe/bap/widget-vendor/vendor.js
|
|
158
|
-
gsutil cp dist/vendor.js.map gs://bik-widget-mfe/bap/source-map/vendor.js.map
|
|
159
|
-
gsutil cp dist/stw.js gs://bik-widget-mfe/bap/widget-stw/stw.js
|
|
160
|
-
gsutil cp dist/captivateBanner.js gs://bik-widget-mfe/bap/widget-captivate-banner/captivateBanner.js
|
|
161
|
-
gsutil cp dist/shopifyForm.js gs://bik-widget-mfe/bap/widget-shopify-form/shopifyForm.js
|
|
162
|
-
gsutil cp dist/stw.js.map gs://bik-widget-mfe/bap/source-map/stw.js.map
|
|
163
|
-
gsutil cp dist/bottomDrawer.js gs://bik-widget-mfe/bap/widget-bottom-drawer/bottomDrawer.js
|
|
164
|
-
gsutil cp dist/bottomDrawer.js.map gs://bik-widget-mfe/bap/source-map/bottomDrawer.js.map
|
|
165
|
-
gsutil cp dist/scratchCard.js gs://bik-widget-mfe/bap/widget-scratch-card/scratchCard.js
|
|
166
|
-
gsutil cp dist/directReward.js gs://bik-widget-mfe/bap/widget-direct-reward/directReward.js
|
|
167
|
-
gsutil cp dist/directReward.js.map gs://bik-widget-mfe/bap/source-map/directReward.js.map
|
|
168
|
-
gsutil cp dist/singleButtonRedirection.js gs://bik-widget-mfe/bap/widget-single-button-redirection/singleButtonRedirection.js
|
|
169
|
-
gsutil cp dist/singleButtonRedirection.js.map gs://bik-widget-mfe/bap/source-map/singleButtonRedirection.js.map
|
|
170
|
-
gsutil cp dist/centrallyAligned.js gs://bik-widget-mfe/bap/widget-centrally-aligned/centrallyAligned.js
|
|
171
|
-
gsutil cp dist/centrallyAligned.js.map gs://bik-widget-mfe/bap/source-map/centrallyAligned.js.map
|
|
172
|
-
- name: Clean up
|
|
173
|
-
run: |
|
|
174
|
-
echo "Uploaded artifacts to buckets successfully"
|
|
175
|
-
rm -rf dist/
|
|
176
|
-
rm -rf /tmp/$GITHUB_RUN_ID.json
|
|
177
|
-
|
|
178
|
-
upload-mfe:
|
|
179
|
-
needs: build-mfe
|
|
180
|
-
runs-on: ubuntu-latest
|
|
181
|
-
if: ${{ github.event.label.name == 'build:stage' }}
|
|
182
|
-
steps:
|
|
183
|
-
- name: Checkout repository
|
|
184
|
-
uses: actions/checkout@v3
|
|
185
|
-
- name: Authenticate with Google Cloud
|
|
186
|
-
uses: google-github-actions/auth@v2
|
|
187
|
-
with:
|
|
188
|
-
project_id: staging-bikayi
|
|
189
|
-
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
|
|
190
|
-
- name: Set up Google Cloud SDK
|
|
191
|
-
uses: google-github-actions/setup-gcloud@v2
|
|
192
|
-
- name: Download artifacts
|
|
193
|
-
uses: actions/download-artifact@v4
|
|
194
|
-
with:
|
|
195
|
-
name: dist-mfe
|
|
196
|
-
path: dist-mfe/
|
|
197
|
-
- name: Clear existing old mfe chunks folder
|
|
198
|
-
run: |
|
|
199
|
-
gsutil -m rm -r gs://bik-widget-mfe/bap/mfe/old-chunks/*
|
|
200
|
-
- name: Copy current mfe chucks folder to old mfe chunks folder
|
|
201
|
-
run: |
|
|
202
|
-
gsutil -m cp gs://bik-widget-mfe/bap/mfe/chunks/* gs://bik-widget-mfe/bap/mfe/old-chunks
|
|
203
|
-
- name: Clear existing mfe chunks
|
|
204
|
-
run: |
|
|
205
|
-
gsutil -m rm -r gs://bik-widget-mfe/bap/mfe/chunks/*
|
|
206
|
-
- name: Upload artifacts to Google Cloud Storage
|
|
207
|
-
run: |
|
|
208
|
-
gsutil -m cp -r dist-mfe/* gs://bik-widget-mfe/bap/mfe
|
|
209
|
-
- name: Clean up
|
|
210
|
-
run: |
|
|
211
|
-
echo "Uploaded artifacts to buckets successfully"
|
|
212
|
-
rm -rf dist/
|
|
213
|
-
rm -rf /tmp/$GITHUB_RUN_ID.json
|
|
214
|
-
|
|
215
|
-
upload-widgets-prod:
|
|
216
|
-
needs: build-widgets-prod
|
|
217
|
-
runs-on: ubuntu-latest
|
|
218
|
-
if: ${{ github.event.label.name == 'build:prod'}}
|
|
219
|
-
steps:
|
|
220
|
-
- name: Checkout repository
|
|
221
|
-
uses: actions/checkout@v3
|
|
222
|
-
- name: Authenticate with Google Cloud
|
|
223
|
-
uses: google-github-actions/auth@v2
|
|
224
|
-
with:
|
|
225
|
-
project_id: bikai-d5ee5
|
|
226
|
-
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
|
|
227
|
-
- name: Set up Google Cloud SDK
|
|
228
|
-
uses: google-github-actions/setup-gcloud@v2
|
|
229
|
-
- name: Download artifacts
|
|
230
|
-
uses: actions/download-artifact@v4
|
|
231
|
-
with:
|
|
232
|
-
name: dist
|
|
233
|
-
path: dist/
|
|
234
|
-
- name: Clear existing old chunks folder (PROD)
|
|
235
|
-
run: gsutil -m rm -r gs://bik-assets/bap/old-chunks/*
|
|
236
|
-
- name: Copy current chucks folder to old chunks folder (PROD)
|
|
237
|
-
run: |
|
|
238
|
-
gsutil -m cp gs://bik-assets/bap/chunks/* gs://bik-assets/bap/old-chunks
|
|
239
|
-
- name: Clear existing chunks folder (PROD)
|
|
240
|
-
run: |
|
|
241
|
-
gsutil -m rm -r gs://bik-assets/bap/chunks/*
|
|
242
|
-
- name: Upload artifacts to Google Cloud Storage (PROD)
|
|
243
|
-
run: |
|
|
244
|
-
gsutil -m cp -r dist/* gs://bik-assets/bap/mfe
|
|
245
|
-
gsutil -m cp dist/chunks/* gs://bik-assets/bap/chunks
|
|
246
|
-
gsutil -m cp dist/chunks/*.map gs://bik-assets/bap/source-map
|
|
247
|
-
gsutil cp dist/vendor.js gs://bik-assets/bap/widget-vendor/vendor.js
|
|
248
|
-
gsutil cp dist/vendor.js.map gs://bik-assets/bap/source-map/vendor.js.map
|
|
249
|
-
gsutil cp dist/stw.js gs://bik-assets/bap/widget-stw/stw.js
|
|
250
|
-
gsutil cp dist/captivateBanner.js gs://bik-assets/bap/widget-captivate-banner/captivateBanner.js
|
|
251
|
-
gsutil cp dist/shopifyForm.js gs://bik-assets/bap/widget-shopify-form/shopifyForm.js
|
|
252
|
-
gsutil cp dist/stw.js.map gs://bik-assets/bap/source-map/stw.js.map
|
|
253
|
-
gsutil cp dist/bottomDrawer.js gs://bik-assets/bap/widget-bottom-drawer/bottomDrawer.js
|
|
254
|
-
gsutil cp dist/bottomDrawer.js.map gs://bik-assets/bap/source-map/bottomDrawer.js.map
|
|
255
|
-
gsutil cp dist/scratchCard.js gs://bik-assets/bap/widget-scratch-card/scratchCard.js
|
|
256
|
-
gsutil cp dist/directReward.js gs://bik-assets/bap/widget-direct-reward/directReward.js
|
|
257
|
-
gsutil cp dist/directReward.js.map gs://bik-assets/bap/source-map/directReward.js.map
|
|
258
|
-
gsutil cp dist/singleButtonRedirection.js gs://bik-assets/bap/widget-single-button-redirection/singleButtonRedirection.js
|
|
259
|
-
gsutil cp dist/singleButtonRedirection.js.map gs://bik-assets/bap/source-map/singleButtonRedirection.js.map
|
|
260
|
-
gsutil cp dist/centrallyAligned.js gs://bik-assets/bap/widget-centrally-aligned/centrallyAligned.js
|
|
261
|
-
gsutil cp dist/centrallyAligned.js.map gs://bik-assets/bap/source-map/centrallyAligned.js.map
|
|
262
|
-
|
|
263
|
-
upload-mfe-prod:
|
|
264
|
-
needs: build-mfe-prod
|
|
265
|
-
runs-on: ubuntu-latest
|
|
266
|
-
if: ${{ github.event.label.name == 'build:prod'}}
|
|
267
|
-
steps:
|
|
268
|
-
- name: Checkout repository
|
|
269
|
-
uses: actions/checkout@v3
|
|
270
|
-
- name: Authenticate with Google Cloud
|
|
271
|
-
uses: google-github-actions/auth@v2
|
|
272
|
-
with:
|
|
273
|
-
project_id: bikai-d5ee5
|
|
274
|
-
credentials_json: ${{ secrets.GCP_SERVICE_ACCOUNT_JSON }}
|
|
275
|
-
- name: Set up Google Cloud SDK
|
|
276
|
-
uses: google-github-actions/setup-gcloud@v2
|
|
277
|
-
- name: Download artifacts
|
|
278
|
-
uses: actions/download-artifact@v4
|
|
279
|
-
with:
|
|
280
|
-
name: dist-mfe
|
|
281
|
-
path: dist-mfe/
|
|
282
|
-
- name: Clear existing old mfe chunks folder (PROD)
|
|
283
|
-
run: |
|
|
284
|
-
gsutil -m rm -r gs://bik-assets/bap/mfe/old-chunks/*
|
|
285
|
-
- name: Copy current mfe chucks folder to old mfe chunks folder (PROD)
|
|
286
|
-
run: |
|
|
287
|
-
gsutil -m cp gs://bik-assets/bap/mfe/chunks/* gs://bik-assets/bap/mfe/old-chunks
|
|
288
|
-
- name: Clear existing mfe chunks (PROD)
|
|
289
|
-
run: |
|
|
290
|
-
gsutil -m rm -r gs://bik-assets/bap/mfe/chunks/*
|
|
291
|
-
- name: Upload artifacts to Google Cloud Storage (PROD)
|
|
292
|
-
run: |
|
|
293
|
-
gsutil -m cp -r dist-mfe/* gs://bik-assets/bap/mfe
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function GetWidgetSrc(widgetId: string, templateId: string) {
|
|
2
|
-
return `${getBaseUrl()}/publicApiFunctions-getWidgetSourceV3/${templateId}/${Cypress.env('storeId')}/${widgetId}`;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
export function GetVendorSrc() {
|
|
6
|
-
return `${getBaseUrl()}/publicApiFunctions-getCommonScripts/vendor`;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function GetEventRequest() {
|
|
10
|
-
return `${getBaseUrl('dm')}/publicApiFunctions-sendWidgetEvent`;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function GetCouponRequest() {
|
|
14
|
-
return `${getBaseUrl('dm')}/publicApiFunctions-fetchCouponCode`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function getBaseUrl(balancer?: string) {
|
|
18
|
-
return Cypress.env('isProd')
|
|
19
|
-
? `https://bikapi.bikayi.app/bap/${balancer ?? 'static-scr'}`
|
|
20
|
-
: `https://api.staging.bik.ai/${balancer ?? 'dm'}`;
|
|
21
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { getBaseUrl } from './endpoints';
|
|
2
|
-
|
|
3
|
-
class ApiRequest {
|
|
4
|
-
baseURL;
|
|
5
|
-
defaultHeaders;
|
|
6
|
-
constructor() {
|
|
7
|
-
this.baseURL = getBaseUrl();
|
|
8
|
-
this.defaultHeaders = {
|
|
9
|
-
authorization: Cypress.env('accessToken'),
|
|
10
|
-
'bik-referer': 'bik',
|
|
11
|
-
'Content-Type': 'application/json',
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
get(url, queryParams = {}, headers = {}) {
|
|
16
|
-
return this.request('GET', url, queryParams, headers);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
post(url, body = {}, headers = {}) {
|
|
20
|
-
return this.request('POST', url, {}, headers, body);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
request(method, url, queryParams = {}, headers = {}, body = {}) {
|
|
24
|
-
const requestOptions = {
|
|
25
|
-
method,
|
|
26
|
-
url: `${this.baseURL}${url}`,
|
|
27
|
-
headers: {
|
|
28
|
-
...this.defaultHeaders,
|
|
29
|
-
...headers,
|
|
30
|
-
},
|
|
31
|
-
qs: queryParams,
|
|
32
|
-
body: {
|
|
33
|
-
...body,
|
|
34
|
-
storeId: Cypress.env('storeId'),
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
return cy.request(requestOptions);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export default ApiRequest;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetEventRequest,
|
|
3
|
-
GetVendorSrc,
|
|
4
|
-
GetWidgetSrc,
|
|
5
|
-
} from '../apiHelper/endpoints';
|
|
6
|
-
import ApiRequest from '../apiHelper/executor';
|
|
7
|
-
import { BOTTOM_DRAWER_PAYLOAD } from '../fixtures/payloads';
|
|
8
|
-
|
|
9
|
-
describe('Bottom drawer e2e', () => {
|
|
10
|
-
it('should make an API call, open a URL, and perform frontend testing', () => {
|
|
11
|
-
new ApiRequest()
|
|
12
|
-
.post('/utilApiFunctions-deleteAllWidgets', {
|
|
13
|
-
password: 'sn@1234@A',
|
|
14
|
-
})
|
|
15
|
-
.then(() => {
|
|
16
|
-
new ApiRequest()
|
|
17
|
-
.post('/widgetInfraApiFunctions-publishWidget', BOTTOM_DRAWER_PAYLOAD)
|
|
18
|
-
.then(response => {
|
|
19
|
-
expect(response.status).to.eq(200);
|
|
20
|
-
expect(response.body).to.have.property('widgetId');
|
|
21
|
-
let apiCalled = false;
|
|
22
|
-
const widgetId = response.body.widgetId;
|
|
23
|
-
const templateId = 'P29OopljI3TkkYdfxJE0';
|
|
24
|
-
cy.intercept('POST', GetEventRequest(), req => {
|
|
25
|
-
apiCalled = true;
|
|
26
|
-
req.continue();
|
|
27
|
-
}).as('apiCall');
|
|
28
|
-
cy.visit(Cypress.env('storeUrl'));
|
|
29
|
-
cy.get(`script[src^="${GetVendorSrc()}"]`, {
|
|
30
|
-
timeout: 10000,
|
|
31
|
-
}).should('exist');
|
|
32
|
-
cy.get(
|
|
33
|
-
`script[src^="${GetWidgetSrc(widgetId, templateId)}"]`,
|
|
34
|
-
).should('exist');
|
|
35
|
-
cy.get(`div[id="bik-widget-wrapper-${widgetId}"]`).should('exist');
|
|
36
|
-
cy.wrap(null).should(() => {
|
|
37
|
-
expect(apiCalled).to.be.true;
|
|
38
|
-
});
|
|
39
|
-
cy.get(`div[id="bik-widget-root-${widgetId}"]`).should('exist');
|
|
40
|
-
cy.get(`button[id="bik-bd-${widgetId}-cta-fab"]`).should('exist');
|
|
41
|
-
cy.get(`button[id="bik-bd-${widgetId}-cta-fab"]`).click();
|
|
42
|
-
cy.get(`button[id="bik-bd-${widgetId}-cta-whatsapp"]`).should(
|
|
43
|
-
'exist',
|
|
44
|
-
);
|
|
45
|
-
cy.get(`button[id="bik-bd-${widgetId}-cta-whatsapp"]`).click();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
48
|
-
});
|
|
49
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetEventRequest,
|
|
3
|
-
GetVendorSrc,
|
|
4
|
-
GetWidgetSrc,
|
|
5
|
-
GetCouponRequest,
|
|
6
|
-
} from '../apiHelper/endpoints';
|
|
7
|
-
import ApiRequest from '../apiHelper/executor';
|
|
8
|
-
import { DIRECT_REWARD_PAYLOAD } from '../fixtures/payloads';
|
|
9
|
-
|
|
10
|
-
describe('Direct Reward e2e', () => {
|
|
11
|
-
it('should make an API call, open a URL, and perform frontend testing', () => {
|
|
12
|
-
new ApiRequest()
|
|
13
|
-
.post('/utilApiFunctions-deleteAllWidgets', {
|
|
14
|
-
password: 'sn@1234@A',
|
|
15
|
-
})
|
|
16
|
-
.then(() => {
|
|
17
|
-
new ApiRequest()
|
|
18
|
-
.post('/widgetInfraApiFunctions-publishWidget', DIRECT_REWARD_PAYLOAD)
|
|
19
|
-
.then(response => {
|
|
20
|
-
expect(response.status).to.eq(200);
|
|
21
|
-
expect(response.body).to.have.property('widgetId');
|
|
22
|
-
let apiCalled = false;
|
|
23
|
-
let fetchedCoupon = false;
|
|
24
|
-
const widgetId = response.body.widgetId;
|
|
25
|
-
const templateId = '7fM9X24TY9Bk9f7fIG9C';
|
|
26
|
-
cy.intercept('POST', GetEventRequest(), req => {
|
|
27
|
-
apiCalled = true;
|
|
28
|
-
req.continue();
|
|
29
|
-
}).as('apiCall');
|
|
30
|
-
cy.intercept('POST', GetCouponRequest(), req => {
|
|
31
|
-
fetchedCoupon = true;
|
|
32
|
-
req.continue();
|
|
33
|
-
}).as('fetchCouponCall');
|
|
34
|
-
cy.visit(Cypress.env('storeUrl'));
|
|
35
|
-
cy.get(`script[src^="${GetVendorSrc()}"]`, {
|
|
36
|
-
timeout: 10000,
|
|
37
|
-
}).should('exist');
|
|
38
|
-
cy.get(
|
|
39
|
-
`script[src^="${GetWidgetSrc(widgetId, templateId)}"]`,
|
|
40
|
-
).should('exist');
|
|
41
|
-
cy.get(`div[id="bik-widget-wrapper-${widgetId}"]`, {
|
|
42
|
-
timeout: 10000,
|
|
43
|
-
}).should('exist');
|
|
44
|
-
cy.wrap(null).should(() => {
|
|
45
|
-
expect(apiCalled).to.be.true;
|
|
46
|
-
});
|
|
47
|
-
cy.get(
|
|
48
|
-
`div[id="bik-dr-${widgetId}-user-details-container"]`,
|
|
49
|
-
).should('exist');
|
|
50
|
-
cy.get(`input[id="bik-${widgetId}-input-whatsapp"]`).should(
|
|
51
|
-
'exist',
|
|
52
|
-
);
|
|
53
|
-
cy.get(`input[id="bik-${widgetId}-input-whatsapp"]`).type(
|
|
54
|
-
'7358264637',
|
|
55
|
-
);
|
|
56
|
-
cy.get(`div[id="bik-dr-${widgetId}-user-details-container"]`)
|
|
57
|
-
.find('button')
|
|
58
|
-
.click();
|
|
59
|
-
cy.wait(2000);
|
|
60
|
-
cy.wrap(null).should(() => {
|
|
61
|
-
expect(fetchedCoupon).to.be.true;
|
|
62
|
-
});
|
|
63
|
-
cy.get(`div[id="bik-${widgetId}-coupon-screen"]`).should('exist');
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
});
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
GetCouponRequest,
|
|
3
|
-
GetEventRequest,
|
|
4
|
-
GetVendorSrc,
|
|
5
|
-
GetWidgetSrc,
|
|
6
|
-
} from '../apiHelper/endpoints';
|
|
7
|
-
|
|
8
|
-
describe('STC e2e', () => {
|
|
9
|
-
it.skip('should make an API call, open a URL, and perform frontend testing', () => {
|
|
10
|
-
let apiCalled = false;
|
|
11
|
-
let fetchedCoupon = false;
|
|
12
|
-
const widgetId = 'lUoFe9aqnMrFi0zwb5cQ';
|
|
13
|
-
const templateId = 'vmgE8jBJJpThIeg9pK4a';
|
|
14
|
-
cy.intercept('POST', GetEventRequest(), req => {
|
|
15
|
-
apiCalled = true;
|
|
16
|
-
req.continue();
|
|
17
|
-
}).as('apiCall');
|
|
18
|
-
cy.intercept('POST', GetCouponRequest(), req => {
|
|
19
|
-
fetchedCoupon = true;
|
|
20
|
-
req.continue();
|
|
21
|
-
}).as('fetchCouponCall');
|
|
22
|
-
cy.visit(Cypress.env('storeUrl'));
|
|
23
|
-
cy.get(`script[src^="${GetVendorSrc()}"]`, { timeout: 10000 }).should(
|
|
24
|
-
'exist',
|
|
25
|
-
);
|
|
26
|
-
cy.get(`script[src^="${GetWidgetSrc(widgetId, templateId)}"]`, {
|
|
27
|
-
timeout: 10000,
|
|
28
|
-
}).should('exist');
|
|
29
|
-
cy.get(`div[id="bik-widget-wrapper-${widgetId}"]`).should('exist');
|
|
30
|
-
cy.wrap(null).should(() => {
|
|
31
|
-
expect(apiCalled).to.be.true;
|
|
32
|
-
});
|
|
33
|
-
cy.get(`div[id="bik-widget-root-${widgetId}"]`).should('exist');
|
|
34
|
-
cy.get(`div[id="bik-widget-root-${widgetId}"]`).find('button').click();
|
|
35
|
-
cy.get(`div[class="ScratchCard__Container"]`, { timeout: 10000 }).should(
|
|
36
|
-
'exist',
|
|
37
|
-
);
|
|
38
|
-
cy.get(`canvas[class="ScratchCard__Canvas"]`, { timeout: 10000 }).should(
|
|
39
|
-
'exist',
|
|
40
|
-
);
|
|
41
|
-
cy.get(`canvas[class="ScratchCard__Canvas"]`).then($div => {
|
|
42
|
-
const { left, top, width, height } = $div[0].getBoundingClientRect();
|
|
43
|
-
const centerX = left + width / 2;
|
|
44
|
-
const centerY = top + height / 2;
|
|
45
|
-
cy.get(`canvas[class="ScratchCard__Canvas"]`)
|
|
46
|
-
.trigger('mousedown')
|
|
47
|
-
.trigger('mousemove', {
|
|
48
|
-
clientX: centerX + 100,
|
|
49
|
-
clientY: centerY + 100,
|
|
50
|
-
}) // Move the mouse 50 pixels to the right and down
|
|
51
|
-
.trigger('mouseup');
|
|
52
|
-
});
|
|
53
|
-
cy.get(`input[id="bik-${widgetId}-input-whatsapp"]`, {
|
|
54
|
-
timeout: 10000,
|
|
55
|
-
}).should('exist');
|
|
56
|
-
cy.get(`input[id="bik-${widgetId}-input-whatsapp"]`).type('7358264637');
|
|
57
|
-
cy.get(`div[id="bik-stw-${widgetId}-user-details-container"]`)
|
|
58
|
-
.find('button')
|
|
59
|
-
.click();
|
|
60
|
-
cy.wait(2000);
|
|
61
|
-
cy.wrap(null).should(() => {
|
|
62
|
-
expect(fetchedCoupon).to.be.true;
|
|
63
|
-
});
|
|
64
|
-
cy.get(`div[id="bik-${widgetId}-coupon-screen"]`, {
|
|
65
|
-
timeout: 10000,
|
|
66
|
-
}).should('exist');
|
|
67
|
-
});
|
|
68
|
-
});
|