-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(picker, picker-column): migrate to generators (#27352)
Issue number: N/A --------- <!-- Please refer to our contributing documentation for any questions on submitting a pull request, or let us know here if you need any help: https://ionicframework.com/docs/building/contributing --> <!-- Some docs updates need to be made in the `ionic-docs` repo, in a separate PR. See https://github.com/ionic-team/ionic-framework/blob/main/.github/CONTRIBUTING.md#modifying-documentation for details. --> <!-- 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. --> Picker and picker column tests use legacy syntax ## What is the new behavior? <!-- Please describe the behavior or changes that are being added by this PR. --> - Picker and picker column tests use generator syntax ## 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. -->
- Loading branch information
1 parent
19c53c4
commit df3aaff
Showing
57 changed files
with
134 additions
and
117 deletions.
There are no files selected for viewing
19 changes: 0 additions & 19 deletions
19
core/src/components/picker-column/test/standalone/picker-column.e2e-legacy.ts
This file was deleted.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
core/src/components/picker-column/test/standalone/picker-column.e2e.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { configs, test } from '@utils/test/playwright'; | ||
|
||
import { testPickerColumn } from '../test.utils'; | ||
|
||
configs().forEach(({ title, screenshot, config }) => { | ||
test.describe(title('picker-column'), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/src/components/picker-column/test/standalone', config); | ||
}); | ||
test.describe('single column', () => { | ||
test('should not have any visual regressions', async ({ page }) => { | ||
await testPickerColumn(page, screenshot, '#single-column-button', 'single'); | ||
}); | ||
}); | ||
|
||
test.describe('multiple columns', () => { | ||
test('should not have any visual regressions', async ({ page }) => { | ||
await testPickerColumn(page, screenshot, '#multiple-column-button', 'multiple'); | ||
}); | ||
}); | ||
}); | ||
}); |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 0 additions & 26 deletions
26
core/src/components/picker/test/basic/picker.e2e-legacy.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { expect } from '@playwright/test'; | ||
import { configs, test } from '@utils/test/playwright'; | ||
|
||
configs().forEach(({ title, screenshot, config }) => { | ||
test.describe(title('picker: basic'), () => { | ||
test('should not have visual regressions', async ({ page }) => { | ||
await page.goto('/src/components/picker/test/basic', config); | ||
const didPresent = await page.spyOnEvent('ionPickerDidPresent'); | ||
const didDismiss = await page.spyOnEvent('ionPickerDidDismiss'); | ||
|
||
await page.click('#basic'); | ||
await didPresent.next(); | ||
await page.waitForChanges(); | ||
|
||
await expect(page).toHaveScreenshot(screenshot(`picker-basic`)); | ||
|
||
await page.click('.picker-opt:nth-child(2)'); | ||
await page.click('ion-picker .save-btn'); | ||
await didDismiss.next(); | ||
|
||
await page.click('#basic'); | ||
await didPresent.next(); | ||
await page.waitForChanges(); | ||
|
||
await expect(page).toHaveScreenshot(screenshot(`picker-value-selected`)); | ||
}); | ||
}); | ||
}); |
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
34 changes: 0 additions & 34 deletions
34
core/src/components/picker/test/is-open/picker.e2e-legacy.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { expect } from '@playwright/test'; | ||
import { configs, test } from '@utils/test/playwright'; | ||
|
||
/** | ||
* This behavior does not vary across modes/directions. | ||
*/ | ||
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { | ||
test.describe(title('picker: isOpen'), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/src/components/picker/test/is-open', config); | ||
}); | ||
|
||
test('should open the picker', async ({ page }) => { | ||
const ionPickerDidPresent = await page.spyOnEvent('ionPickerDidPresent'); | ||
const picker = page.locator('ion-picker'); | ||
|
||
await page.click('#default'); | ||
|
||
await ionPickerDidPresent.next(); | ||
await expect(picker).toBeVisible(); | ||
}); | ||
|
||
test('should open the picker then close after a timeout', async ({ page }) => { | ||
const ionPickerDidPresent = await page.spyOnEvent('ionPickerDidPresent'); | ||
const ionPickerDidDismiss = await page.spyOnEvent('ionPickerDidDismiss'); | ||
const picker = page.locator('ion-picker'); | ||
|
||
await page.click('#timeout'); | ||
|
||
await ionPickerDidPresent.next(); | ||
await expect(picker).toBeVisible(); | ||
|
||
await ionPickerDidDismiss.next(); | ||
await expect(picker).toBeHidden(); | ||
}); | ||
}); | ||
}); |
35 changes: 0 additions & 35 deletions
35
core/src/components/picker/test/trigger/picker.e2e-legacy.ts
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { expect } from '@playwright/test'; | ||
import { configs, test } from '@utils/test/playwright'; | ||
|
||
/** | ||
* This behavior does not vary across modes/directions. | ||
*/ | ||
configs({ modes: ['ios'], directions: ['ltr'] }).forEach(({ title, config }) => { | ||
test.describe(title('picker: trigger'), () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto('/src/components/picker/test/trigger', config); | ||
}); | ||
|
||
test('should open the picker', async ({ page }) => { | ||
const ionPickerDidPresent = await page.spyOnEvent('ionPickerDidPresent'); | ||
const picker = page.locator('#default-picker'); | ||
|
||
await page.click('#default'); | ||
|
||
await ionPickerDidPresent.next(); | ||
await expect(picker).toBeVisible(); | ||
}); | ||
|
||
test('should present a previously presented picker', async ({ page }) => { | ||
const ionPickerDidPresent = await page.spyOnEvent('ionPickerDidPresent'); | ||
const ionPickerDidDismiss = await page.spyOnEvent('ionPickerDidDismiss'); | ||
const picker = page.locator('#timeout-picker'); | ||
|
||
await page.click('#timeout'); | ||
|
||
await ionPickerDidDismiss.next(); | ||
|
||
await page.click('#timeout'); | ||
|
||
await ionPickerDidPresent.next(); | ||
await expect(picker).toBeVisible(); | ||
}); | ||
}); | ||
}); |