mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-12 03:59:41 +08:00
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
This commit is contained in:
@@ -49,7 +49,7 @@ runs:
|
|||||||
# which is why we not using the upload-archive
|
# which is why we not using the upload-archive
|
||||||
# composite step here.
|
# composite step here.
|
||||||
run: |
|
run: |
|
||||||
npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots
|
npm run test.e2e.docker.ci ${{ inputs.component }} -- --shard=${{ inputs.shard }}/${{ inputs.totalShards }} --update-snapshots='changed'
|
||||||
git add src/\*.png --force
|
git add src/\*.png --force
|
||||||
mkdir updated-screenshots
|
mkdir updated-screenshots
|
||||||
cd ../ && rsync -R --progress $(git diff --name-only --cached) core/updated-screenshots
|
cd ../ && rsync -R --progress $(git diff --name-only --cached) core/updated-screenshots
|
||||||
|
|||||||
@@ -93,13 +93,13 @@
|
|||||||
"test": "npm run test.spec && npm run test.e2e",
|
"test": "npm run test.spec && npm run test.e2e",
|
||||||
"test.spec": "stencil test --spec --max-workers=2",
|
"test.spec": "stencil test --spec --max-workers=2",
|
||||||
"test.e2e": "npx playwright test",
|
"test.e2e": "npx playwright test",
|
||||||
"test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots",
|
"test.e2e.update-snapshots": "npm run test.e2e -- --update-snapshots='changed'",
|
||||||
"test.watch": "jest --watch --no-cache",
|
"test.watch": "jest --watch --no-cache",
|
||||||
"test.treeshake": "node scripts/treeshaking.js dist/index.js",
|
"test.treeshake": "node scripts/treeshaking.js dist/index.js",
|
||||||
"validate": "npm run lint && npm run test && npm run build && npm run test.treeshake",
|
"validate": "npm run lint && npm run test && npm run build && npm run test.treeshake",
|
||||||
"docker.build": "docker build -t ionic-playwright .",
|
"docker.build": "docker build -t ionic-playwright .",
|
||||||
"test.e2e.docker": "npm run docker.build && node ./scripts/docker.mjs",
|
"test.e2e.docker": "npm run docker.build && node ./scripts/docker.mjs",
|
||||||
"test.e2e.docker.update-snapshots": "npm run test.e2e.docker -- --update-snapshots",
|
"test.e2e.docker.update-snapshots": "npm run test.e2e.docker -- --update-snapshots='changed'",
|
||||||
"test.e2e.docker.ci": "npm run docker.build && CI=true node ./scripts/docker.mjs",
|
"test.e2e.docker.ci": "npm run docker.build && CI=true node ./scripts/docker.mjs",
|
||||||
"test.e2e.script": "node scripts/testing/e2e-script.mjs"
|
"test.e2e.script": "node scripts/testing/e2e-script.mjs"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user