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:
Liam DeBeasi
2019-03-26 11:41:29 -04:00
committed by GitHub
parent 1ecfcd1902
commit c47764c670
3 changed files with 16 additions and 5 deletions

View File

@ -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`));

View File

@ -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);
});

View File

@ -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');