remove hard coded timeouts

This commit is contained in:
spalger 2020-02-14 12:13:50 -07:00
parent 8caa012f1f
commit 8b843d0aa6
27 changed files with 220 additions and 71 deletions

View file

@ -98,8 +98,6 @@ export const schema = Joi.object()
try: Joi.number().default(120000),
waitFor: Joi.number().default(20000),
esRequestTimeout: Joi.number().default(30000),
kibanaStabilize: Joi.number().default(15000),
navigateStatusPageCheck: Joi.number().default(250),
// Many of our tests use the `exists` functions to determine where the user is. For
// example, you'll see a lot of code like:

View file

@ -28,6 +28,7 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
const log = getService('log');
const find = getService('find');
const retry = getService('retry');
const config = getService('config');
const browser = getService('browser');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
@ -114,7 +115,7 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
public async onDashboardLandingPage() {
log.debug(`onDashboardLandingPage`);
return await testSubjects.exists('dashboardLandingPage', {
timeout: 5000,
timeout: config.get('timeouts.waitForExits') * 2,
});
}
@ -362,7 +363,9 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
await listingTable.clickItemLink('dashboard', dashboardName);
await PageObjects.header.waitUntilLoadingHasFinished();
// check Dashboard landing page is not present
await testSubjects.missingOrFail('dashboardLandingPage', { timeout: 10000 });
await testSubjects.missingOrFail('dashboardLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
}
@ -497,7 +500,7 @@ export function DashboardPageProvider({ getService, getPageObjects }: FtrProvide
for (const name of vizList) {
const isPresent = await testSubjects.exists(
`embeddablePanelHeading-${name.replace(/\s+/g, '')}`,
{ timeout: 10000 }
{ timeout: config.get('timeouts.waitForExits') * 5 }
);
checkList.push({ name, isPresent });
}

View file

@ -79,7 +79,9 @@ export function HeaderPageProvider({ getService, getPageObjects }) {
async isGlobalLoadingIndicatorVisible() {
log.debug('isGlobalLoadingIndicatorVisible');
return await testSubjects.exists('globalLoadingIndicator', { timeout: 1500 });
return await testSubjects.exists('globalLoadingIndicator', {
timeout: config.get('timeouts.waitForExits') * 0.6,
});
}
async awaitGlobalLoadingIndicatorHidden() {

View file

@ -22,6 +22,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
export function HomePageProvider({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const retry = getService('retry');
const config = getService('config');
const find = getService('find');
const PageObjects = getPageObjects(['common']);
let isOss = true;
@ -83,7 +84,7 @@ export function HomePageProvider({ getService, getPageObjects }: FtrProviderCont
await retry.try(async () => {
await testSubjects.click('loadSavedObjects');
const successMsgExists = await testSubjects.exists('loadSavedObjects_success', {
timeout: 5000,
timeout: config.get('timeouts.waitForExits') * 2,
});
if (!successMsgExists) {
throw new Error('Failed to load saved objects');

View file

@ -25,6 +25,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
export function SettingsPageProvider({ getService, getPageObjects }: FtrProviderContext) {
const log = getService('log');
const retry = getService('retry');
const config = getService('config');
const browser = getService('browser');
const find = getService('find');
const flyout = getService('flyout');
@ -298,12 +299,16 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
}
async getIndexPatternList() {
await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 });
await testSubjects.existOrFail('indexPatternTable', {
timeout: config.get('timeouts.waitForExits') * 2,
});
return await find.allByCssSelector('[data-test-subj="indexPatternTable"] .euiTable a');
}
async isIndexPatternListEmpty() {
await testSubjects.existOrFail('indexPatternTable', { timeout: 5000 });
await testSubjects.existOrFail('indexPatternTable', {
timeout: config.get('timeouts.waitForExits') * 2,
});
const indexPatternList = await this.getIndexPatternList();
return indexPatternList.length === 0;
}
@ -629,23 +634,33 @@ export function SettingsPageProvider({ getService, getPageObjects }: FtrProvider
}
async checkImportSucceeded() {
await testSubjects.existOrFail('importSavedObjectsSuccess', { timeout: 20000 });
await testSubjects.existOrFail('importSavedObjectsSuccess', {
timeout: config.get('timeouts.waitForExits') * 10,
});
}
async checkNoneImported() {
await testSubjects.existOrFail('importSavedObjectsSuccessNoneImported', { timeout: 20000 });
await testSubjects.existOrFail('importSavedObjectsSuccessNoneImported', {
timeout: config.get('timeouts.waitForExits') * 10,
});
}
async checkImportConflictsWarning() {
await testSubjects.existOrFail('importSavedObjectsConflictsWarning', { timeout: 20000 });
await testSubjects.existOrFail('importSavedObjectsConflictsWarning', {
timeout: config.get('timeouts.waitForExits') * 10,
});
}
async checkImportLegacyWarning() {
await testSubjects.existOrFail('importSavedObjectsLegacyWarning', { timeout: 20000 });
await testSubjects.existOrFail('importSavedObjectsLegacyWarning', {
timeout: config.get('timeouts.waitForExits') * 10,
});
}
async checkImportFailedWarning() {
await testSubjects.existOrFail('importSavedObjectsFailedWarning', { timeout: 20000 });
await testSubjects.existOrFail('importSavedObjectsFailedWarning', {
timeout: config.get('timeouts.waitForExits') * 10,
});
}
async clickImportDone() {

View file

@ -23,6 +23,7 @@ export function TimePickerPageProvider({ getService, getPageObjects }) {
const log = getService('log');
const retry = getService('retry');
const find = getService('find');
const config = getService('config');
const browser = getService('browser');
const testSubjects = getService('testSubjects');
const PageObjects = getPageObjects(['header', 'common']);
@ -157,7 +158,9 @@ export function TimePickerPageProvider({ getService, getPageObjects }) {
async showStartEndTimes() {
// This first await makes sure the superDatePicker has loaded before we check for the ShowDatesButton
await testSubjects.exists('superDatePickerToggleQuickMenuButton', { timeout: 20000 });
await testSubjects.exists('superDatePickerToggleQuickMenuButton', {
timeout: config.get('timeouts.waitForExits') * 10,
});
const isShowDatesButton = await testSubjects.exists('superDatePickerShowDatesButton');
if (isShowDatesButton) {
await testSubjects.click('superDatePickerShowDatesButton');

View file

@ -24,6 +24,7 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
const find = getService('find');
const log = getService('log');
const retry = getService('retry');
const config = getService('config');
const testSubjects = getService('testSubjects');
const comboBox = getService('comboBox');
const PageObjects = getPageObjects(['common', 'header', 'visualize', 'timePicker', 'visChart']);
@ -54,7 +55,9 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
}
public async checkTabIsLoaded(testSubj: string, name: string) {
const isPresent = await testSubjects.exists(testSubj, { timeout: 10000 });
const isPresent = await testSubjects.exists(testSubj, {
timeout: config.get('timeouts.waitForExits') * 5,
});
if (!isPresent) {
throw new Error(`TSVB ${name} tab is not loaded`);
}
@ -503,7 +506,9 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
public async checkColorPickerPopUpIsPresent(): Promise<void> {
log.debug(`Check color picker popup is present`);
await testSubjects.existOrFail('tvbColorPickerPopUp', { timeout: 5000 });
await testSubjects.existOrFail('tvbColorPickerPopUp', {
timeout: config.get('timeouts.waitForExits') * 2,
});
}
public async changePanelPreview(nth: number = 0): Promise<void> {
@ -515,7 +520,9 @@ export function VisualBuilderPageProvider({ getService, getPageObjects }: FtrPro
public async checkPreviewIsDisabled(): Promise<void> {
log.debug(`Check no data message is present`);
await testSubjects.existOrFail('noTSVBDataMessage', { timeout: 5000 });
await testSubjects.existOrFail('noTSVBDataMessage', {
timeout: config.get('timeouts.waitForExits') * 2,
});
}
public async cloneSeries(nth: number = 0): Promise<void> {

View file

@ -22,6 +22,7 @@ import { VisualizeConstants } from '../../../src/legacy/core_plugins/kibana/publ
export function VisualizePageProvider({ getService, getPageObjects }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const config = getService('config');
const retry = getService('retry');
const find = getService('find');
const log = getService('log');
@ -216,7 +217,9 @@ export function VisualizePageProvider({ getService, getPageObjects }: FtrProvide
public async ensureSavePanelOpen() {
log.debug('ensureSavePanelOpen');
await header.waitUntilLoadingHasFinished();
const isOpen = await testSubjects.exists('savedObjectSaveModal', { timeout: 5000 });
const isOpen = await testSubjects.exists('savedObjectSaveModal', {
timeout: config.get('timeouts.waitForExits') * 2,
});
if (!isOpen) {
await testSubjects.click('visualizeSaveButton');
}

View file

@ -21,6 +21,7 @@ import { FtrProviderContext } from '../ftr_provider_context';
export function FlyoutProvider({ getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const config = getService('config');
const find = getService('find');
const log = getService('log');
const retry = getService('retry');
@ -33,12 +34,19 @@ export function FlyoutProvider({ getService }: FtrProviderContext) {
await closeBtn.click();
await retry.waitFor(
'flyout closed',
async () => !(await testSubjects.exists(dataTestSubj, { timeout: 1000 }))
async () =>
!(await testSubjects.exists(dataTestSubj, {
timeout: config.get('timeouts.waitForExits') * 0.4,
}))
);
}
public async ensureClosed(dataTestSubj: string): Promise<void> {
if (await testSubjects.exists(dataTestSubj, { timeout: 1000 })) {
if (
await testSubjects.exists(dataTestSubj, {
timeout: config.get('timeouts.waitForExits') * 0.4,
})
) {
await this.close(dataTestSubj);
}
}

View file

@ -36,6 +36,7 @@ declare global {
export default function({ getService, getPageObjects }: PluginFunctionalProviderContext) {
const PageObjects = getPageObjects(['common']);
const appsMenu = getService('appsMenu');
const config = getService('config');
const browser = getService('browser');
const find = getService('find');
const testSubjects = getService('testSubjects');
@ -62,7 +63,8 @@ export default function({ getService, getPageObjects }: PluginFunctionalProvider
return JSON.parse(document.querySelector('kbn-injected-metadata')!.getAttribute('data')!)
.legacyMetadata.uiSettings.user;
});
const exists = (selector: string) => testSubjects.exists(selector, { timeout: 5000 });
const exists = (selector: string) =>
testSubjects.exists(selector, { timeout: config.get('timeouts.waitForExits') * 2 });
const findLoadingMessage = () => testSubjects.find('kbnLoadingMessage', 5000);
const getRenderingSession = () =>
browser.execute(() => {

View file

@ -14,6 +14,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const appsMenu = getService('appsMenu');
const testSubjects = getService('testSubjects');
const globalNav = getService('globalNav');
const config = getService('config');
describe('security feature controls', () => {
before(async () => {
@ -184,7 +185,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('managementHome', {
timeout: 10000,
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});

View file

@ -9,6 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const security = getService('security');
const config = getService('config');
const PageObjects = getPageObjects(['common', 'error', 'security']);
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
@ -66,7 +67,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('can navigate to APM app', async () => {
await PageObjects.common.navigateToApp('apm');
await testSubjects.existOrFail('apmMainContainer', {
timeout: 10000,
timeout: config.get('timeouts.waitForExits') * 5,
});
});
@ -115,7 +116,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('can navigate to APM app', async () => {
await PageObjects.common.navigateToApp('apm');
await testSubjects.existOrFail('apmMainContainer', {
timeout: 10000,
timeout: config.get('timeouts.waitForExits') * 5,
});
});

View file

@ -8,6 +8,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const spacesService = getService('spaces');
const config = getService('config');
const PageObjects = getPageObjects(['common', 'error', 'timePicker', 'security', 'settings']);
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
@ -38,7 +39,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('can navigate to Uptime app', async () => {
await PageObjects.common.navigateToApp('apm');
await testSubjects.existOrFail('apmMainContainer', {
timeout: 10000,
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});

View file

@ -13,6 +13,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const security = getService('security');
const config = getService('config');
const PageObjects = getPageObjects(['common', 'dashboard', 'security', 'spaceSelector', 'share']);
const appsMenu = getService('appsMenu');
const panelActions = getService('dashboardPanelActions');
@ -87,7 +88,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('dashboardLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('dashboardLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.existOrFail('newItemButton');
});
@ -104,7 +107,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('emptyDashboardWidget', { timeout: 10000 });
await testSubjects.existOrFail('emptyDashboardWidget', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`can view existing Dashboard`, async () => {
@ -112,7 +117,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('embeddablePanelHeading-APie', { timeout: 10000 });
await testSubjects.existOrFail('embeddablePanelHeading-APie', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`does not allow a visualization to be edited`, async () => {
@ -265,7 +272,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('dashboardLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('dashboardLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.missingOrFail('newItemButton');
});
@ -290,7 +299,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('embeddablePanelHeading-APie', { timeout: 10000 });
await testSubjects.existOrFail('embeddablePanelHeading-APie', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`Permalinks doesn't show create short-url button`, async () => {
@ -376,7 +387,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`create new dashboard redirects to the home page`, async () => {
@ -400,7 +413,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`edit dashboard for object which exists redirects to the home page`, async () => {
@ -408,7 +423,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -13,6 +13,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const spacesService = getService('spaces');
const config = getService('config');
const PageObjects = getPageObjects([
'common',
'dashboard',
@ -64,7 +65,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('dashboardLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('dashboardLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.existOrFail('newItemButton');
});
@ -78,7 +81,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('emptyDashboardWidget', { timeout: 10000 });
await testSubjects.existOrFail('emptyDashboardWidget', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`can view existing Dashboard`, async () => {
@ -87,7 +92,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('embeddablePanelHeading-APie', { timeout: 10000 });
await testSubjects.existOrFail('embeddablePanelHeading-APie', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
@ -126,7 +133,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`edit dashboard for object which doesn't exist redirects to the home page`, async () => {
@ -139,7 +148,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`edit dashboard for object which exists redirects to the home page`, async () => {
@ -148,7 +159,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -12,6 +12,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'console', 'security']);
const appsMenu = getService('appsMenu');
const testSubjects = getService('testSubjects');
const config = getService('config');
const grokDebugger = getService('grokDebugger');
const globalNav = getService('globalNav');
@ -232,21 +233,27 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToUrl('console', '', {
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`navigating to search profiler redirect to homepage`, async () => {
await PageObjects.common.navigateToUrl('searchProfiler', '', {
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`navigating to grok debugger redirect to homepage`, async () => {
await PageObjects.common.navigateToUrl('grokDebugger', '', {
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -9,6 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const spacesService = getService('spaces');
const config = getService('config');
const PageObjects = getPageObjects([
'common',
'dashboard',
@ -92,21 +93,27 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToUrl('console', '', {
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`navigating to search profiler redirect to homepage`, async () => {
await PageObjects.common.navigateToUrl('searchProfiler', '', {
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`navigating to grok debugger redirect to homepage`, async () => {
await PageObjects.common.navigateToUrl('grokDebugger', '', {
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -10,6 +10,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const security = getService('security');
const globalNav = getService('globalNav');
const config = getService('config');
const PageObjects = getPageObjects([
'common',
'discover',
@ -173,7 +174,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it(`doesn't show save button`, async () => {
await PageObjects.common.navigateToApp('discover');
await testSubjects.existOrFail('discoverNewButton', { timeout: 10000 });
await testSubjects.existOrFail('discoverNewButton', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.missingOrFail('discoverSaveButton');
});
@ -304,7 +307,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToUrl('discover', '', {
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -9,6 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const spacesService = getService('spaces');
const config = getService('config');
const PageObjects = getPageObjects([
'common',
'discover',
@ -59,7 +60,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('discover', {
basePath: '/s/custom_space',
});
await testSubjects.existOrFail('discoverSaveButton', { timeout: 10000 });
await testSubjects.existOrFail('discoverSaveButton', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it('shows "visualize" field button', async () => {
@ -156,7 +159,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
basePath: '/s/custom_space',
ensureCurrentUrl: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -13,6 +13,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
const globalNav = getService('globalNav');
const config = getService('config');
describe('security', () => {
before(async () => {
@ -69,7 +70,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('landing page shows "Create new graph" button', async () => {
await PageObjects.common.navigateToApp('graph');
await testSubjects.existOrFail('graphLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('graphLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.existOrFail('graphCreateGraphPromptButton');
});
@ -132,7 +135,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('does not show a "Create new Workspace" button', async () => {
await PageObjects.common.navigateToApp('graph');
await testSubjects.existOrFail('graphLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('graphLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.missingOrFail('newItemButton');
});

View file

@ -11,6 +11,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const spacesService = getService('spaces');
const PageObjects = getPageObjects(['common', 'graph', 'security', 'error', 'settings']);
const testSubjects = getService('testSubjects');
const config = getService('config');
const appsMenu = getService('appsMenu');
describe('spaces', () => {
@ -43,7 +44,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
await PageObjects.common.navigateToApp('graph', {
basePath: '/s/custom_space',
});
await testSubjects.existOrFail('graphLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('graphLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.existOrFail('graphCreateGraphPromptButton');
});

View file

@ -14,6 +14,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const appsMenu = getService('appsMenu');
const testSubjects = getService('testSubjects');
const globalNav = getService('globalNav');
const config = getService('config');
describe('security', () => {
before(async () => {
@ -190,7 +191,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -12,6 +12,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'settings', 'security']);
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
const config = getService('config');
describe('spaces', () => {
before(async () => {
@ -75,7 +76,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -13,6 +13,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
const globalNav = getService('globalNav');
const config = getService('config');
describe('security', () => {
before(async () => {
@ -69,7 +70,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('can navigate to Uptime app', async () => {
await PageObjects.common.navigateToApp('uptime');
await testSubjects.existOrFail('uptimeApp', { timeout: 10000 });
await testSubjects.existOrFail('uptimeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`doesn't show read-only badge`, async () => {
@ -120,7 +123,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('can navigate to Uptime app', async () => {
await PageObjects.common.navigateToApp('uptime');
await testSubjects.existOrFail('uptimeApp', { timeout: 10000 });
await testSubjects.existOrFail('uptimeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`shows read-only badge`, async () => {

View file

@ -11,6 +11,7 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
const PageObjects = getPageObjects(['common', 'error', 'timePicker', 'security', 'settings']);
const testSubjects = getService('testSubjects');
const appsMenu = getService('appsMenu');
const config = getService('config');
describe('spaces', () => {
describe('space with no features disabled', () => {
@ -37,7 +38,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it('can navigate to Uptime app', async () => {
await PageObjects.common.navigateToApp('uptime');
await testSubjects.existOrFail('uptimeApp', { timeout: 10000 });
await testSubjects.existOrFail('uptimeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});

View file

@ -9,6 +9,7 @@ import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const esArchiver = getService('esArchiver');
const security = getService('security');
const config = getService('config');
const PageObjects = getPageObjects([
'common',
'visualize',
@ -80,7 +81,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it(`landing page shows "Create new Visualization" button`, async () => {
await PageObjects.visualize.gotoVisualizationLandingPage();
await testSubjects.existOrFail('visualizeLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('visualizeLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.existOrFail('newItemButton');
});
@ -93,7 +96,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('visualizationLoader', { timeout: 10000 });
await testSubjects.existOrFail('visualizationLoader', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it('can save existing Visualization', async () => {
@ -101,7 +106,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('visualizeSaveButton', { timeout: 10000 });
await testSubjects.existOrFail('visualizeSaveButton', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it('Embed code shows create short-url button', async () => {
@ -198,7 +205,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
it(`landing page shows "Create new Visualization" button`, async () => {
await PageObjects.visualize.gotoVisualizationLandingPage();
await testSubjects.existOrFail('visualizeLandingPage', { timeout: 10000 });
await testSubjects.existOrFail('visualizeLandingPage', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.existOrFail('newItemButton');
});
@ -211,7 +220,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('visualizationLoader', { timeout: 10000 });
await testSubjects.existOrFail('visualizationLoader', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`can't save existing Visualization`, async () => {
@ -219,8 +230,12 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('shareTopNavButton', { timeout: 10000 });
await testSubjects.missingOrFail('visualizeSaveButton', { timeout: 10000 });
await testSubjects.existOrFail('shareTopNavButton', {
timeout: config.get('timeouts.waitForExits') * 5,
});
await testSubjects.missingOrFail('visualizeSaveButton', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`Embed Code doesn't show create short-url button`, async () => {
@ -304,7 +319,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`edit page redirects to home page`, async () => {
@ -312,7 +329,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});

View file

@ -8,6 +8,7 @@ import { VisualizeConstants } from '../../../../../../src/legacy/core_plugins/ki
import { FtrProviderContext } from '../../../ftr_provider_context';
export default function({ getPageObjects, getService }: FtrProviderContext) {
const config = getService('config');
const esArchiver = getService('esArchiver');
const spacesService = getService('spaces');
const PageObjects = getPageObjects([
@ -61,7 +62,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('visualizationLoader', { timeout: 10000 });
await testSubjects.existOrFail('visualizationLoader', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
@ -96,7 +99,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
ensureCurrentUrl: false,
shouldLoginIfPrompted: false,
});
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`edit visualization for object which doesn't exist redirects to the home page`, async () => {
@ -109,7 +114,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
it(`edit visualization for object which exists redirects to the home page`, async () => {
@ -122,7 +129,9 @@ export default function({ getPageObjects, getService }: FtrProviderContext) {
shouldLoginIfPrompted: false,
}
);
await testSubjects.existOrFail('homeApp', { timeout: 10000 });
await testSubjects.existOrFail('homeApp', {
timeout: config.get('timeouts.waitForExits') * 5,
});
});
});
});