mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
tests(): increase timeout for fab and menu tests (#17826)
* increase timeouts for fab and menu tests * increase menu timeout * wait for menu to be available * change 250 to 150 * revert 150ms timeout for menu * testing longer menu timeout * testing increased timeout * add enable command * add enable menu ctrl method call * remove debug timeouts
This commit is contained in:
@ -24,6 +24,8 @@ export async function testFab(
|
|||||||
const fab = await getFabComponent(page, selector);
|
const fab = await getFabComponent(page, selector);
|
||||||
await fab.click();
|
await fab.click();
|
||||||
|
|
||||||
|
await page.waitFor(150);
|
||||||
|
|
||||||
await ensureFabState(fab, 'active');
|
await ensureFabState(fab, 'active');
|
||||||
|
|
||||||
screenshotCompares.push(await page.compareScreenshot(`${screenshotName} open`));
|
screenshotCompares.push(await page.compareScreenshot(`${screenshotName} open`));
|
||||||
@ -31,6 +33,8 @@ export async function testFab(
|
|||||||
const fabButton = await getFabButton(fab);
|
const fabButton = await getFabButton(fab);
|
||||||
await fabButton.click();
|
await fabButton.click();
|
||||||
|
|
||||||
|
await page.waitFor(150);
|
||||||
|
|
||||||
await ensureFabState(fab, 'inactive');
|
await ensureFabState(fab, 'inactive');
|
||||||
|
|
||||||
screenshotCompares.push(await page.compareScreenshot(`${screenshotName} close`));
|
screenshotCompares.push(await page.compareScreenshot(`${screenshotName} close`));
|
||||||
|
@ -3,11 +3,11 @@ import { testMenu } from '../test.utils';
|
|||||||
const DIRECTORY = 'basic';
|
const DIRECTORY = 'basic';
|
||||||
|
|
||||||
test('menu: start menu', async () => {
|
test('menu: start menu', async () => {
|
||||||
await testMenu(DIRECTORY, '#start-menu');
|
await testMenu(DIRECTORY, '#start-menu', 'first');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('menu: start custom menu', async () => {
|
test('menu: start custom menu', async () => {
|
||||||
await testMenu(DIRECTORY, '#custom-menu');
|
await testMenu(DIRECTORY, '#custom-menu', 'custom');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('menu: end menu', async () => {
|
test('menu: end menu', async () => {
|
||||||
@ -19,13 +19,13 @@ test('menu: end menu', async () => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
test('menu:rtl: start 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 () => {
|
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 () => {
|
test('menu:rtl: end menu', async () => {
|
||||||
await testMenu(DIRECTORY, '#end-menu', true);
|
await testMenu(DIRECTORY, '#end-menu', '', true);
|
||||||
});
|
});
|
||||||
|
@ -5,6 +5,7 @@ import { cleanScreenshotName, generateE2EUrl } from '../../../utils/test/utils';
|
|||||||
export async function testMenu(
|
export async function testMenu(
|
||||||
type: string,
|
type: string,
|
||||||
selector: string,
|
selector: string,
|
||||||
|
menuId = '',
|
||||||
rtl = false,
|
rtl = false,
|
||||||
screenshotName: string = cleanScreenshotName(selector)
|
screenshotName: string = cleanScreenshotName(selector)
|
||||||
) {
|
) {
|
||||||
@ -20,6 +21,12 @@ export async function testMenu(
|
|||||||
|
|
||||||
const screenshotCompares = [];
|
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);
|
const menu = await page.find(selector);
|
||||||
|
|
||||||
await menu.callMethod('open');
|
await menu.callMethod('open');
|
||||||
|
Reference in New Issue
Block a user