Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

feat: set default browser orientation before each test #927

Merged
merged 1 commit into from
Aug 14, 2018

Conversation

Flackus
Copy link
Contributor

@Flackus Flackus commented Aug 13, 2018

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.

@Flackus Flackus requested review from eGavr and j0tunn August 13, 2018 17:44
describe('orientation', function() {
it('should be null by default', function() {
var config = createBrowserConfig({
httpTimeout: 1000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

для чего таймаут?

Copy link
Contributor Author

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() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any other string value

Copy link
Contributor Author

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', () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я бы сначала проверил, что по дефолту ориентация не меняется (и без delete browser.config.orientation), а потом бы только проверил, что значение пробрасывается

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тогда будет важен порядок выполнения тестов, что не ок.

Copy link
Contributor Author

@Flackus Flackus left a 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', () => {
Copy link
Contributor Author

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
Copy link
Contributor Author

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() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

поправлю

@Flackus Flackus merged commit 051ed46 into master Aug 14, 2018
@Flackus Flackus deleted the feat/default-orientation branch August 14, 2018 12:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants