Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(user-feedback): ui tests to display form, submit, cancel #4536

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 158 additions & 0 deletions Samples/iOS-Swift/iOS-Swift-UITests/UserFeedbackUITests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
//swiftlint:disable todo

import XCTest

class UserFeedbackUITests: BaseUITest {
override var automaticallyLaunchAndTerminateApp: Bool { false }

override func setUp() {
super.setUp()
app.launchArguments.append(contentsOf: [
"--io.sentry.iOS-Swift.auto-inject-user-feedback-widget",
"--io.sentry.iOS-Swift.user-feedback.all-defaults"
])
launchApp()
}

func testSubmitFullyFilledForm() throws {
let widgetButton: XCUIElement = app.staticTexts["Report a Bug"]
Copy link
Member

Choose a reason for hiding this comment

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

m: Is there any reason we can't use accessibility identifiers to find the button? These usually don't change that often, and they also work when you add localization, so it makes the test less brittle.

Copy link
Member Author

Choose a reason for hiding this comment

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

fair

widgetButton.tap()

let nameField: XCUIElement = app.textFields["Your Name"]
nameField.tap()
nameField.typeText("Andrew")

let emailField: XCUIElement = app.textFields["[email protected]"]
emailField.tap()
emailField.typeText("[email protected]")

let messageTextView: XCUIElement = app.textViews["What's the bug? What did you expect?"]
messageTextView.tap()
messageTextView.typeText("UITest user feedback")

app.staticTexts["Send Bug Report"].tap()

// displaying the form again ensures the widget button still works afterwards; also assert that the fields are in their default state to ensure the entered data is not persisted between displays

widgetButton.tap()

// the placeholder text is returned for XCUIElement.value
XCTAssertEqual(try XCTUnwrap(nameField.value as? String), "Your Name")
XCTAssertEqual(try XCTUnwrap(emailField.value as? String), "[email protected]")

// the UITextView doesn't hav a placeholder, it's a label on top of it. so it is actually empty
XCTAssertEqual(try XCTUnwrap(messageTextView.value as? String), "")
}

func testSubmitWithNoFieldsFilled() throws {
throw XCTSkip("Needs error state implementation")

let widgetButton: XCUIElement = app.staticTexts["Report a Bug"]
widgetButton.tap()

app.staticTexts["Send Bug Report"].tap()

// TODO: need to implement some kind of error dialog and then assert for it
}
Comment on lines +47 to +56
Copy link
Member

Choose a reason for hiding this comment

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

l: I would prefer not to have tests that don't run if possible. They are easily overlooked, start to rot and are never updated again.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's implemented in #4544


func testSubmitWithOnlyRequiredFieldsFilled() {
let widgetButton: XCUIElement = app.staticTexts["Report a Bug"]
widgetButton.tap()

let messageTextView: XCUIElement = app.textViews["What's the bug? What did you expect?"]
messageTextView.tap()
messageTextView.typeText("UITest user feedback")

app.staticTexts["Send Bug Report"].tap()

XCTAssert(widgetButton.waitForExistence(timeout: 1))
}

func testSubmitOnlyWithOptionalFieldsFilled() throws {
throw XCTSkip("Needs error state implementation")

let widgetButton: XCUIElement = app.staticTexts["Report a Bug"]
widgetButton.tap()

let nameField: XCUIElement = app.textFields["Your Name"]
nameField.tap()
nameField.typeText("Andrew")

let emailField: XCUIElement = app.textFields["[email protected]"]
emailField.tap()
emailField.typeText("[email protected]")

app.staticTexts["Send Bug Report"].tap()

// TODO: need to implement some kind of error dialog and then assert for it
Copy link
Member

Choose a reason for hiding this comment

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

m: What's stopping you from doing that in this PR?

Copy link
Member Author

@armcknight armcknight Nov 20, 2024

Choose a reason for hiding this comment

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

can't do it until validation and error states are implemented in #4544

}

func testCancelFromFormByButton() {
let widgetButton: XCUIElement = app.staticTexts["Report a Bug"]

widgetButton.tap()

// fill out the fields; we'll assert later that the entered data does not reappear on subsequent displays
let nameField: XCUIElement = app.textFields["Your Name"]
nameField.tap()
nameField.typeText("Andrew")

let emailField: XCUIElement = app.textFields["[email protected]"]
emailField.tap()
emailField.typeText("[email protected]")

let messageTextView: XCUIElement = app.textViews["What's the bug? What did you expect?"]
messageTextView.tap()
messageTextView.typeText("UITest user feedback")

let cancelButton: XCUIElement = app.staticTexts["Cancel"]
cancelButton.tap()

// displaying the form again ensures the widget button still works afterwards; also assert that the fields are in their default state to ensure the entered data is not persisted between displays

widgetButton.tap()

// the placeholder text is returned for XCUIElement.value
XCTAssertEqual(try XCTUnwrap(nameField.value as? String), "Your Name")
XCTAssertEqual(try XCTUnwrap(emailField.value as? String), "[email protected]")

// the UITextView doesn't hav a placeholder, it's a label on top of it. so it is actually empty
XCTAssertEqual(try XCTUnwrap(messageTextView.value as? String), "")
}

func testCancelFromFormBySwipeDown() {
let widgetButton: XCUIElement = app.staticTexts["Report a Bug"]

widgetButton.tap()

// fill out the fields; we'll assert later that the entered data does not reappear on subsequent displays
let nameField: XCUIElement = app.textFields["Your Name"]
nameField.tap()
nameField.typeText("Andrew")

let emailField: XCUIElement = app.textFields["[email protected]"]
emailField.tap()
emailField.typeText("[email protected]")

let messageTextView: XCUIElement = app.textViews["What's the bug? What did you expect?"]
messageTextView.tap()
messageTextView.typeText("UITest user feedback")

// the cancel gesture
app.swipeDown(velocity: .fast)

// displaying the form again ensures the widget button still works afterwards; also assert that the fields are in their default state to ensure the entered data is not persisted between displays

XCTAssert(widgetButton.waitForExistence(timeout: 1))
widgetButton.tap()

// the placeholder text is returned for XCUIElement.value
XCTAssertEqual(try XCTUnwrap(nameField.value as? String), "Your Name")
XCTAssertEqual(try XCTUnwrap(emailField.value as? String), "[email protected]")

// the UITextView doesn't hav a placeholder, it's a label on top of it. so it is actually empty
XCTAssertEqual(try XCTUnwrap(messageTextView.value as? String), "")
}
}

