小编Adr*_*man的帖子

在 RecyclerView 中获取 TextView 的文本 - android 仪器测试

我有一个 RecyclerView,其中包含 item.xml 中的项目。在 item.xml 我有一个 TextView。

我正在创建一个工具测试,想知道如何从 recyclerView 中获取该文本视图中的文本,以便我可以对它做一些额外的工作。

使用https://spin.atomicobject.com/2016/04/15/espresso-testing-recyclerviews/我设法检查我期望的文本是否在我期望的位置,但我需要获取值以及。

错误代码:

descendant: with string from resource id: <2131427419>' doesn't match the selected view when calling onView(withRecyclerView(R.id.recycler_view).atPosition(2)) .check(matches(hasDescendant(withText(R.id.my_textview))));
Run Code Online (Sandbox Code Playgroud)

testing android android-espresso

5
推荐指数
1
解决办法
1024
查看次数

斯威夫特和录音

我正在swift构建一个iOS应用程序,客户端返回了录音的问题,基本上它没有记录任何内容.他在带有ios 9.x的iPhone 5/5s上进行了测试.检查权限,如果手机上有足够的空间,这些都不是问题.

就个人而言,在模拟器上使用带有ios 10.x和iphone 5的iphone 6s设备测试并且记录正在运行.任何人之前遇到过这种情况,或者说我做错了什么让我望而却步.

为不同的功能添加了注释,说明应用程序的功能.

protocol RecordAndPlayManagerDelegate : class{
    func recorderDidStopRecording()
}

class RecordAndPlayManager: NSObject, AVAudioRecorderDelegate {
    var soundRecorder: AVAudioRecorder!
    let recordSettings = [
        AVFormatIDKey: Int(kAudioFormatMPEG4AAC),
        AVSampleRateKey: 12000,
        AVNumberOfChannelsKey: 1,
        AVEncoderAudioQualityKey: AVAudioQuality.high.rawValue
    ]
    class func directoryURL() -> URL? {
        let fileManager = FileManager.default
        let urls = fileManager.urls(for: .documentDirectory, in: .userDomainMask)
        let documentDirectory = urls[0] as URL
        let soundURL = documentDirectory.appendingPathComponent("recording.m4a")
        return soundURL
    }

    //calling this from outside to get the audio
    class func getLocalOrRemoteRecording(_ recordingID : String!) …
Run Code Online (Sandbox Code Playgroud)

iphone audio-recording avaudiorecorder ios swift

5
推荐指数
1
解决办法
1164
查看次数

将mongoose数组元素与数组进行比较

nodejs和mongoose的初学者.

我有这样的架构

schema = new Schema({
    username: String,
    items: [Number]
});
Run Code Online (Sandbox Code Playgroud)

现在,我想打个电话

var myItemsArray = [10,5,23,534];
user.find({items: myItemsArray}, function(err, user){});
Run Code Online (Sandbox Code Playgroud)

基本上,我希望呼叫返回用户,如果它有任何上述项目.

谢谢

mongoose mongodb node.js

2
推荐指数
1
解决办法
1744
查看次数