Skip to content

Commit 5f37a75

Browse files
Merge branch 'develop' into feature/auto-bonus-product
Signed-off-by: sf-deepali-bharmal <deepali.bharmal@salesforce.com>
2 parents facc6d0 + 6a4ff6f commit 5f37a75

File tree

10 files changed

+1805
-456
lines changed

10 files changed

+1805
-456
lines changed

.github/workflows/e2e-pr.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: SalesforceCommerceCloud/pwa-kit/e2e-pr
2+
on:
3+
workflow_dispatch:
4+
pull_request: # Default: opened, reopened, synchronize (head branch updated)
5+
merge_group: # Trigger GA workflow when a pull request is added to a merge queue.
6+
push:
7+
branches:
8+
- develop
9+
- 'release-*'
10+
11+
jobs:
12+
test_e2e_private:
13+
runs-on: ubuntu-latest
14+
steps:
15+
# Skipping the entire workflow for now until all steps are implemented.
16+
- name: Skip Check
17+
run: |
18+
echo "SKIP_WORKFLOW=true" >> "$GITHUB_ENV"
19+
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Check PWA Kit Version
24+
run: |-
25+
version=`jq -r ".version" package.json`
26+
echo "pwa_kit_version=$version" >> "$GITHUB_ENV"
27+
28+
# TODO: Skip the entire workflow since we don't have e2e tests for PWA Kit v2.x
29+
- name: Skip if PWA Kit version older than v3.x
30+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
31+
run: |
32+
major_version=$(echo "${{ env.pwa_kit_version }}" | cut -d. -f1)
33+
if [ "$major_version" -lt 3 ]; then
34+
echo "PWA Kit version is older than v3.x, skipping workflow."
35+
echo "SKIP_WORKFLOW=true" >> "$GITHUB_ENV"
36+
fi
37+
38+
# Only test for latest Node version supported by MRT
39+
- name: Setup Node
40+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
41+
uses: actions/setup-node@v4
42+
with:
43+
node-version: 22
44+
cache: npm
45+
46+
# Check central resource allocation on AWS and get a lock on an available environment from the pool.
47+
# Returns the MRT target ID if lock is acquired, otherwise returns an error state.
48+
- name: Get MRT Target lock
49+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
50+
id: get_mrt_target_lock
51+
run: |
52+
echo "TODO: Implement .github/actions/get_mrt_target_lock"
53+
54+
- name: Create MRT target
55+
id: create_mrt_target
56+
if: ${{ env.SKIP_WORKFLOW != 'true' && steps.get_mrt_target_lock.outputs.status == 'ERR_NO_AVAILABLE_TARGETS' }}
57+
run: |
58+
echo "TODO: Call .github/actions/create_mrt_target with correct inputs"
59+
60+
- name: Get Template Version
61+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
62+
run: |-
63+
version=`jq -r ".version" packages/template-retail-react-app/package.json`
64+
echo "retail_app_template_version=$version" >> "$GITHUB_ENV"
65+
66+
- name: Generate Retail App Private Client
67+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
68+
uses: ./.github/actions/e2e_generate_app
69+
with:
70+
PROJECT_KEY: 'retail-app-private-client'
71+
TEMPLATE_VERSION: ${{ env.retail_app_template_version }}
72+
73+
- name: Validate Retail App Without Extensibility
74+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
75+
uses: ./.github/actions/e2e_validate_generated_app
76+
with:
77+
PROJECT_KEY: 'retail-app-no-ext'
78+
TEMPLATE_VERSION: ${{ env.retail_app_template_version }}
79+
80+
# TODO: Revisit the next 2 steps to see if we can use the existing .github/actions/deploy_app action.
81+
- name: Create MRT credentials file
82+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
83+
uses: './.github/actions/create_mrt'
84+
with:
85+
mobify_user: ${{ secrets.MOBIFY_CLIENT_USER }}
86+
mobify_api_key: ${{ secrets.MOBIFY_CLIENT_API_KEY }}
87+
88+
- name: Push Bundle to MRT (E2E Test PWA Kit)
89+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
90+
uses: './.github/actions/push_to_mrt'
91+
with:
92+
CWD: '../generated-projects/retail-app-no-ext'
93+
# TODO: Use the MRT target ID from the target lock step above.
94+
TARGET: e2e-tests-pwa-kit
95+
FLAGS: --wait
96+
97+
- name: Install Playwright Browsers
98+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
99+
run: npx playwright install --with-deps
100+
101+
- name: Run Playwright tests
102+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
103+
run: npm run test:e2e
104+
105+
- name: Run Playwright a11y tests
106+
if: ${{ env.SKIP_WORKFLOW != 'true' }}
107+
run: npm run test:e2e:a11y
108+
109+
- name: Release MRT Target Lock
110+
if: always() # Always release the target lock back to the pool even if the tests fail.
111+
run: |
112+
echo "TODO: Implement .github/actions/release_mrt_target_lock"

