-
Notifications
You must be signed in to change notification settings - Fork 149
feat: set default browser orientation before each test #927
Conversation
describe('orientation', function() { | ||
it('should be null by default', function() { | ||
var config = createBrowserConfig({ | ||
httpTimeout: 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
для чего таймаут?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
косяк копипасты, поправлю.
assert.equal(config.orientation, 'landscape'); | ||
}); | ||
|
||
it('should not accept any other value', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any other string value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
поправлю
return launchBrowser().then(() => assert.calledWith(wd.setOrientation, 'portrait')); | ||
}); | ||
|
||
it('should do nothing if no value is specified', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я бы сначала проверил, что по дефолту ориентация не меняется (и без delete browser.config.orientation
), а потом бы только проверил, что значение пробрасывается
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тогда будет важен порядок выполнения тестов, что не ок.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Спасибо!
return launchBrowser().then(() => assert.calledWith(wd.setOrientation, 'portrait')); | ||
}); | ||
|
||
it('should do nothing if no value is specified', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тогда будет важен порядок выполнения тестов, что не ок.
describe('orientation', function() { | ||
it('should be null by default', function() { | ||
var config = createBrowserConfig({ | ||
httpTimeout: 1000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
косяк копипасты, поправлю.
assert.equal(config.orientation, 'landscape'); | ||
}); | ||
|
||
it('should not accept any other value', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
поправлю
bd9b6fd
to
8348d7a
Compare
Current solution for restoring orientation may fail – namely, when test times out. Setting orientation before the test run seems more reliable.
Frankly, we should also remove restoring orientation in
postActions
when the related option is configured, but that can lead to some unfortunate consequences – as all projects can't be updated simultaneously – device may occur in unexpected state. Before doing so, runner should be updated and default orientation should be set in all projects. Just making these changes major do not make the transition easier.Point for discussion – should
gemini
throw when trying to set default orientation for browser which has no such capability.