diff --git a/Sources/Datadog/RUMMonitor.swift b/Sources/Datadog/RUMMonitor.swift index 5ae7b52c4d..de9286b85d 100644 --- a/Sources/Datadog/RUMMonitor.swift +++ b/Sources/Datadog/RUMMonitor.swift @@ -263,7 +263,7 @@ public class RUMMonitor: DDRUMMonitor, RUMCommandSubscriber { time: dateProvider.currentDate(), identity: key, name: name ?? key, - path: name ?? key, + path: key, attributes: attributes ) ) diff --git a/Tests/DatadogTests/Datadog/RUMMonitorTests.swift b/Tests/DatadogTests/Datadog/RUMMonitorTests.swift index e466984ffc..68d8a8a53c 100644 --- a/Tests/DatadogTests/Datadog/RUMMonitorTests.swift +++ b/Tests/DatadogTests/Datadog/RUMMonitorTests.swift @@ -72,9 +72,9 @@ class RUMMonitorTests: XCTestCase { let monitor = RUMMonitor.initialize() setGlobalAttributes(of: monitor) - monitor.startView(key: "view1", name: "View1") + monitor.startView(key: "view1-key", name: "View1") monitor.stopView(key: "view1") - monitor.startView(key: "view2", name: "View2") + monitor.startView(key: "view2-key", name: "View2") let rumEventMatchers = try RUMFeature.waitAndReturnRUMEventMatchers(count: 4) verifyGlobalAttributes(in: rumEventMatchers) @@ -82,9 +82,9 @@ class RUMMonitorTests: XCTestCase { let session = try XCTUnwrap(try RUMSessionMatcher.groupMatchersBySessions(rumEventMatchers).first) XCTAssertEqual(session.viewVisits.count, 2) XCTAssertEqual(session.viewVisits[0].name, "View1") - XCTAssertEqual(session.viewVisits[0].path, "View1") + XCTAssertEqual(session.viewVisits[0].path, "view1-key") XCTAssertEqual(session.viewVisits[1].name, "View2") - XCTAssertEqual(session.viewVisits[1].path, "View2") + XCTAssertEqual(session.viewVisits[1].path, "view2-key") } func testStartingView_thenLoadingImageResourceWithRequest() throws { diff --git a/Tests/DatadogTests/DatadogObjc/DDRUMMonitorTests.swift b/Tests/DatadogTests/DatadogObjc/DDRUMMonitorTests.swift index 264563d5a4..d3bcb746d9 100644 --- a/Tests/DatadogTests/DatadogObjc/DDRUMMonitorTests.swift +++ b/Tests/DatadogTests/DatadogObjc/DDRUMMonitorTests.swift @@ -120,9 +120,9 @@ class DDRUMMonitorTests: XCTestCase { XCTAssertEqual(event2.view.name, "FirstView") XCTAssertEqual(event2.view.url, "FirstViewController") XCTAssertEqual(event3.view.name, "SecondView") - XCTAssertEqual(event3.view.url, "SecondView") + XCTAssertEqual(event3.view.url, "view2") XCTAssertEqual(event4.view.name, "SecondView") - XCTAssertEqual(event4.view.url, "SecondView") + XCTAssertEqual(event4.view.url, "view2") XCTAssertEqual(try viewEvents[1].attribute(forKeyPath: "context.event-attribute1"), "foo1") XCTAssertEqual(try viewEvents[1].attribute(forKeyPath: "context.event-attribute2"), "foo2") XCTAssertEqual(try viewEvents[3].attribute(forKeyPath: "context.event-attribute1"), "bar1")