将 Calabash 与 Ruby 以外的其他东西一起使用

Using Calabash with something else than Ruby

是否可以将 Xamarin Calabash 与 Ruby 以外的编程语言一起使用,例如 C#?

我想对移动设备进行自动化测试。

Xamarin.UITest 基于 C# Calabash

Xamarin.UITest, an Automated UI Acceptance Testing framework based on Calabash that allows programmers to write and execute tests in C# and NUnit that validate the functionality of iOS and Android Apps.

参考:https://developer.xamarin.com/guides/testcloud/uitest/

如果您希望 Ghekin 作为一种语言来描述您的测试,您可以在 Xamarin.UITest.

之上使用 Specflow

http://specflow.org/getting-started/

你可以在这里看到一个例子:https://github.com/smstuebe/xamarin-testing-demo/tree/master/Todo.Tests.UI.Specflow

测试将如下所示。

Feature: Todo
    In order to remember what I have to do
    As a user
    I want to maintain tasks in a list

Scenario: Add a task
    When I enter "Added Task" 
    And I press add
    Then the task "Added Task" should be added to the list

步骤定义然后使用 Xamarin.UITest

[Binding]
public sealed class TodoPageSteps
{
    private TodoPage _page;
    private IApp _app;

    public TodoPageSteps()
    {
        _page = new TodoPage();
        _app = FeatureContext.Current.Get<IApp>("App");
    }

    [When(@"I enter ""(.*)""")]
    public void WhenIEnter(string task)
    {
        _app.Tap(_page.AddEntry);
        _app.EnterText(_page.AddEntry, task);
    }

    [When(@"I press add")]
    public void WhenIPressAdd()
    {
        _app.Tap(_page.AddButton);
    }

    [Then(@"the task ""(.*)"" should be added to the list")]
    public void ThenTheTaskShouldBeAddedToTheList(string task)
    {
        _app.WaitForElement(_page.LabelOfTask(task));
    }
}