File tree Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Expand file tree Collapse file tree 4 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,6 @@ public final class ProductsScreen: ScreenObject {
8383
8484 public func selectProductType( productType: String ) throws -> SingleProductScreen {
8585 app. staticTexts [ productType] . tap ( )
86-
8786 return try SingleProductScreen ( )
8887 }
8988}
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ public final class SingleProductScreen: ScreenObject {
3232 }
3333
3434 public func addProductTitle( productTitle: String ) throws -> Self {
35- app. cells [ " product-title " ] . tap ( )
36- app. cells [ " product-title " ] . typeText ( productTitle)
35+ app. cells [ " product-title " ] . enterText ( text: productTitle)
3736 return self
3837 }
3938
@@ -42,8 +41,9 @@ public final class SingleProductScreen: ScreenObject {
4241 return self
4342 }
4443
45- public func verifyNewProductScreenLoaded( ) {
44+ public func verifyNewProductScreenLoaded( productName : String ) {
4645 XCTAssertTrue ( app. buttons [ " save-product-button " ] . exists)
4746 XCTAssertTrue ( app. staticTexts [ " TIP " ] . exists)
47+ XCTAssertTrue ( app. textViews [ productName] . exists)
4848 }
4949}
Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ extension XCUIElement {
2222 self . tap ( )
2323 self . typeText ( text)
2424 }
25+
26+ func enterText( text: String ) -> Void {
27+ self . tap ( )
28+ self . typeText ( text)
29+ }
2530}
2631
2732extension XCTestCase {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ final class ProductsTests: XCTestCase {
55
66 let productTypes = [
77 " physical " : " Simple physical product " ,
8- " virtual " : " Virtual physical product" ,
8+ " virtual " : " Simple virtual product" ,
99 " variable " : " Variable product " ,
1010 " grouped " : " Grouped product " ,
1111 " external " : " External product "
@@ -40,6 +40,6 @@ final class ProductsTests: XCTestCase {
4040 . selectProductType ( productType: productTypes [ " physical " ] !)
4141 . addProductTitle ( productTitle: product. name)
4242 . publishProduct ( )
43- . verifyNewProductScreenLoaded ( )
43+ . verifyNewProductScreenLoaded ( productName : product . name )
4444 }
4545}
You can’t perform that action at this time.
0 commit comments