diff --git a/core/src/components/fab/test/test.utils.ts b/core/src/components/fab/test/test.utils.ts index fdfabf24ac..d06f69c4f8 100644 --- a/core/src/components/fab/test/test.utils.ts +++ b/core/src/components/fab/test/test.utils.ts @@ -24,6 +24,8 @@ export async function testFab( const fab = await getFabComponent(page, selector); await fab.click(); + await page.waitFor(150); + await ensureFabState(fab, 'active'); screenshotCompares.push(await page.compareScreenshot(`${screenshotName} open`)); @@ -31,6 +33,8 @@ export async function testFab( const fabButton = await getFabButton(fab); await fabButton.click(); + await page.waitFor(150); + await ensureFabState(fab, 'inactive'); screenshotCompares.push(await page.compareScreenshot(`${screenshotName} close`)); diff --git a/core/src/components/menu/test/basic/e2e.ts b/core/src/components/menu/test/basic/e2e.ts index 8b43a17cb9..8f92edca6e 100644 --- a/core/src/components/menu/test/basic/e2e.ts +++ b/core/src/components/menu/test/basic/e2e.ts @@ -3,11 +3,11 @@ import { testMenu } from '../test.utils'; const DIRECTORY = 'basic'; test('menu: start menu', async () => { - await testMenu(DIRECTORY, '#start-menu'); + await testMenu(DIRECTORY, '#start-menu', 'first'); }); test('menu: start custom menu', async () => { - await testMenu(DIRECTORY, '#custom-menu'); + await testMenu(DIRECTORY, '#custom-menu', 'custom'); }); test('menu: end menu', async () => { @@ -19,13 +19,13 @@ test('menu: end menu', async () => { */ test('menu:rtl: start menu', async () => { - await testMenu(DIRECTORY, '#start-menu', true); + await testMenu(DIRECTORY, '#start-menu', 'first', true); }); test('menu:rtl: start custom menu', async () => { - await testMenu(DIRECTORY, '#custom-menu', true); + await testMenu(DIRECTORY, '#custom-menu', 'custom', true); }); test('menu:rtl: end menu', async () => { - await testMenu(DIRECTORY, '#end-menu', true); + await testMenu(DIRECTORY, '#end-menu', '', true); }); diff --git a/core/src/components/menu/test/test.utils.ts b/core/src/components/menu/test/test.utils.ts index 9259256f5e..5d9c1d3aa2 100644 --- a/core/src/components/menu/test/test.utils.ts +++ b/core/src/components/menu/test/test.utils.ts @@ -5,6 +5,7 @@ import { cleanScreenshotName, generateE2EUrl } from '../../../utils/test/utils'; export async function testMenu( type: string, selector: string, + menuId = '', rtl = false, screenshotName: string = cleanScreenshotName(selector) ) { @@ -20,6 +21,12 @@ export async function testMenu( const screenshotCompares = []; + if (menuId.length > 0) { + const menuCtrl = await page.find('ion-menu-controller'); + await page.waitFor(250); + await menuCtrl.callMethod('enable', true, menuId); + } + const menu = await page.find(selector); await menu.callMethod('open');