Skip to content

Commit d36283e

Browse files
authored
chore(snapshots): use default value for cmd line argument (#30263)
Issue number: N/A --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> Certain custom commands related to Playwright are failing. Specifically: - `npm run test.e2e.update-snapshots ${component}` - `npm run test.e2e.docker.update-snapshots ${component}` The failures are due to Playwright [v1.50 changing](https://playwright.dev/docs/release-notes#breaking) it's accepted values for `update-snapshots`. Possible values are "all", "changed", "missing", and "none". By default, it's "all". All snapshots will be updated when no value is passed or a wrong value is passed. Our scripts end up running (doesn't matter if it's local or through the docker): - `npx playwright test --update-snapshots ${component}` It used to only update the snapshots that have changed. However, with the update, the argument thinks that the component is its value but since it's not an accepted one, it leads to the default. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> Set our default value when it comes to updating snapshots. By using `changed` then we would only update snapshots for those tests that have a difference. This aligns with how it used to work before the update. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change: 1. Describe the impact and migration path for existing applications below. 2. Update the BREAKING.md file with the breaking change. 3. Add "BREAKING CHANGE: [...]" to the commit description when merging. See https://github.com/ionic-team/ionic-framework/blob/main/docs/CONTRIBUTING.md#footer for more information. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> N/A
1 parent 39f636f commit d36283e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.github/workflows/actions/test-core-screenshot/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ runs:
4949
# which is why we not using the upload-archive
5050
# composite step here.
5151
run: |
52-
npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots
52+
npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots='changed'
5353
git add src/\*.png --force
5454
mkdir updated-screenshots
5555
cd ../ && rsync -R --progress $(git diff --name-only --cached) core/updated-screenshots

core/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@
9393
"test": "npm run test.spec && npm run test.e2e",
9494
"test.spec": "stencil test --spec --max-workers=2",
9595
"test.e2e": "npx playwright test",
96-
"test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots",
96+
"test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots='changed'",
9797
"test.watch": "jest --watch --no-cache",
9898
"test.treeshake": "node scripts/treeshaking.js dist/index.js",
9999
"validate": "npm run lint && npm run test && npm run build && npm run test.treeshake",
100100
"docker.build": "docker build -t ionic-playwright .",
101101
"test.e2e.docker": "npm run docker.build && node ./scripts/docker.mjs",
102-
"test.e2e.docker.update-snapshots": "npm run test.e2e.docker -- --update-snapshots",
102+
"test.e2e.docker.update-snapshots": "npm run test.e2e.docker -- --update-snapshots='changed'",
103103
"test.e2e.docker.ci": "npm run docker.build && CI=true node ./scripts/docker.mjs",
104104
"test.e2e.script": "node scripts/testing/e2e-script.mjs"
105105
},

0 commit comments

Comments
 (0)