Skip to content

Commit 908ccf9

Browse files
committed
Live Event App
* Added the README.md file * Set the MessageList component as a root view * FPSDebug view set at the top right corner * Added a XCUITests target
1 parent 9b14fe5 commit 908ccf9

File tree

23 files changed

+1678
-0
lines changed

23 files changed

+1678
-0
lines changed

Examples.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

live-event-app/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Live Event App
2+
3+
The purpose of this application is to simulate the high-volume use case. This use case means getting thousands of messages for one channel in a very short time.
4+
5+
## Prerequisites
6+
7+
| Name | Requirement |
8+
| :--- | :------ |
9+
| [Xcode](https://developer.apple.com/xcode/resources/) | >= 13.0 |
10+
| [@pubnub/tomato](https://github.com/pubnub/tomato) | >= 1.5.0 |
11+
12+
## Usage
13+
14+
### First step
15+
16+
1. ...
17+
18+
2. ...
19+
20+
3. ...
21+
22+
## Support
23+
24+
If you need help or have a general question, [contact support](mailto:support@pubnub.com).
25+
26+
## License
27+
28+
Live Event App for iOS is released under the MIT license. [See LICENSE](https://github.com/pubnub/chat-components-ios/blob/master/LICENSE) for details.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
//
2+
// LiveEventAppUITests.swift
3+
//
4+
// PubNub Real-time Cloud-Hosted Push API and Push Notification Client Frameworks
5+
// Copyright © 2021 PubNub Inc.
6+
// https://www.pubnub.com/
7+
// https://www.pubnub.com/terms
8+
//
9+
// Permission is hereby granted, free of charge, to any person obtaining a copy
10+
// of this software and associated documentation files (the "Software"), to deal
11+
// in the Software without restriction, including without limitation the rights
12+
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13+
// copies of the Software, and to permit persons to whom the Software is
14+
// furnished to do so, subject to the following conditions:
15+
//
16+
// The above copyright notice and this permission notice shall be included in
17+
// all copies or substantial portions of the Software.
18+
//
19+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25+
// THE SOFTWARE.
26+
//
27+
28+
import XCTest
29+
30+
final class LiveEventAppUITests: XCTestCase {
31+
32+
override func setUpWithError() throws {
33+
// Put setup code here. This method is called before the invocation of each test method in the class.
34+
// In UI tests it is usually best to stop immediately when a failure occurs.
35+
continueAfterFailure = false
36+
// In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run.
37+
// The setUp method is a good place to do this.
38+
}
39+
40+
override func tearDownWithError() throws {
41+
// Put teardown code here. This method is called after the invocation of each test method in the class.
42+
}
43+
44+
func testExample() throws {
45+
// UI tests must launch the application that they test.
46+
let app = XCUIApplication()
47+
// Launches the application synchronously
48+
app.launchArguments = ["1", "2", "3"]
49+
app.launch()
50+
51+
let lastMessagePredicate = NSPredicate(format: "label == '[99] Lorem ipsum dolor sit amet'")
52+
let messageList = app.collectionViews.firstMatch
53+
let lastMessageCell = messageList.cells.containing(lastMessagePredicate).firstMatch
54+
let result = lastMessageCell.waitForExistence(timeout: 30)
55+
56+
XCTAssertTrue(result)
57+
}
58+
59+
func testPerformane() throws {
60+
measure {
61+
try? LiveEventAppUITests().testExample()
62+
}
63+
}
64+
}

0 commit comments

Comments
 (0)