Skip to content

Commit 44b154f

Browse files
test(end to end): variable for browser wait timeout value
1 parent 39be889 commit 44b154f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

e2e/app.e2e-spec.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { browser } from 'protractor';
44
describe('ImageLoader Lib E2E Tests', function () {
55
let page: AppPage;
66

7+
const browserWaitTimeout = 10000;
8+
79
beforeEach(() => page = new AppPage());
810

911
beforeEach(() => page.navigateTo());
@@ -80,7 +82,7 @@ describe('ImageLoader Lib E2E Tests', function () {
8082
.then(() => {
8183
browser.wait(() => page.getLoadedImageElementBySrcSet(
8284
'http://via.placeholder.com/350x250?text=md+1x 1x, http://via.placeholder.com/700x500?text=md+2x 2x'
83-
), 5000);
85+
), browserWaitTimeout);
8486
});
8587

8688
imgSrc = page.getImageElement().getAttribute('srcset');
@@ -90,7 +92,7 @@ describe('ImageLoader Lib E2E Tests', function () {
9092
.then(() => {
9193
browser.wait(() => page.getLoadedImageElementBySrcSet(
9294
'http://via.placeholder.com/700x400?text=lg+1x 1x, http://via.placeholder.com/1400x800?text=lg+2x 2x'
93-
), 5000);
95+
), browserWaitTimeout);
9496
});
9597

9698
imgSrc = page.getImageElement().getAttribute('srcset');
@@ -111,15 +113,15 @@ describe('ImageLoader Lib E2E Tests', function () {
111113
.then(() => {
112114
browser.wait(() => page.getLoadedImageElementBySrcSet(
113115
'http://via.placeholder.com/350x250?text=md+1x 1x, http://via.placeholder.com/700x500?text=md+2x 2x'
114-
), 5000);
116+
), browserWaitTimeout);
115117
});
116118
expect(page.getFullResCountElement().getText()).toEqual('2');
117119

118120
page.setWindowSize(1024, 580)
119121
.then(() => {
120122
browser.wait(() => page.getLoadedImageElementBySrcSet(
121123
'http://via.placeholder.com/700x400?text=lg+1x 1x, http://via.placeholder.com/1400x800?text=lg+2x 2x'
122-
), 5000);
124+
), browserWaitTimeout);
123125
});
124126
expect(page.getFullResCountElement().getText()).toEqual('3');
125127
});

0 commit comments

Comments
 (0)