Skip to content

Commit

Permalink
fix: the order of screen view events
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweii committed Feb 2, 2024
1 parent 7ef6349 commit 26c835b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions IntegrationTest/devicefarm/logcat_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ def test_first_screen_view(self, path):
print("Start verify: " + str(path))
self.init_events(path)
# assert first _screen_view
screen_view_event = next(
(event for event in self.recorded_events if '_screen_view' in event.get('event_name', '')),
None)
screen_view_events = [event for event in self.recorded_events if '_screen_view' in event.get('event_name', '')]
screen_view_event = sorted(
screen_view_events,
key=lambda event: event['event_json'].get('timestamp', float('inf'))
)[0]
assert screen_view_event['event_json'].get('attributes')['_entrances'] == 1
assert '_screen_id' in screen_view_event['event_json'].get('attributes')
assert '_screen_name' in screen_view_event['event_json'].get('attributes')
Expand Down

0 comments on commit 26c835b

Please sign in to comment.