Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(pie-monorepo): DSW-2362 updated button test and ci percy debug #1707

Closed
wants to merge 21 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
6df75be
ci(pie-monorepo): DSW-2362 updated button test and ci percy debug
JoshuaNg2332 Aug 16, 2024
aaf111b
chore(pie-monorepo): DSW-2362 updated percy CLI
JoshuaNg2332 Aug 16, 2024
ce931c1
chore(pie-monorepo): DSW-2362 added percy.yml file
JoshuaNg2332 Aug 16, 2024
7668481
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Aug 16, 2024
b1f5147
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Aug 27, 2024
7a8519d
chore(pie-monorepo): DSW-2362 updated percy cli dep
JoshuaNg2332 Aug 27, 2024
af4eeb1
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Aug 30, 2024
4b077a9
test(pie-button): DSW-2362 updated visual tests to split out sizes
JoshuaNg2332 Aug 30, 2024
1576883
test(pie-button): DSW-2362 updated waitForLoadState
JoshuaNg2332 Aug 30, 2024
46697db
refactor(pie-components-config): DSW-2362 updated style routing
JoshuaNg2332 Aug 30, 2024
6a2a202
chore(pie-monorepo): DSW-2362 turbo change to invalidate cache
JoshuaNg2332 Aug 30, 2024
c918f4f
revert(pie-components-config): DSW-2362 revert style routing
JoshuaNg2332 Aug 30, 2024
cf9e275
revert(pie-components-config): DSW-2362 added percy.yml
JoshuaNg2332 Aug 30, 2024
3091488
chore(pie-components-config): DSW-2362 updated percy deps
JoshuaNg2332 Aug 30, 2024
706c835
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Aug 30, 2024
a16fdf7
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Sep 2, 2024
6bb96b1
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Sep 2, 2024
5dc9001
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Sep 2, 2024
b0ce878
Merge branch 'main' into DSW-2362-investigate-percy
JoshuaNg2332 Sep 9, 2024
f51cc8a
refactor(pie-monorepo): DSW-2362 updated percy.yml with exact unpkg r…
JoshuaNg2332 Sep 9, 2024
add8a75
revert(pie-monorepo): DSW-2362 revert percy.yml change
JoshuaNg2332 Sep 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ env:
PERCY_TOKEN_PIE_TEXTAREA: ${{ secrets.PERCY_TOKEN_PIE_TEXTAREA }}
PERCY_TOKEN_PIE_TOAST: ${{ secrets.PERCY_TOKEN_PIE_TOAST }}
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
PERCY_DEBUG: "*"
LOG_LEVEL: debug
PERCY_DO_NOT_CAPTURE_RESPONSIVE_ASSETS: true
PERCY_PAGE_LOAD_TIMEOUT: 60000
PERCY_NETWORK_IDLE_WAIT_TIMEOUT: 60000
PERCY_PAGE_LOAD_TIMEOUT: ${{ vars.PERCY_PAGE_LOAD_TIMEOUT }}
PERCY_NETWORK_IDLE_WAIT_TIMEOUT: ${{ vars.PERCY_NETWORK_IDLE_WAIT_TIMEOUT }}

jobs:
dependency-changeset:
Expand Down
4 changes: 4 additions & 0 deletions .percy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 2
discovery:
disallowedHostnames:
- unpkg.com
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
"@justeattakeaway/pie-webc-testing": "0.13.3",
"@justeattakeaway/pie-wrapper-react": "0.14.1",
"@justeattakeaway/stylelint-config-pie": "0.7.0",
"@percy/cli": "1.28.8",
"@percy/playwright": "1.0.5",
"@percy/cli": "1.29.3",
"@percy/playwright": "1.0.6",
"@playwright/experimental-ct-react": "1.41.0",
"@playwright/test": "1.41.0",
"@rollup/plugin-node-resolve": "15.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const sizes: Array<SizeResponsiveSize> = [
{ sizeName: 'large', responsiveSize: '--btn-height--large' },
];

test('should correctly work with native click events', async ({ mount }) => {
test('should correctly work with native click event', async ({ mount }) => {
const messages: string[] = [];
const expectedEventMessage = 'Native event dispatched';
const component = await mount(
Expand Down
49 changes: 29 additions & 20 deletions packages/components/pie-button/test/visual/pie-button.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const props: PropObject<ButtonProps> = {
isFullWidth: [true, false],
disabled: [true, false],
isLoading: [true, false],
iconPlacement: [undefined, ...iconPlacements],
iconPlacement: iconPlacements,
};

// Renders a <pie-button> HTML string with the given prop values
Expand All @@ -47,25 +47,34 @@ test.beforeEach(async ({ mount }, testInfo) => {
await iconComponent.unmount();
});

componentVariants.forEach((variant) => test(`should render all prop variations for Variant: ${variant}`, async ({ page, mount }) => {
for (const combo of componentPropsMatrixByVariant[variant]) {
const testComponent: WebComponentTestInput = createTestWebComponent(combo, renderTestPieButton);
const propKeyValues = `size: ${testComponent.propValues.size}, iconPlacement: ${testComponent.propValues.iconPlacement}, isFullWidth: ${testComponent.propValues.isFullWidth}, disabled: ${testComponent.propValues.disabled}, isLoading: ${testComponent.propValues.isLoading}`;
const darkMode = ['inverse', 'ghost-inverse', 'outline-inverse'].includes(variant);
componentVariants.forEach((variant) => {
const componentPropsMatrixBySize = splitCombinationsByPropertyValue(componentPropsMatrixByVariant[variant], 'size');
const componentSizes: string[] = Object.keys(componentPropsMatrixBySize);

await mount(
WebComponentTestWrapper,
{
props: { propKeyValues, darkMode },
slots: {
component: testComponent.renderedString.trim(),
},
},
);
}
componentSizes.forEach((size) => {
test(`should render all prop variations for Variant: ${variant} and Size: ${size}`, async ({ page, mount }) => {
const combos = componentPropsMatrixBySize[size];

// Follow up to remove in Jan
await page.waitForTimeout(2500);
for (const combo of combos) {
const testComponent: WebComponentTestInput = createTestWebComponent(combo, renderTestPieButton);
const propKeyValues = `size: ${testComponent.propValues.size}, iconPlacement: ${testComponent.propValues.iconPlacement}, isFullWidth: ${testComponent.propValues.isFullWidth}, disabled: ${testComponent.propValues.disabled}, isLoading: ${testComponent.propValues.isLoading}`;
const darkMode = ['inverse', 'ghost-inverse', 'outline-inverse'].includes(variant);

await percySnapshot(page, `PIE Button - Variant: ${variant}`, percyWidths);
}));
await mount(
WebComponentTestWrapper,
{
props: { propKeyValues, darkMode },
slots: {
component: testComponent.renderedString.trim(),
},
},
);
}

await page.waitForLoadState('domcontentloaded');

const snapshotName = `PIE Button - Variant: ${variant} - Size: ${size}`;
await percySnapshot(page, snapshotName, percyWidths);
});
});
});
Loading
Loading