Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
da7ed1e
fix crash on screenshot target due to unhandled action dispatch
iamgabrielma Nov 13, 2025
9b8f037
remove unused result warning
iamgabrielma Nov 14, 2025
a87c928
Handle actions when opening POS to avoid crash (2)
iamgabrielma Nov 14, 2025
3838c8f
make compile and navigation to POS tab
iamgabrielma Nov 14, 2025
e986446
make test POS screenshot
iamgabrielma Nov 14, 2025
f4df262
add bypass-pos-eligibility-checks flag for UI tests
iamgabrielma Nov 14, 2025
9e772b1
bypass POS product loading got UI test, use mocked data
iamgabrielma Nov 14, 2025
37d4772
load mocked product image sources
iamgabrielma Nov 14, 2025
96c1b13
allow taking landscape screenshots
iamgabrielma Nov 14, 2025
54d007b
simulate no firmware updates for ui screenshots
iamgabrielma Nov 14, 2025
76d7bf1
add product to cart
iamgabrielma Nov 17, 2025
fb82efd
add multiple products
iamgabrielma Nov 17, 2025
0efe5e6
checkout cart and screenshot
iamgabrielma Nov 17, 2025
2bff2c2
bypass pos order syncing for screenshot
iamgabrielma Nov 17, 2025
b594e99
fix race condition when loading products
iamgabrielma Nov 18, 2025
d259c0b
waiting for payment screenshot UI test
iamgabrielma Nov 18, 2025
5d3a5a9
process payment and make screenshot of success UI
iamgabrielma Nov 18, 2025
a747986
Merge branch 'task/WOOMOB-1640-post-app-listings-meta' into task/WOOM…
iamgabrielma Nov 20, 2025
75ad416
inject mock item provider when needed
iamgabrielma Nov 20, 2025
0803253
make test pass
iamgabrielma Nov 20, 2025
3dd788f
remove comment
iamgabrielma Nov 20, 2025
3275559
move CardPresentPaymentServiceScreenshotMock
iamgabrielma Nov 20, 2025
0881b91
extract mocks to their own directory
iamgabrielma Nov 20, 2025
4038037
log error if dependency not provided
iamgabrielma Nov 20, 2025
669be56
rename
iamgabrielma Nov 20, 2025
f614aa1
refactor, move oldvalue to inside onChange
iamgabrielma Nov 20, 2025
f16c5df
lint and periphery
iamgabrielma Nov 20, 2025
4c90a91
more periphery
iamgabrielma Nov 20, 2025
36d431f
periphery again
iamgabrielma Nov 21, 2025
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import Observation
import enum Yosemite.POSItem
import struct Yosemite.POSSimpleProduct
import class Yosemite.PointOfSaleItemService
import protocol Yosemite.PointOfSaleItemServiceProtocol
import protocol Yosemite.PointOfSaleItemFetchStrategyFactoryProtocol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct CardReaderConnectionStatusView: View {
.padding(.horizontal, Constants.horizontalPadding)
.frame(maxHeight: .infinity)
}
.accessibilityIdentifier("pos-reader-connected")
case .disconnecting:
progressIndicatingCardReaderStatus(title: Localization.readerDisconnecting)
case .cancellingConnection:
Expand All @@ -55,6 +56,7 @@ struct CardReaderConnectionStatusView: View {
)
.padding(Constants.disconnectedBorderInset)
}
.accessibilityIdentifier("pos-connect-reader-button")
}
}
.font(Constants.font)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct PointOfSaleCardPresentPaymentTapSwipeInsertCardMessageView: View {
}
}
.multilineTextAlignment(.center)
.accessibilityIdentifier("pos-card-payment-message")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct PointOfSalePaymentSuccessView: View {
}
}
}
.accessibilityIdentifier("pos-payment-success-view")
.onAppear {
withAnimation(.spring(response: 0.6, dampingFraction: 0.8)) {
isViewLoaded = true
Expand Down
2 changes: 2 additions & 0 deletions Modules/Sources/PointOfSale/Presentation/CartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ struct CartView: View {
})
.background(backgroundColor.ignoresSafeArea(.all))
.accessibilityElement(children: .contain)
.accessibilityIdentifier("pos-cart-view")
}
}
}
Expand Down Expand Up @@ -175,6 +176,7 @@ private extension CartView {
}
.buttonStyle(POSFilledButtonStyle(size: .normal))
.disabled(CartViewHelper().hasUnresolvedItems(cart: posModel.cart))
.accessibilityIdentifier("pos-checkout-button")
}

