Skip to content

Commit 67c2eba

Browse files
committed
break productTypeLabel for readability
1 parent 44cd464 commit 67c2eba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

WooCommerce/UITestsFoundation/Screens/Products/SingleProductScreen.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,12 @@ public final class SingleProductScreen: ScreenObject {
6464
}
6565

6666
public func verifyProductTypeScreenLoaded(productType: String) throws -> Self {
67-
let productTypeLabel = NSPredicate(format: "label ==[c] '\(productType)\(productType == "external" ? "/Affiliate" : "")'")
67+
let productTypeLabel = productType + (productType == "external" ? "/Affiliate" : "")
68+
let productTypeLabelPredicate = NSPredicate(format: "label ==[c] '\(productTypeLabel)'")
6869

6970
// the common fields on add product screen
7071
XCTAssertTrue(app.cells["product-review-cell"].exists)
71-
XCTAssertTrue(app.staticTexts.containing(productTypeLabel).firstMatch.exists)
72+
XCTAssertTrue(app.staticTexts.containing(productTypeLabelPredicate).firstMatch.exists)
7273

7374
// different product types display different fields on add product screen
7475
// this is to validate that the correct screens are displayed

0 commit comments

Comments
 (0)