Skip to content

Add automated ui testing #21

Open
Open

Description

@devkeydet

Activity

  1. devkeydet commented on Nov 20, 2017

    @devkeydet
    OwnerAuthor

    We already have automated ui testing in the reference app:
    https://github.com/devkeydet/CrmAsyncRequestResponseSampleV2/tree/master/UIAutomationTests

    However, there is a known issue with https://github.com/Microsoft/EasyRepro/ when executing a headless test with the phantomjs driver:
    devkeydet/CrmAsyncRequestResponseSampleV2#23

    See:
    microsoft/EasyRepro#47

    Once the issue is resolved, we'll update one of the release builds to show how to run the ui automation test.

  2. devkeydet commented on Nov 20, 2017

    @devkeydet
    OwnerAuthor

    Two options:
    -Spin up our own agent with a browser installed and use the browser driver (adds complexity)
    -Wait until phantomjs is working

  3. davidjbclark commented on Mar 1, 2018

    @davidjbclark

    @devkeydet I believe there's another working option you can use today.

    Microsoft.Dynamics365.UIAutomation.Browser.BrowserOptions now supports headless for Chrome, which works in a hosted build agent:

    public static class TestSettings
    {
        public static BrowserOptions Options { get { return _options; } }
    
        private static BrowserOptions _options = new BrowserOptions
        {
            BrowserType = BrowserType.Chrome,
            PrivateMode = true,
            FireEvents = true,
            Headless = true
        };
    }

    Then in your build definition, just install Chrome before running your UI tests by running a PowerShell script task:

    $Path = $env:TEMP;
    $Installer = "chrome_installer.exe";
    Invoke-WebRequest "http://dl.google.com/chrome/install/375.126/chrome_installer.exe" -OutFile $Path\$Installer;
    Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait;
    Remove-Item $Path\$Installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions