Skip to content
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

Tests Endpoint App Host Detail #61857

Merged
merged 41 commits into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
bd64187
endpoint-161-refactor-management-list-test
charlie-pichette Feb 20, 2020
3d5f573
Merge branch 'master' into endpoint-list-ui-tests
charlie-pichette Feb 20, 2020
f1142b4
Merge branch 'master' into endpoint-list-ui-tests
charlie-pichette Feb 21, 2020
16bf753
Merge branch 'charlie-pichette-endpoint-list-ui-tests'
charlie-pichette Feb 21, 2020
5a62211
Merge remote-tracking branch 'upstream/master'
charlie-pichette Feb 21, 2020
6e1c87f
fix location of es archive file
charlie-pichette Feb 21, 2020
e23f779
Merge remote-tracking branch 'upstream/master'
charlie-pichette Feb 21, 2020
e54ce10
Merge pull request #1 from charlie-pichette/endpoint-list-ui-tests
charlie-pichette Feb 24, 2020
345bf1f
Merge remote-tracking branch 'upstream/master'
charlie-pichette Feb 24, 2020
dfdc2c1
Merge remote-tracking branch 'upstream/master'
charlie-pichette Feb 27, 2020
60def68
Merge remote-tracking branch 'upstream/master'
charlie-pichette Feb 28, 2020
ad719dd
Merge remote-tracking branch 'upstream/master'
charlie-pichette Feb 28, 2020
4f4c246
Merge remote-tracking branch 'upstream/master'
charlie-pichette Feb 28, 2020
d6c63d9
Merge branch 'master' of https://github.com/charlie-pichette/kibana
charlie-pichette Feb 28, 2020
de21cd3
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 2, 2020
7e637cc
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 3, 2020
a860b21
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 3, 2020
126f3fd
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 4, 2020
dd2f50a
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 6, 2020
59bd743
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 17, 2020
0caa765
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 17, 2020
428eb7d
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 18, 2020
2f713d8
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 26, 2020
22f533e
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 27, 2020
9b420a9
restored missing data and added new tests
charlie-pichette Mar 30, 2020
f06176e
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 30, 2020
09cb39b
Merge branch 'master' into Tests_Host-Detail
charlie-pichette Mar 30, 2020
a0ca111
remove commented out code
charlie-pichette Mar 30, 2020
69499d8
implement suggested enhancments
charlie-pichette Mar 30, 2020
a373677
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 30, 2020
b296c8b
Merge branch 'master' into Tests_Host-Detail
charlie-pichette Mar 30, 2020
dfc99c0
fix api tests to use the restored data
charlie-pichette Mar 31, 2020
0c81316
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 31, 2020
d1f5db1
Merge branch 'master' into Tests_Host-Detail
charlie-pichette Mar 31, 2020
3fd4b7e
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 31, 2020
36c54cf
Merge branch 'master' into Tests_Host-Detail
charlie-pichette Mar 31, 2020
f60fbfb
add endpoint metadata to the alert es_archive
charlie-pichette Mar 31, 2020
02fa568
Merge remote-tracking branch 'upstream/master'
charlie-pichette Mar 31, 2020
70a6fb5
Merge branch 'master' into Tests_Host-Detail
charlie-pichette Mar 31, 2020
f29a1ee
restore the original alerts/api_feature archive
charlie-pichette Mar 31, 2020
ed196c6
skipped failing endpoint alert tests
charlie-pichette Mar 31, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 63 additions & 23 deletions x-pack/test/functional/apps/endpoint/host_list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const pageObjects = getPageObjects(['common', 'endpoint']);
const esArchiver = getService('esArchiver');
const testSubjects = getService('testSubjects');
// const log = getService('log');
// const retry = getService('retry');

