-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Uptime] Add functional UI tests #29667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 72 commits
80c4afd
0889e35
bfd9029
737af05
665a7b7
cd16442
59a59f4
a03fb9d
04e8818
91b961d
fecfe54
28db77e
ab9d159
a3f6d6f
e911f62
8b42129
78f88c6
3e7e918
dd2916d
8178a47
81eb06c
fd7f930
a714129
81baabd
c5b198b
ed4d83d
21a7b3b
d2dc10a
f4f863d
6728fd6
6d542a8
5dd3fcd
c11f6f0
ea4e0ef
c82ca56
180196b
9f6088e
ffbc297
1f4b1f1
12df980
bafbcfb
7f77844
f70b731
3832749
ec731ca
b547914
096bb14
e111662
90752cb
14573f0
5aab60a
8d6df4a
d9a4128
0027388
ee89320
3922254
24d06f2
e6b377a
dc40167
4c544f5
692bc12
39db8c9
6a0b011
472e422
ec0d53c
89d4d67
b15caac
14736ac
c9d1990
dbf17e1
befa5f1
b22aa16
c939399
f10c481
b50843f
912e44b
9c886e8
79902b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import { KibanaFunctionalTestDefaultProviders } from '../../../types/providers'; | ||
|
|
||
| // tslint:disable-next-line:no-default-export | ||
| export default ({ getPageObjects, getService }: KibanaFunctionalTestDefaultProviders) => { | ||
| const esArchiver = getService('esArchiver'); | ||
| // TODO: add UI functional tests | ||
| const pageObjects = getPageObjects(['uptime']); | ||
| const archive = 'uptime/full_heartbeat'; | ||
|
|
||
| describe('monitor page', () => { | ||
| before(async () => { | ||
| await esArchiver.load(archive); | ||
| }); | ||
| after(async () => await esArchiver.unload(archive)); | ||
| it('loads and displays uptime data based on date range', async () => { | ||
| await pageObjects.uptime.loadDataAndGoToMonitorPage( | ||
| '2019-01-28 12:40:08.078', | ||
| 'auto-http-0X131221E73F825974', | ||
| 'https://www.google.com/' | ||
| ); | ||
| }); | ||
| }); | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,12 +8,23 @@ import { KibanaFunctionalTestDefaultProviders } from '../../types/providers'; | |
|
|
||
| export const UptimeProvider = ({ getService }: KibanaFunctionalTestDefaultProviders) => { | ||
| const testSubjects = getService('testSubjects'); | ||
|
|
||
| return { | ||
| async assertExists(key: string) { | ||
| if (!(await testSubjects.exists(key))) { | ||
| throw new Error(`Couldn't find expected element with key "${key}".`); | ||
| } | ||
| }, | ||
| async navigateToPlugin() { | ||
| await testSubjects.click('homeSynopsisLinkuptime'); | ||
| }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there's a problem here. This method is clicking the You might want to consider changing the uptime_page.ts goToUptimeOverviewAndLoadData method like this (take out navigating to home and then to the plugin and navigateToApp straight to uptime since that navigateToApp already should have the appropriate wait for the page to load build in // await pageObject.common.navigateToApp('home');
// await uptimeService.navigateToPlugin();
await pageObject.common.navigateToApp('uptime');
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK we aren't using that code anymore, so we can probably delete it safely altogether. I'll post back here after I investigate.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @LeeDr it looks like we actually did delete that code already, so I think we're good! |
||
| async monitorIdExists(key: string) { | ||
| await testSubjects.existOrFail(key); | ||
| }, | ||
| async navigateToMonitorWithId(monitorId: string) { | ||
| await testSubjects.click(`monitor-page-link-${monitorId}`); | ||
| }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pulled this PR and I'm running it. It fails for me here;
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Strangely it worked for me the last time I ran it locally. I'll revisit it when I get a second. |
||
| async getMonitorNameDisplayedOnPageTitle() { | ||
| return await testSubjects.getVisibleText('monitor-page-title'); | ||
| }, | ||
| }; | ||
| }; | ||

There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you clarify this comment?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove it, as we have added some UI functional tests.
EDIT: c939399