Skip to content
This repository was archived by the owner on Oct 14, 2024. It is now read-only.

🛠 [Fix] [TempuraTesting] Use correct screen size on orientation change #110

Merged

Conversation

umbertovolta
Copy link
Contributor

Why
Simple fix for #109 .

Changes
Use the correct screenSize (if not already specified) by accessing UIScreen.main.bounds.size only after have set XCUIDevice.shared.orientation.

Note
This is a breaking change that makes screenSize of Context and VCContext optional.

Tasks

  • Add relevant tests, if needed
  • Add documentation, if needed
  • Update README, if needed
  • Ensure that the demo project works properly

BREAKING CHANGE: make screenSize of Context and VCContext optional
Comment on lines 69 to +72
func uiTest(testCases: [String], context: UITests.VCContext<VC>) {

// Set the orientation right away to retrieve the correct `UIScreen.main.bounds.size` later.
XCUIDevice.shared.orientation = context.orientation
Copy link
Contributor

Choose a reason for hiding this comment

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

[i]

Suggested change
func uiTest(testCases: [String], context: UITests.VCContext<VC>) {
// Set the orientation right away to retrieve the correct `UIScreen.main.bounds.size` later.
XCUIDevice.shared.orientation = context.orientation
func uiTest(testCases: [String], context: UITests.VCContext<VC>) {
// Set the orientation right away to retrieve the correct `UIScreen.main.bounds.size` later.
XCUIDevice.shared.orientation = context.orientation

Copy link
Contributor

@LorDisturbia LorDisturbia left a comment

Choose a reason for hiding this comment

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

Please update the Changelog

@LorDisturbia LorDisturbia changed the base branch from master to release/tempura-7.0.0 April 28, 2021 17:23
@LorDisturbia LorDisturbia merged commit cb0fe3e into release/tempura-7.0.0 Apr 28, 2021
@LorDisturbia LorDisturbia deleted the fix/tempura-testing/orientation-handling branch April 28, 2021 17:27
@LorDisturbia LorDisturbia linked an issue Apr 28, 2021 that may be closed by this pull request
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.

🐛 [TempuraTesting] UI tests fail on orientation change
3 participants