Skip to content

Commit

Permalink
Disable timestamp on uptime app navigation for functional tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Mar 12, 2019
1 parent f10c481 commit b50843f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 2 additions & 0 deletions test/functional/page_objects/time_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ 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 });
const isShowDatesButton = await testSubjects.exists('superDatePickerShowDatesButton');
if (isShowDatesButton) {
await testSubjects.click('superDatePickerShowDatesButton');
Expand Down
2 changes: 1 addition & 1 deletion test/functional/services/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export async function BrowserProvider({ getService }) {
* @param {boolean} insertTimestamp Optional
* @return {Promise<void>}
*/
async get(url, insertTimestamp = true) {
async get(url, insertTimestamp = false) {
if (insertTimestamp) {
const urlWithTime = modifyUrl(url, parsed => {
parsed.query._t = Date.now();
Expand Down
12 changes: 5 additions & 7 deletions x-pack/test/functional/page_objects/uptime_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,16 @@ export const UptimePageProvider = ({
getPageObjects,
getService,
}: KibanaFunctionalTestDefaultProviders) => {
const pageObject = getPageObjects(['common', 'timePicker']);
const pageObjects = getPageObjects(['common', 'timePicker']);
const uptimeService = getService('uptime');

return new class UptimePage {
public async goToUptimeOverviewAndLoadData(
datePickerStartValue: string,
monitorIdToCheck: string
) {
await pageObject.common.navigateToApp('home');
await uptimeService.navigateToPlugin();
await pageObject.timePicker.setAbsoluteStart(datePickerStartValue);
await pageObjects.common.navigateToApp('uptime');
await pageObjects.timePicker.setAbsoluteStart(datePickerStartValue);
await uptimeService.monitorIdExists(monitorIdToCheck);
}

Expand All @@ -29,9 +28,8 @@ export const UptimePageProvider = ({
monitorId: string,
monitorName: string
) {
await pageObject.common.navigateToApp('home');
await uptimeService.navigateToPlugin();
await pageObject.timePicker.setAbsoluteStart(datePickerStartValue);
await pageObjects.common.navigateToApp('uptime');
await pageObjects.timePicker.setAbsoluteStart(datePickerStartValue);
await uptimeService.navigateToMonitorWithId(monitorId);
if ((await uptimeService.getMonitorNameDisplayedOnPageTitle()) !== monitorName) {
throw new Error('Expected monitor name not found');
Expand Down
3 changes: 0 additions & 3 deletions x-pack/test/functional/services/uptime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ export const UptimeProvider = ({ getService }: KibanaFunctionalTestDefaultProvid
throw new Error(`Couldn't find expected element with key "${key}".`);
}
},
async navigateToPlugin() {
await testSubjects.click('homeSynopsisLinkuptime');
},
async monitorIdExists(key: string) {
await testSubjects.existOrFail(key);
},
Expand Down

0 comments on commit b50843f

Please sign in to comment.