packages/template-retail-react-app/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- Provide base image for convenient perf optimizations [#2642](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2642)
1111
- Support saving billing phone number on user registration from order confirmation [#2653](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2653)
1212
- Support saving default shipping address on user registration from order confirmation [#2706](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2706)
13+
- Provide support for partial hydration [#2696](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2696)
1314
- Show Automatic Bonus Products on Cart Page [#2704](https://github.com/SalesforceCommerceCloud/pwa-kit/pull/2704)
1415

1516
## v6.1.0 (May 22, 2025)

packages/template-retail-react-app/app/components/_app/index.jsx

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ import {ListMenu, ListMenuContent} from '@salesforce/retail-react-app/app/compon
4747
import {HideOnDesktop, HideOnMobile} from '@salesforce/retail-react-app/app/components/responsive'
4848
import AboveHeader from '@salesforce/retail-react-app/app/components/_app/partials/above-header'
4949
import {StoreLocatorModal} from '@salesforce/retail-react-app/app/components/store-locator'
50+
import Island from '@salesforce/retail-react-app/app/components/island'
51+
5052
// Hooks
5153
import {AuthModal, useAuthModal} from '@salesforce/retail-react-app/app/hooks/use-auth-modal'
5254
import {
@@ -361,48 +363,54 @@ const App = (props) => {
361363
onClose={onCloseStoreLocator}
362364
/>
363365
)}
364-
<Box {...styles.headerWrapper}>
365-
{!isCheckout ? (
366-
<>
367-
<AboveHeader />
368-
<Header
369-
onMenuClick={onOpen}
370-
onLogoClick={onLogoClick}
371-
onMyCartClick={onCartClick}
372-
onMyAccountClick={onAccountClick}
373-
onWishlistClick={onWishlistClick}
374-
onStoreLocatorClick={onOpenStoreLocator}
375-
>
376-
<HideOnDesktop>
377-
<DrawerMenu
378-
isOpen={isOpen}
379-
onClose={onClose}
380-
onLogoClick={onLogoClick}
381-
root={
382-
categories?.[CAT_MENU_DEFAULT_ROOT_CATEGORY]
383-
}
384-
itemsKey="categories"
385-
itemsCountKey="onlineSubCategoriesCount"
386-
itemComponent={DrawerMenuItemWithData}
387-
/>
388-
</HideOnDesktop>
389-
390-
<HideOnMobile>
391-
<ListMenu
392-
root={
393-
categories?.[CAT_MENU_DEFAULT_ROOT_CATEGORY]
394-
}
395-
itemsKey="categories"
396-
itemsCountKey="onlineSubCategoriesCount"
397-
contentComponent={ListMenuContentWithData}
398-
/>
399-
</HideOnMobile>
400-
</Header>
401-
</>
402-
) : (
403-
<CheckoutHeader />
404-
)}
405-
</Box>
366+
<Island hydrateOn={'visible'}>
367+
<Box {...styles.headerWrapper}>
368+
{!isCheckout ? (
369+
<>
370+
<AboveHeader />
371+
<Header
372+
onMenuClick={onOpen}
373+
onLogoClick={onLogoClick}
374+
onMyCartClick={onCartClick}
375+
onMyAccountClick={onAccountClick}
376+
onWishlistClick={onWishlistClick}
377+
onStoreLocatorClick={onOpenStoreLocator}
378+
>
379+
<HideOnDesktop>
380+
<DrawerMenu
381+
isOpen={isOpen}
382+
onClose={onClose}
383+
onLogoClick={onLogoClick}
384+
root={
385+
categories?.[
386+
CAT_MENU_DEFAULT_ROOT_CATEGORY
387+
]
388+
}
389+
itemsKey="categories"
390+
itemsCountKey="onlineSubCategoriesCount"
391+
itemComponent={DrawerMenuItemWithData}
392+
/>
393+
</HideOnDesktop>
394+
395+
<HideOnMobile>
396+
<ListMenu
397+
root={
398+
categories?.[
399+
CAT_MENU_DEFAULT_ROOT_CATEGORY
400+
]
401+
}
402+
itemsKey="categories"
403+
itemsCountKey="onlineSubCategoriesCount"
404+
contentComponent={ListMenuContentWithData}
405+
/>
406+
</HideOnMobile>
407+
</Header>
408+
</>
409+
) : (
410+
<CheckoutHeader />
411+
)}
412+
</Box>
413+
</Island>
406414
{!isOnline && <OfflineBanner />}
407415
<AddToCartModalProvider>
408416
<SkipNavContent
@@ -427,7 +435,9 @@ const App = (props) => {
427435
</Box>
428436
</SkipNavContent>
429437

430-
{!isCheckout ? <Footer /> : <CheckoutFooter />}
438+
<Island hydrateOn={'visible'}>
439+
{!isCheckout ? <Footer /> : <CheckoutFooter />}
440+
</Island>
431441

432442
<AuthModal {...authModal} />
433443
<DntNotification {...dntNotification} />

0 commit comments

Comments
 (0)