//swiftlint:enable todo
4 changes: 4 additions & 0 deletions Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
84BA72DE2C9391920045B828 /* GitInjections.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84BA72A52C93698E0045B828 /* GitInjections.swift */; };
84BE546F287503F100ACC735 /* SentrySDKPerformanceBenchmarkTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 84BE546E287503F100ACC735 /* SentrySDKPerformanceBenchmarkTests.m */; };
84BE547E287645B900ACC735 /* SentryProcessInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 84BE54792876451D00ACC735 /* SentryProcessInfo.m */; };
84DBC6252CE6D321000C4904 /* UserFeedbackUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84DBC61F2CE6D31C000C4904 /* UserFeedbackUITests.swift */; };
84FB812A284001B800F3A94A /* SentryBenchmarking.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84FB8129284001B800F3A94A /* SentryBenchmarking.mm */; };
84FB812B284001B800F3A94A /* SentryBenchmarking.mm in Sources */ = {isa = PBXBuildFile; fileRef = 84FB8129284001B800F3A94A /* SentryBenchmarking.mm */; };
8E8C57AF25EF16E6001CEEFA /* TraceTestViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8E8C57AE25EF16E6001CEEFA /* TraceTestViewController.swift */; };
Expand Down Expand Up @@ -288,6 +289,7 @@
84BE546E287503F100ACC735 /* SentrySDKPerformanceBenchmarkTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentrySDKPerformanceBenchmarkTests.m; sourceTree = "<group>"; };
84BE54782876451D00ACC735 /* SentryProcessInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryProcessInfo.h; sourceTree = "<group>"; };
84BE54792876451D00ACC735 /* SentryProcessInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryProcessInfo.m; sourceTree = "<group>"; };
84DBC61F2CE6D31C000C4904 /* UserFeedbackUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserFeedbackUITests.swift; sourceTree = "<group>"; };
84FB8125284001B800F3A94A /* SentryBenchmarking.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryBenchmarking.h; sourceTree = "<group>"; };
84FB8129284001B800F3A94A /* SentryBenchmarking.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryBenchmarking.mm; sourceTree = "<group>"; };
84FB812C2840021B00F3A94A /* iOS-Swift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "iOS-Swift-Bridging-Header.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -505,6 +507,7 @@
D8C33E2529FBB8D90071B75A /* UIEventBreadcrumbTests.swift */,
84A5D72C29D2708D00388BFA /* UITestHelpers.swift */,
84A5D72529D2705000388BFA /* ProfilingUITests.swift */,
84DBC61F2CE6D31C000C4904 /* UserFeedbackUITests.swift */,
84B527B728DD24BA00475E8D /* SentryDeviceTests.mm */,
84B527BB28DD25E400475E8D /* SentryDevice.h */,
84B527BC28DD25E400475E8D /* SentryDevice.mm */,
Expand Down Expand Up @@ -1144,6 +1147,7 @@
62C07D5C2AF3E3F500894688 /* BaseUITest.swift in Sources */,
84A5D72629D2705000388BFA /* ProfilingUITests.swift in Sources */,
84A5D72D29D2708D00388BFA /* UITestHelpers.swift in Sources */,
84DBC6252CE6D321000C4904 /* UserFeedbackUITests.swift in Sources */,
84B527B928DD24BA00475E8D /* SentryDeviceTests.mm in Sources */,
7B64386B26A6C544000D0F65 /* LaunchUITests.swift in Sources */,
84B527BD28DD25E400475E8D /* SentryDevice.mm in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//swiftlint:disable todo type_body_length

import Foundation
#if os(iOS) && !SENTRY_NO_UIKIT
@_implementationOnly import _SentryPrivate
Expand Down Expand Up @@ -58,11 +60,11 @@
let formElementHeight: CGFloat = 40
let logoWidth: CGFloat = 47
lazy var messageTextViewHeightConstraint = messageTextView.heightAnchor.constraint(equalToConstant: config.theme.font.lineHeight * 5)
lazy var logoViewWidthConstraint = sentryLogoView.widthAnchor.constraint(equalToConstant: logoWidth * config.scaleFactor)

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'logoWidth'

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'logoWidth'

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'logoWidth'

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'logoWidth'

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'logoWidth'

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'logoWidth'

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'logoWidth'

Check failure on line 63 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'logoWidth'
lazy var messagePlaceholderLeadingConstraint = messageTextViewPlaceholder.leadingAnchor.constraint(equalTo: messageTextView.leadingAnchor, constant: messageTextView.textContainerInset.left + 5)
lazy var messagePlaceholderTopConstraint = messageTextViewPlaceholder.topAnchor.constraint(equalTo: messageTextView.topAnchor, constant: messageTextView.textContainerInset.top)
lazy var fullNameTextFieldHeightConstraint = fullNameTextField.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'formElementHeight'

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'formElementHeight'

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'formElementHeight'

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'formElementHeight'

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'formElementHeight'

Check failure on line 66 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'formElementHeight'
lazy var emailTextFieldHeightConstraint = emailTextField.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'formElementHeight'

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'formElementHeight'

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'formElementHeight'

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'formElementHeight'

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'formElementHeight'

Check failure on line 67 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'formElementHeight'
lazy var addScreenshotButtonHeightConstraint = addScreenshotButton.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)
lazy var removeScreenshotButtonHeightConstraint = removeScreenshotButton.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)
lazy var submitButtonHeightConstraint = submitButton.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)
Expand Down Expand Up @@ -157,6 +159,62 @@
}
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: Actions

func addScreenshotButtonTapped() {

}

func removeScreenshotButtonTapped() {

}

func submitFeedbackButtonTapped() {
// TODO: validate and package entries
delegate?.confirmed()
}

func cancelButtonTapped() {
delegate?.cancelled()
}

// MARK: Layout

let formElementHeight: CGFloat = 40
let logoWidth: CGFloat = 47
lazy var messageTextViewHeightConstraint = messageTextView.heightAnchor.constraint(equalToConstant: config.theme.font.lineHeight * 5)
lazy var logoViewWidthConstraint = sentryLogoView.widthAnchor.constraint(equalToConstant: logoWidth * config.scaleFactor)

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'logoWidth'

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'logoWidth'

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'logoWidth'

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'logoWidth'

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'logoWidth'

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'logoWidth'

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'logoWidth'

Check failure on line 190 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'logoWidth'
lazy var messagePlaceholderLeadingConstraint = messageTextViewPlaceholder.leadingAnchor.constraint(equalTo: messageTextView.leadingAnchor, constant: messageTextView.textContainerInset.left + 5)
lazy var messagePlaceholderTopConstraint = messageTextViewPlaceholder.topAnchor.constraint(equalTo: messageTextView.topAnchor, constant: messageTextView.textContainerInset.top)
lazy var fullNameTextFieldHeightConstraint = fullNameTextField.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'formElementHeight'

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'formElementHeight'

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'formElementHeight'

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'formElementHeight'

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'formElementHeight'

Check failure on line 193 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'formElementHeight'
lazy var emailTextFieldHeightConstraint = emailTextField.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'formElementHeight'

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'formElementHeight'

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'formElementHeight'

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'formElementHeight'

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'formElementHeight'

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'formElementHeight'

Check failure on line 194 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'formElementHeight'
lazy var addScreenshotButtonHeightConstraint = addScreenshotButton.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)
lazy var removeScreenshotButtonHeightConstraint = removeScreenshotButton.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)
lazy var submitButtonHeightConstraint = submitButton.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)
lazy var cancelButtonHeightConstraint = cancelButton.heightAnchor.constraint(equalToConstant: formElementHeight * config.scaleFactor)

func updateLayout() {
let verticalPadding: CGFloat = 8
messageTextView.textContainerInset = .init(top: verticalPadding * config.scaleFactor, left: 2 * config.scaleFactor, bottom: verticalPadding * config.scaleFactor, right: 2 * config.scaleFactor)

messageTextViewHeightConstraint.constant = config.theme.font.lineHeight * 5
logoViewWidthConstraint.constant = logoWidth * config.scaleFactor
messagePlaceholderLeadingConstraint.constant = messageTextView.textContainerInset.left + 5
messagePlaceholderTopConstraint.constant = messageTextView.textContainerInset.top
fullNameTextFieldHeightConstraint.constant = formElementHeight * config.scaleFactor
emailTextFieldHeightConstraint.constant = formElementHeight * config.scaleFactor
addScreenshotButtonHeightConstraint.constant = formElementHeight * config.scaleFactor
removeScreenshotButtonHeightConstraint.constant = formElementHeight * config.scaleFactor
submitButtonHeightConstraint.constant = formElementHeight * config.scaleFactor
cancelButtonHeightConstraint.constant = formElementHeight * config.scaleFactor
}

// MARK: UI Elements

lazy var formTitleLabel = {
let label = UILabel(frame: .zero)
label.text = config.formConfig.formTitle
Expand Down Expand Up @@ -232,7 +290,7 @@
let button = UIButton(frame: .zero)
button.setTitle(config.formConfig.addScreenshotButtonLabel, for: .normal)
button.accessibilityLabel = config.formConfig.addScreenshotButtonAccessibilityLabel
button.addTarget(self, action: #selector(addScreenshotButtonTapped), for: .touchUpInside)

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'addScreenshotButtonTapped()'

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'addScreenshotButtonTapped()'

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'addScreenshotButtonTapped()'

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'addScreenshotButtonTapped()'

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'addScreenshotButtonTapped()'

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'addScreenshotButtonTapped()'

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'addScreenshotButtonTapped()'

Check failure on line 293 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'addScreenshotButtonTapped()'
return button
}()

Expand All @@ -240,7 +298,7 @@
let button = UIButton(frame: .zero)
button.setTitle(config.formConfig.removeScreenshotButtonLabel, for: .normal)
button.accessibilityLabel = config.formConfig.removeScreenshotButtonAccessibilityLabel
button.addTarget(self, action: #selector(removeScreenshotButtonTapped), for: .touchUpInside)

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'removeScreenshotButtonTapped()'

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'removeScreenshotButtonTapped()'

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'removeScreenshotButtonTapped()'

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'removeScreenshotButtonTapped()'

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'removeScreenshotButtonTapped()'

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'removeScreenshotButtonTapped()'

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'removeScreenshotButtonTapped()'

Check failure on line 301 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'removeScreenshotButtonTapped()'
return button
}()

Expand All @@ -250,7 +308,7 @@
button.accessibilityLabel = config.formConfig.submitButtonAccessibilityLabel
button.backgroundColor = config.theme.submitBackground
button.setTitleColor(config.theme.submitForeground, for: .normal)
button.addTarget(self, action: #selector(submitFeedbackButtonTapped), for: .touchUpInside)

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'submitFeedbackButtonTapped()'

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'submitFeedbackButtonTapped()'

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'submitFeedbackButtonTapped()'

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'submitFeedbackButtonTapped()'

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'submitFeedbackButtonTapped()'

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'submitFeedbackButtonTapped()'

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'submitFeedbackButtonTapped()'

Check failure on line 311 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'submitFeedbackButtonTapped()'
return button
}()

Expand All @@ -258,7 +316,7 @@
let button = UIButton(frame: .zero)
button.setTitle(config.formConfig.cancelButtonLabel, for: .normal)
button.accessibilityLabel = config.formConfig.cancelButtonAccessibilityLabel
button.addTarget(self, action: #selector(cancelButtonTapped), for: .touchUpInside)

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift6 Simulator

ambiguous use of 'cancelButtonTapped()'

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build SwiftUITestSample Sample

ambiguous use of 'cancelButtonTapped()'

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 15 (17.2) Simulator

ambiguous use of 'cancelButtonTapped()'

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for SwiftUI on iPhone 8 (16.1) Simulator

ambiguous use of 'cancelButtonTapped()'

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Release Build of iOS Swift

ambiguous use of 'cancelButtonTapped()'

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for ios_objc on Simulators

ambiguous use of 'cancelButtonTapped()'

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / Build app and test runner

ambiguous use of 'cancelButtonTapped()'

Check failure on line 319 in Sources/Swift/Integrations/UserFeedback/SentryUserFeedbackForm.swift

View workflow job for this annotation

GitHub Actions / UI Tests for iOS-Swift iPhone 14 (16.4) Simulator

ambiguous use of 'cancelButtonTapped()'
return button
}()

Expand Down Expand Up @@ -333,3 +391,5 @@
}

#endif // os(iOS) && !SENTRY_NO_UIKIT

//swiftlint:enable todo type_body_length
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//swiftlint:disable todo

import Foundation
#if os(iOS) && !SENTRY_NO_UIKIT
@_implementationOnly import _SentryPrivate
Expand Down Expand Up @@ -109,3 +111,5 @@ struct SentryUserFeedbackWidget {
}

#endif // os(iOS) && !SENTRY_NO_UIKIT

//swiftlint:enable todo
Loading