Add debug code to flaky field_data test (#15535)

* Add debug code to flaky field_data test

* update helper to match new UI
This commit is contained in:
Matt Bargar 2018-03-28 15:55:03 -04:00 committed by GitHub
parent 26b28dcbf2
commit a89027b267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 5 deletions

View file

@ -30,7 +30,7 @@
</h3>
<div class="euiCodeBlock euiCodeBlock--light euiCodeBlock--fontSmall euiCodeBlock--paddingSmall">
<code class="euiCodeBlock__code">
<pre class="euiCodeBlock__pre">{{req.resp | json}}</pre>
<pre class="euiCodeBlock__pre" data-test-subj="visualizationEsResponseBody">{{req.resp | json}}</pre>
</code>
</div>
</div>

View file

@ -4,7 +4,8 @@ export default function ({ getService, getPageObjects }) {
const retry = getService('retry');
const esArchiver = getService('esArchiver');
const kibanaServer = getService('kibanaServer');
const PageObjects = getPageObjects(['common', 'header', 'discover']);
const log = getService('log');
const PageObjects = getPageObjects(['common', 'header', 'discover', 'visualize']);
describe('discover app', function describeIndexTests() {
before(async function () {
@ -68,7 +69,7 @@ export default function ({ getService, getPageObjects }) {
});
});
it.skip('doc view should show oldest time first', function () {
it('doc view should show oldest time first', function () {
// Note: Could just check the timestamp, but might as well check that the whole doc is as expected.
const ExpectedDoc =
'September 22nd 2015, 23:50:13.253\ntype:apache index:logstash-2015.09.22 @timestamp:September 22nd 2015, 23:50:13.253'
@ -114,8 +115,20 @@ export default function ({ getService, getPageObjects }) {
+ ' 2014, 16:00:51.000, November 27th 2014, 16:28:42.000 relatedContent.article:published_time:July 26th'
+ ' 2007, 19:42:30.000, December 13th 2007, 20:19:35.000';
return PageObjects.discover.getDocTableIndex(1)
.then(function (rowData) {
expect(rowData).to.be(ExpectedDoc);
.then(async function (rowData) {
try {
expect(rowData).to.be(ExpectedDoc);
}
catch (e) {
const esResponse = JSON.parse(await PageObjects.visualize.getVisualizationResponse());
const rawActualDoc = esResponse.hits.hits.find(function (hit) {
return hit._id === 'AU_x3_g4GFA8no6QjkYX' && hit._index === 'logstash-2015.09.22';
});
log.info('Attemping to get more debug info on this flaky test. Ping @bargs if you see this fail');
log.info(JSON.stringify(rawActualDoc));
await PageObjects.visualize.closeSpyPanel();
throw e;
}
});
});

View file

@ -795,6 +795,13 @@ export function VisualizePageProvider({ getService, getPageObjects }) {
return await testSubjects.getVisibleText('visualizationEsRequestBody');
}
async getVisualizationResponse() {
log.debug('getVisualizationResponse');
await this.openSpyPanel();
await testSubjects.click('spyModeSelect-response');
return await testSubjects.getVisibleText('visualizationEsResponseBody');
}
async getMapBounds() {
const request = await this.getVisualizationRequest();
const requestObject = JSON.parse(request);