Skip to content

Commit 51b7ceb

Browse files
authored
test: remove deprecated getSnapshotSettings method (#28250)
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. --> The `getSnapshotSettings` method was used in the pre-generator test infrastructure. It was deprecated at the start of the generator migration. ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Now that the generator migration is complete, this method is no longer needed. As a result, I removed it. Developers should use the `screenshot` function: https://github.com/ionic-team/ionic-framework/blob/main/core/src/utils/test/playwright/docs/api.md#using-the-return-value-from-each-configuration ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. -->
1 parent 597bec7 commit 51b7ceb

File tree

6 files changed

+2
-51
lines changed

6 files changed

+2
-51
lines changed

core/src/components/picker-column/test/test.utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export async function testPickerColumn(
3939
await page.waitForChanges();
4040
4141
screenshots.push({
42-
name: `picker-${description}-column-diff-${i}-${page.getSnapshotSettings()}.png`,
42+
name: screenshot(`picker-${description}-column-diff-${i}`),
4343
screenshot: await page.screenshot(),
4444
});
4545
}

core/src/utils/test/playwright/docs/api.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ The [page fixture](https://playwright.dev/docs/test-fixtures) has been extended
108108
| `setIonViewport` | Resizes the browser window to fit the entire height of `ion-content` on screen. Only needed when taking fullsize screenshots with `ion-content`. |
109109
| `waitForChanges` | Waits for Stencil to re-render before proceeeding. This is typically only needed when you update a property on a component. |
110110
| `spyOnEvent` | Creates an event spy that can be used to wait for a [CustomEvent](https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent) to be emitted. |
111-
| `getSnapshotSettings` (DEPRECATED) | Returns information about the current test (such as mode or direction) to generate a unique screenshot name. Deprecated: Use the `screenshot` function provided by the test [generator](#generators) instead. |
112111

113112
<details>
114113

core/src/utils/test/playwright/page/utils/get-snapshot-settings.ts

Lines changed: 0 additions & 33 deletions
This file was deleted.

core/src/utils/test/playwright/page/utils/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
export * from './wait-for-changes';
22
export * from './goto';
3-
export * from './get-snapshot-settings';
43
export * from './set-ion-viewport';
54
export * from './spy-on-event';
65
export * from './set-content';

core/src/utils/test/playwright/playwright-declarations.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,6 @@ export interface E2EPage extends Page {
7878
* Use this method when taking full-screen screenshots.
7979
*/
8080
setIonViewport: (options?: SetIonViewportOptions) => Promise<void>;
81-
/**
82-
* This provides metadata that can be used to create a unique screenshot URL.
83-
* For example, we need to be able to differentiate between iOS in LTR mode and iOS in RTL mode.
84-
*/
85-
getSnapshotSettings: () => string;
8681
/**
8782
* After changes have been made to a component, such as an update to a property or attribute,
8883
* we need to wait until the changes have been applied to the DOM.

core/src/utils/test/playwright/playwright-page.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,7 @@ import { test as base } from '@playwright/test';
1010
import { PageUtils } from '../press-keys';
1111

1212
import { initPageEvents } from './page/event-spy';
13-
import {
14-
getSnapshotSettings,
15-
goto as goToPage,
16-
setContent,
17-
setIonViewport,
18-
spyOnEvent,
19-
waitForChanges,
20-
locator,
21-
} from './page/utils';
13+
import { goto as goToPage, setContent, setIonViewport, spyOnEvent, waitForChanges, locator } from './page/utils';
2214
import type { LocatorOptions } from './page/utils';
2315
import type {
2416
E2EPage,
@@ -57,7 +49,6 @@ export async function extendPageFixture(page: E2EPage, testInfo: TestInfo) {
5749
page.locator = (selector: string, options?: LocatorOptions) => locator(page, originalLocator, selector, options);
5850

5951
// Custom Ionic methods
60-
page.getSnapshotSettings = () => getSnapshotSettings(page, testInfo);
6152
page.setIonViewport = (options?: SetIonViewportOptions) => setIonViewport(page, options);
6253
page.waitForChanges = (timeoutMs?: number) => waitForChanges(page, timeoutMs);
6354
page.spyOnEvent = (eventName: string) => spyOnEvent(page, eventName);

0 commit comments

Comments
 (0)