Skip to content

More love for the bare-ui-test users #88

@SeriousM

Description

@SeriousM

Because our MVC solution is very big and we don't use the standard model-view approach we can test our ui more or less only in the classic way.
The good news is that Seleno has pretty good support for this use-case but some functions are missing.

For example the Input() method on the generic Page<...> object offers things I would really like use in the non-generic version.

For that I created an extension for the IExecutor interface.
I will left it here for review, plrease tell me if my approach is correct or if that stuff already exists (and I'm blind).

Thanks

public static class ExecutorExtensions
{
    public static void SetValue(this IExecutor executor, By.jQueryBy by, string value)
    {
        executor.ExecuteScript(string.Format("${0}.val('{1}');", by.Selector, value));
    }

    public static void SetText(this IExecutor executor, By.jQueryBy by, string value)
    {
        executor.ExecuteScript(string.Format("${0}.text('{1}');", by.Selector, value));
    }

    public static void SetAttribute(this IExecutor executor, By.jQueryBy by, string name, string value)
    {
        executor.ExecuteScript(string.Format("${0}.attr('{1}', '{2}');", by.Selector, name, value));
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions