Skip to content

Commit

Permalink
Getting more insights on flaky tests error cause
Browse files Browse the repository at this point in the history
  • Loading branch information
PGBI authored and PGBI committed Dec 14, 2017
1 parent 5776075 commit 55f793b
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions tests/cases/infinite-scrolling.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,15 @@ describe('Objects page index testing', () => {
HomePage.visit();
Sidebar.clickOn('Consumers');
browser.executeScript('window.scrollTo(0,document.body.scrollHeight)');
var timeout = setTimeout(() => {
ListConsumersPage.getRows().count().then((count) => {
fail("counting " + count + " consumers rows instead of 150. Test is going to timeout");
})
}, 5000);
var row101 = ListConsumersPage.getRow(101);
browser.wait(until.presenceOf(row101)).then(() => {
expect(ListConsumersPage.getRows().count()).toEqual(150);
clearTimeout(timeout);
done();
});
});
Expand All @@ -57,9 +63,15 @@ describe('Objects page index testing', () => {
HomePage.visit();
Sidebar.clickOn('Plugins');
browser.executeScript('window.scrollTo(0,document.body.scrollHeight)');
var timeout = setTimeout(() => {
ListPluginsPage.getRows().count().then((count) => {
fail("counting " + count + " plugin rows instead of 150. Test is going to timeout");
})
}, 5000);
var row101 = ListPluginsPage.getRow(101);
browser.wait(until.presenceOf(row101)).then(() => {
expect(ListPluginsPage.getRows().count()).toEqual(150);
clearTimeout(timeout);
done();
});
});
Expand All @@ -68,9 +80,15 @@ describe('Objects page index testing', () => {
HomePage.visit();
Sidebar.clickOn('APIs');
browser.executeScript('window.scrollTo(0,document.body.scrollHeight)');
var timeout = setTimeout(() => {
ListAPIsPage.getRows().count().then((count) => {
fail("counting " + count + " api rows instead of 150. Test is going to timeout");
})
}, 5000);
var row101 = ListAPIsPage.getRow(101);
browser.wait(until.presenceOf(row101)).then(() => {
expect(ListAPIsPage.getRows().count()).toEqual(150);
clearTimeout(timeout);
done();
});
});
Expand Down Expand Up @@ -119,7 +137,6 @@ function createAPI(number) {
throw new Error('Kong version not supported in unit tests.')
}


function create150Consumers() {
var promise = Kong.createConsumer({
custom_id: 'my_custom_id_0'
Expand All @@ -135,4 +152,4 @@ function create150Consumers() {
}

return promise;
}
}

0 comments on commit 55f793b

Please sign in to comment.