小编Ben*_*Ben的帖子

CucumberJS - 错误:在Timer.listOnTimeout(timers.js:92:15)5000毫秒后步进超时

我是cucjs的新手,只是尝试了第一次运行功能.我已经构建了在cucumber-js github页面上的功能.尝试运行时出现此错误:

Benjamins-MBP:功能Ben $ cucumber.js example.feature功能:示例功能

作为cucumber.js的用户,我希望有关于黄瓜的文档,以便我可以专注于构建真棒应用程序

场景:阅读文档#example.feature:6鉴于我在Cucumber.js GitHub存储库#StepDefinitions/myStepDefinition.js:4错误:在Timer.listOnTimeout(timers.js:92:15)5000毫秒后步进超时我转到README文件#StepDefinitions/myStepDefinition.js:15然后我应该看到"Usage"作为页面标题#StepDefinitions/myStepDefinition.js:22

失败的场景:example.feature:6#场景:阅读文档

1个场景(1个失败)3个步骤(1个失败,2个跳过)0m05.001s

如果它是在cucumber-js github页面上的示例功能,那么尝试使这个功能通过会怎么做,所以可能不正确?

这是所有代码:

    // features/step_definitions/myStepDefinitions.js

module.exports = function () {
  this.Given(/^I am on the Cucumber.js GitHub repository$/, function (callback) {
    // Express the regexp above with the code you wish you had.
    // `this` is set to a World instance.
    // i.e. you may use this.browser to execute the step:

    this.visit('https://github.com/cucumber/cucumber-js', callback);

    // The callback is passed to visit() so that when the job's finished, the next …
Run Code Online (Sandbox Code Playgroud)

javascript timer cucumberjs

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

Xamarin.Android Timer更新UI - runOnUiThread

我正在开发一个Xamarin.Android应用程序,它引用了一个带有viewmodels的可移植类库.正在使用MvvmCross.我需要一个Timer,每次"滴答"时都会更新UI.我似乎无法让它更新UI.正如使用调试器确认的那样,它每秒执行一次Tick方法.我需要使用RunOnUiThread方法,但我不确定如何在Xamarin中实现它.将会感谢使得tick更新UI线程的代码示例.

Ticker.cs:

using System;
using Pong.Core.Models;
using Pong.Core.ViewModels;
using System.Threading;

namespace Pong.Droid
{
    public class Ticker
    {
        private readonly Timer _dispatcherTimer;

        private readonly GamePlayViewModel _viewModel;


        public Ticker(GamePlayViewModel viewModel)
        {
            _viewModel = viewModel;
            TimerCallback timerDelegate = new TimerCallback (Tick);
            _dispatcherTimer = new Timer (timerDelegate, null, 0, 1000);
        }



        public void Tick(object state)
        {
            _viewModel.Number++;


            //_viewModel.UpdateBall();
            //_viewModel.UpdatePaddle1();
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

活动:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using …
Run Code Online (Sandbox Code Playgroud)

c# timer xamarin android-runonuithread

4
推荐指数
1
解决办法
5890
查看次数