Skip to content

Commit

Permalink
tweak viewport test size
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Aug 23, 2015
1 parent ebf07de commit 22d4e11
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/spec/desktop/viewportSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,43 @@ describe('setViewportSize/getViewportSize', function() {

beforeEach(function() {
return this.client.windowHandleSize({
width: 500,
height: 500
width: 600,
height: 600
});
})

it('should change viewport size of current window and should return the exact value', function() {
return this.client.setViewportSize({
width: 700,
height: 700
width: 800,
height: 800
}, true).getViewportSize().then(function(size) {
size.width.should.be.exactly(700);
size.height.should.be.exactly(700);
size.width.should.be.exactly(800);
size.height.should.be.exactly(800);
});
});

it('should set window size exactly when parameter \'type\' is true by default', function() {
return this.client.setViewportSize({
width: 700,
height: 700
width: 800,
height: 800
}).getViewportSize().then(function(size) {
size.width.should.be.exactly(700);
size.height.should.be.exactly(700);
size.width.should.be.exactly(800);
size.height.should.be.exactly(800);
}).windowHandleSize().then(function(res) {
res.value.width.should.be.exactly(700);
res.value.height.should.be.greaterThan(700);
res.value.width.should.be.exactly(800);
res.value.height.should.be.greaterThan(800);
});
});

it('should let windowHandleSize return bigger values since it includes menu and status bar heights', function() {
return this.client.setViewportSize({
width: 700,
height: 700
width: 800,
height: 800
}, false).getViewportSize().then(function(size) {
size.width.should.be.exactly(700);
size.height.should.be.lessThan(700);
size.width.should.be.exactly(800);
size.height.should.be.lessThan(800);
}).windowHandleSize().then(function(res) {
res.value.height.should.be.exactly(700);
res.value.height.should.be.exactly(800);
});
});

Expand Down

0 comments on commit 22d4e11

Please sign in to comment.