Skip to content

Commit

Permalink
Add functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Dec 29, 2022
1 parent fb71953 commit 1ab6046
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,21 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
await PageObjects.header.waitUntilLoadingHasFinished();
await PageObjects.discover.assertHitCount('1');
});

it('should allow switching from data views with different timefield and adjust sorting', async () => {
await PageObjects.common.navigateToApp('discover');
await PageObjects.discover.selectIndexPattern('with-timefield');
await PageObjects.header.waitUntilLoadingHasFinished();
let url = await browser.getCurrentUrl();
expect(url).to.contain(`@timestamp`);

await PageObjects.discover.selectIndexPattern('with-different-timefield');
await PageObjects.header.waitUntilLoadingHasFinished();
url = await browser.getCurrentUrl();
expect(url).to.contain(`with-different-timefield`);
browser.goBack();
await PageObjects.header.waitUntilLoadingHasFinished();
expect(url).to.contain(`@timestamp`);
});
});
}
2 changes: 1 addition & 1 deletion test/functional/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ export default async function ({ readConfigFile }) {
cluster: [],
indices: [
{
names: ['without-timefield', 'with-timefield'],
names: ['without-timefield', 'with-timefield', 'with-different-timefield'],
privileges: ['read', 'view_index_metadata'],
field_security: { grant: ['*'], except: [] },
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,22 @@
}
}

{
"type": "doc",
"value": {
"id": "with-different-timefield-1",
"index": "with-different-timefield",
"source": {
"@message" : "ole",
"with-different-timefield": "2019-10-22T23:50:13.253Z",
"referer": "http://twitter.com/error/takuya-onishi",
"request": "/uploads/dafydd-williams.jpg",
"response": "200",
"type": "apache",
"url": "https://media-for-the-masses.theacademyofperformingartsandscience.org/uploads/dafydd-williams.jpg"
}
}
}



Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,23 @@
}
}
}

{
"type": "index",
"value": {
"index": "with-different-timefield",
"mappings": {
"properties": {
"different-timefield": {
"type": "date"
}
}
},
"settings": {
"index": {
"number_of_replicas": "0",
"number_of_shards": "1"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@
"version": "WzEzLDJd"
}

{
"attributes": {
"fields": "[]",
"timeFieldName": "with-different-timefield",
"title": "with-different-timefield"
},
"coreMigrationVersion": "7.17.1",
"id": "with-different-timefield",
"migrationVersion": {
"index-pattern": "7.11.0"
},
"references": [],
"type": "index-pattern",
"version": "WzEzLDJd"
}

{
"attributes": {
"fields": "[]",
Expand All @@ -27,4 +43,4 @@
"references": [],
"type": "index-pattern",
"version": "WzEyLDJd"
}
}

0 comments on commit 1ab6046

Please sign in to comment.