describe('host list', function() {
this.tags('ciGroup7');
const sleep = (ms = 100) => new Promise(resolve => setTimeout(resolve, ms));
before(async () => {
await esArchiver.load('endpoint/metadata/api_feature');
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/hosts');
Expand All @@ -37,32 +40,32 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
'Last Active',
],
[
'Host-cxz5glsoup',
'cadmann-4.example.com',
'Policy Name',
'Policy Status',
'0',
'windows 6.2',
'10.48.181.222, 10.116.62.62, 10.102.83.30',
'windows 10.0',
'10.192.213.130, 10.70.28.129',
'version',
'xxxx',
],
[
'Host-frl2otafoa',
'thurlow-9.example.com',
'Policy Name',
'Policy Status',
'0',
'windows 10.0',
'10.198.70.21, 10.252.10.66, 10.128.235.38',
'10.46.229.234',
'version',
'xxxx',
],
[
'Host-abmfhmc5ku',
'rezzani-7.example.com',
'Policy Name',
'Policy Status',
'0',
'windows 6.2',
'10.100.170.247, 10.113.203.29, 10.83.81.146',
'windows 10.0',
'10.101.149.26, 2606:a000:ffc0:39:11ef:37b9:3371:578c',
'version',
'xxxx',
],
Expand All @@ -71,29 +74,66 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
expect(tableData).to.eql(expectedData);
});

it('no details flyout when host page displayed', async () => {
await testSubjects.missingOrFail('hostDetailsFlyout');
});

it('display details flyout when the hostname is clicked on', async () => {
await (await testSubjects.find('hostnameCellLink')).click();
await testSubjects.existOrFail('hostDetailsUpperList');
await testSubjects.existOrFail('hostDetailsLowerList');
});

it('displays no items found when empty', async () => {
// clear out the data and reload the page
await esArchiver.unload('endpoint/metadata/api_feature');
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/hosts');
// get the table data and verify no entries appear
const tableData = await pageObjects.endpoint.getEndpointAppTableData('hostListTable');
expect(tableData[1][0]).to.equal('No items found');
// reload the data so the other tests continue to pass
await esArchiver.load('endpoint/metadata/api_feature');
it('update details flyout when new hostname is clicked on', async () => {
// display flyout for the first host in the list
await (await testSubjects.findAll('hostnameCellLink'))[0].click();
await testSubjects.existOrFail('hostDetailsFlyoutTitle');
const hostDetailTitle0 = await testSubjects.getVisibleText('hostDetailsFlyoutTitle');
// select the 2nd host in the host list
await (await testSubjects.findAll('hostnameCellLink'))[1].click();
await pageObjects.endpoint.waitForVisibleTextToChange(
'hostDetailsFlyoutTitle',
hostDetailTitle0
);
const hostDetailTitle1 = await testSubjects.getVisibleText('hostDetailsFlyoutTitle');
expect(hostDetailTitle1).to.not.eql(hostDetailTitle0);
});

it('details flyout remains the same when current hostname is clicked on', async () => {
// display flyout for the first host in the list
await (await testSubjects.findAll('hostnameCellLink'))[1].click();
await testSubjects.existOrFail('hostDetailsFlyoutTitle');
const hostDetailTitleInitial = await testSubjects.getVisibleText('hostDetailsFlyoutTitle');
// select the same host in the host list
await (await testSubjects.findAll('hostnameCellLink'))[1].click();
await sleep(1000); // give page time to refresh
charlie-pichette marked this conversation as resolved.
Show resolved Hide resolved
const hostDetailTitleNew = await testSubjects.getVisibleText('hostDetailsFlyoutTitle');
expect(hostDetailTitleNew).to.eql(hostDetailTitleInitial);
});

describe('no data', () => {
before(async () => {
// clear out the data and reload the page
await esArchiver.unload('endpoint/metadata/api_feature');
await pageObjects.common.navigateToUrlWithBrowserHistory('endpoint', '/hosts');
});
after(async () => {
// reload the data so the other tests continue to pass
await esArchiver.load('endpoint/metadata/api_feature');
});
it('displays no items found when empty', async () => {
// get the table data and verify no entries appear
const tableData = await pageObjects.endpoint.getEndpointAppTableData('hostListTable');
expect(tableData[1][0]).to.equal('No items found');
charlie-pichette marked this conversation as resolved.
Show resolved Hide resolved
});
});

describe('has a url with a host id', () => {
before(async () => {
await pageObjects.common.navigateToUrlWithBrowserHistory(
'endpoint',
'/hosts',
'selected_host=cbe80003-6964-4e0f-aba1-f94c32b44e95'
'selected_host=fc0ff548-feba-41b6-8367-65e8790d0eaf'
);
});

Expand All @@ -120,14 +160,14 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
const values = await pageObjects.endpoint.hostFlyoutDescriptionValues('hostDetailsFlyout');

expect(values).to.eql([
'Windows Server 2012',
'Windows 10',
'',
'0',
'C2A9093E-E289-4C0A-AA44-8C32A414FA7A',
'00000000-0000-0000-0000-000000000000',
'active',
'10.48.181.22210.116.62.6210.102.83.30',
'Host-cxz5glsoup',
'6.6.9',
'10.101.149.262606:a000:ffc0:39:11ef:37b9:3371:578c',
'rezzani-7.example.com',
'6.8.0',
]);
});
});
Expand Down
Loading