var backButtonConfiguration: POSPageHeaderBackButtonConfiguration? {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct ItemListRow: View {
}, label: {
SimpleProductCardView(product: product)
})
.accessibilityIdentifier("pos-product-card-\(product.productID)")
case let .variableParentProduct(parentProduct):
if #available(iOS 18.0, *) {
NavigationLink(value: item) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ struct POSFloatingControlView: View {
}
.frame(width: Constants.size)
}
.accessibilityIdentifier("pos-menu-button")
.background(backgroundColor)
.cornerRadius(Constants.cornerRadius)
.disabled(posModel.paymentState.card == .processingPayment)
Expand Down Expand Up @@ -78,6 +79,7 @@ private extension POSFloatingControlView {
icon: { Image(systemName: "rectangle.portrait.and.arrow.forward") }
)
}
.accessibilityIdentifier("pos-exit-menu-item")
Button {
analytics.track(.pointOfSaleSettingsMenuItemTapped)
showSettings = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ struct PointOfSaleCollectCashView: View {
buttonFrame = $0
}
.buttonStyle(POSFilledButtonStyle(size: .normal, isLoading: isLoading))
.accessibilityIdentifier("pos-mark-payment-complete-button")
.frame(maxWidth: .infinity)
.dynamicTypeSize(...DynamicTypeSize.accessibility1)
.disabled(!isButtonEnabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,16 +150,13 @@ struct PointOfSaleDashboardView: View {
}
}
.onChange(of: posModel.entryPointController.eligibilityState) { oldValue, newValue in
guard newValue == .eligible else { return }
Task { @MainActor in
await posModel.purchasableItemsController.loadItems(base: .root)
await posModel.couponsController.loadItems(base: .root)
await posModel.popularPurchasableItemsController.loadItems(base: .root)
}
guard case .eligible = newValue, oldValue != newValue else { return }
loadItemsWhenEligible()
}
.ignoresSafeArea(.keyboard)
.onAppear {
trackTimeForInitialLoadingState()
loadItemsWhenEligible()
}
.onChange(of: viewState) { oldValue, newValue in
if newValue == .content && oldValue != newValue {
Expand Down Expand Up @@ -249,6 +246,14 @@ private extension PointOfSaleDashboardView {
self.waitingTimeTracker = nil
}
}

func loadItemsWhenEligible() {
Task { @MainActor in
await posModel.purchasableItemsController.loadItems(base: .root)
await posModel.couponsController.loadItems(base: .root)
await posModel.popularPurchasableItemsController.loadItems(base: .root)
}
}
}

struct FloatingControlAreaSizeKey: EnvironmentKey {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import class Yosemite.PointOfSaleItemService
import protocol Yosemite.PointOfSaleSettingsServiceProtocol
import struct Yosemite.SiteSetting
import protocol Yosemite.PointOfSaleCouponFetchStrategyFactoryProtocol
import protocol Yosemite.PointOfSaleItemServiceProtocol

/// periphery: ignore - public in preparation of move to POS module
public struct PointOfSaleEntryPointView: View {
Expand Down Expand Up @@ -67,9 +68,12 @@ public struct PointOfSaleEntryPointView: View {
grdbManager: GRDBManagerProtocol?,
catalogSyncCoordinator: POSCatalogSyncCoordinatorProtocol?,
isLocalCatalogEligible: Bool,
services: POSDependencyProviding) {
services: POSDependencyProviding,
itemProvider: PointOfSaleItemServiceProtocol? = nil) {
self.onPointOfSaleModeActiveStateChange = onPointOfSaleModeActiveStateChange

let selectedItemProvider = itemProvider ?? PointOfSaleItemService(currencySettings: services.currency.currencySettings)

// Use observable controller with GRDB if local catalog is eligible,
// otherwise fall back to standard controller.
if isLocalCatalogEligible, let grdbManager = grdbManager, let catalogSyncCoordinator {
Expand All @@ -81,13 +85,13 @@ public struct PointOfSaleEntryPointView: View {
)
} else {
self.itemsController = PointOfSaleItemsController(
itemProvider: PointOfSaleItemService(currencySettings: services.currency.currencySettings),
itemProvider: selectedItemProvider,
itemFetchStrategyFactory: itemFetchStrategyFactory,
analyticsProvider: services.analytics
)
}
self.purchasableItemsSearchController = PointOfSaleItemsController(
itemProvider: PointOfSaleItemService(currencySettings: services.currency.currencySettings),
itemProvider: selectedItemProvider,
itemFetchStrategyFactory: itemFetchStrategyFactory,
initialState: .init(containerState: .content,
itemsStack: .init(root: .loaded([], hasMoreItems: true), itemStates: [:])),
Expand Down Expand Up @@ -121,7 +125,7 @@ public struct PointOfSaleEntryPointView: View {
self.collectOrderPaymentAnalyticsTracker = collectOrderPaymentAnalyticsTracker
self.searchHistoryService = searchHistoryService
self.popularPurchasableItemsController = PointOfSaleItemsController(
itemProvider: PointOfSaleItemService(currencySettings: services.currency.currencySettings),
itemProvider: selectedItemProvider,
itemFetchStrategyFactory: popularItemFetchStrategyFactory,
analyticsProvider: services.analytics
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct PointOfSaleExitPosAlertView: View {
Text(Image(systemName: "xmark"))
.font(.posButtonSymbolLarge)
}
.accessibilityIdentifier("pos-exit-modal-close-button")
.foregroundColor(Color.posOnSurfaceVariantLowest)
}
Text(Localization.exitTitle)
Expand All @@ -33,6 +34,7 @@ struct PointOfSaleExitPosAlertView: View {
} label: {
Text(Localization.exitButton)
}
.accessibilityIdentifier("pos-exit-confirm-button")
.buttonStyle(POSFilledButtonStyle(size: .normal))
}
.padding(Constants.padding)
Expand Down
5 changes: 4 additions & 1 deletion Modules/Sources/PointOfSale/Presentation/TotalsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ struct TotalsView: View {
case .error(.other(let message), let handler):
PointOfSaleOrderSyncErrorMessageView(message: message, retryHandler: handler)
.transition(.opacity)

case .error(.invalidCoupon(let message), let handler):
PointOfSaleOrderSyncCouponsErrorMessageView(message: message, retryHandler: handler)
.transition(.opacity)
Expand Down Expand Up @@ -411,6 +412,7 @@ private struct TotalFieldView: View {
}
.accessibilityElement(children: .combine)
.accessibilityAddTraits(.isHeader)
.accessibilityIdentifier("pos-total-field")
.foregroundColor(Color.posOnSurface)
}
}
Expand Down Expand Up @@ -508,7 +510,7 @@ private struct CardPaymentView: View {

var body: some View {
if viewHelper.shouldShowDisconnectedMessage(readerConnectionStatus: cardReaderConnectionStatus,
paymentState: paymentState) {
paymentState: paymentState) {
PointOfSaleCardPresentPaymentReaderDisconnectedMessageView {
connectCardReaderAction()
}
Expand Down Expand Up @@ -547,6 +549,7 @@ private struct CashPaymentButton: View {
.layoutPriority(1)
.dynamicTypeSize(...DynamicTypeSize.accessibility1)
.buttonStyle(POSOutlinedButtonStyle(size: .normal))
.accessibilityIdentifier("pos-cash-payment-button")
.padding(.horizontal, TotalsView.Constants.buttonHorizontalPadding)
.safeAreaPadding(.bottom, TotalsView.Constants.cashButtonBottomPadding)
.renderedIf(viewHelper.shouldShowCollectCashPaymentButton(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest
import XCUITestHelpers
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down Expand Up @@ -82,6 +83,7 @@ public final class SingleOrderScreen: ScreenObject {
return try PaymentMethodsScreen()
}

@discardableResult
public func goBackToOrdersScreen() throws -> OrdersScreen {
let orderDetailTableView = app.tables["order-details-table-view"]

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//periphery:ignore:all
import ScreenObject
import XCTest

Expand Down
Loading