2016-07-28 4 views
0

私のアプリケーションにUITestを追加しようとしていますが、計算結果はTable View(スタイル:右の詳細)に表示されます。私はセルの左側に表示されている「Static Text」(下の1行目)を読むことができましたが、「正しい詳細」の読み方を決定で​​きませんでした。 2行目は、右の詳細値(この例では2点)をテストする場所を示しています。Xcode UITest UITableviewcellを読み込もうとしています右の詳細値

XCTAssert(app.tables.cells.staticTexts["Best of Breed"].exists) 
//2 Points 

ご協力いただければ幸いです。

-----更新28 - 7月 - 2016 -----

私は、テーブルのセルは、テキストがであるべきと私は「2ポイントことを確認した際に指定する方法を発見しました.debugDescription

(String) $R2 = "Attributes: Cell 0x600000364bc0: traits: 8589934593, {{16.0, 95.0}, {343.0, 78.0}} 
Element subtree: 
→Cell 0x600000364bc0: traits: 8589934593, {{16.0, 95.0}, {343.0, 78.0}} 
    StaticText 0x6000003651c0: traits: 8589934656, {{31.0, 105.0}, {115.0, 57.5}}, 
     label: \'Best of Breed Best of Winners Winners Bitch\' 
    StaticText 0x600000365100: traits: 8589934656, {{265.5, 105.0}, {58.5, 19.5}}, 
     label: \'2 Points\' 
    Path to element: 
    →Application 0x6000003642c0: {{0.0, 0.0}, {375.0, 667.0}}, label: \'Best of Breed\' 
    ↳Window 0x600000364500: Main Window, {{0.0, 0.0}, {375.0, 667.0}} 
    ↳Other 0x6000003645c0: traits: 8589934592, {{0.0, 0.0}, {375.0, 667.0}} 
    ↳Other 0x600000364380: traits: 8589934592, {{0.0, 0.0"... 
: 'より具体的XCTAssertを細胞

XCTAssert(app.tables.element.cells.element(boundBy: 0).staticTexts["Best of Breed Best of Winners Winners Dog"].exists) 
XCTAssert(app.tables.element.cells.element(boundBy: 0).staticTexts["2 Points"].exists) 

印刷app.tables.element.cells.element(0 BOUNDBY)が存在します

+0

を働いたあなたは、これらの要素に(ラベルは可能性がある)アクセシビリティラベルを与えることができますか?アクセス可能ラベルについてこれらの要素にアクセスしようとします。 – emoleumassi

+0

私はそれについていくつかの研究をします... Thanx –

答えて

0

これらは

XCTAssert(app.tables.cells.element(boundBy: 0).staticTexts["Best of Breed"].exists) 
XCTAssert(app.tables.cells.element(boundBy: 0).staticTexts["2 Points"].exists) 
関連する問題