@@ -56,17 +56,20 @@ public final class SingleProductScreen: ScreenObject {
5656 XCTAssertTrue ( app. staticTexts [ " Add variations " ] . exists)
5757 case " grouped " :
5858 XCTAssertTrue ( app. staticTexts [ " Grouped products " ] . exists)
59+ case " external " :
60+ XCTAssertTrue ( app. staticTexts [ " Add product link " ] . exists)
5961 default :
6062 XCTFail ( " Product Type \( productType) doesn't exist! " )
6163 }
6264 }
6365
6466 public func verifyProductTypeScreenLoaded( productType: String ) throws -> Self {
65- let productTypeLabel = NSPredicate ( format: " label ==[c] ' \( productType) ' " )
67+ let productTypeLabel = productType + ( productType == " external " ? " /Affiliate " : " " )
68+ let productTypeLabelPredicate = NSPredicate ( format: " label ==[c] ' \( productTypeLabel) ' " )
6669
6770 // the common fields on add product screen
6871 XCTAssertTrue ( app. cells [ " product-review-cell " ] . exists)
69- XCTAssertTrue ( app. staticTexts. containing ( productTypeLabel ) . firstMatch. exists)
72+ XCTAssertTrue ( app. staticTexts. containing ( productTypeLabelPredicate ) . firstMatch. exists)
7073
7174 // different product types display different fields on add product screen
7275 // this is to validate that the correct screens are displayed
@@ -80,6 +83,10 @@ public final class SingleProductScreen: ScreenObject {
8083 case " grouped " :
8184 XCTAssertTrue ( app. staticTexts [ " Add products to the group " ] . exists)
8285 XCTAssertFalse ( app. staticTexts [ " Inventory " ] . exists)
86+ case " external " :
87+ XCTAssertTrue ( app. staticTexts [ " Add product link " ] . exists)
88+ XCTAssertTrue ( app. staticTexts [ " Add Price " ] . exists)
89+ XCTAssertFalse ( app. staticTexts [ " Inventory " ] . exists)
8390 default :
8491 XCTFail ( " Product Type \( productType) doesn't exist! " )
8592 }
0 commit comments