Skip to content

Commit 4a0c013

Browse files
committed
Enter new order data from mock data
1 parent 0a2fd7b commit 4a0c013

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

WooCommerce/UITestsFoundation/OrderDataStructs.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public struct OrderData: Codable {
3333
public var total: String
3434
public let line_items: [LineItems]
3535
public let billing: BillingInformation
36+
public let shipping_lines: [ShippingLine]
37+
public let fee_lines: [FeeLine]
3638
public let customer_note: String
3739
}
3840

@@ -45,3 +47,12 @@ public struct BillingInformation: Codable {
4547
public let first_name: String
4648
public let last_name: String
4749
}
50+
51+
public struct ShippingLine: Codable {
52+
public let method_title: String
53+
public let total: String
54+
}
55+
56+
public struct FeeLine: Codable {
57+
public let amount: String
58+
}

WooCommerce/WooCommerceUITests/Tests/OrdersTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ final class OrdersTests: XCTestCase {
3333
.startOrderCreation()
3434
.editOrderStatus()
3535
.addProduct(byName: products[0].name)
36-
.addCustomerDetails(name: "Mira")
37-
.addShipping(amount: "1.25", name: "Flat Rate")
38-
.addFee(amount: "2.34")
36+
.addCustomerDetails(name: order.billing.first_name)
37+
.addShipping(amount: order.shipping_lines[0].total, name: order.shipping_lines[0].method_title)
38+
.addFee(amount: order.fee_lines[0].amount)
3939
.addCustomerNote(order.customer_note)
4040
.createOrder()
4141
}

0 commit comments

Comments
 (0)