Search code examples
javascriptautomated-testsazure-devopsend-to-end

Can end-to-end tests in Visual Studio Team Services Build be run?


I have a set of mocha tests that launch Spectron to do end-to-end testing on an Electron application.

When I try to run the tests through npm run, they just time out and fail. It seems that the application isn't launching. There is a Run Functional Tests build step template in VSTS, but that's for an actual test DLL. Is there something similar for Javascript end-to-end testing?


Solution

  • The Hosted Agent is running as the service, however launch Spectron to do test with Electron app need to interact with window and the test is running on build agent machine. So you need to setup a on premise build agent to do that test (works fine for me with this test sample. Build steps: npm install, npm install test)

    1. Log on to the machine using the account for which you've prepared permissions as explained above.
    2. Go to the Agent pools control panel tab
    3. Click Download agent.
    4. Click Windows.
    5. Click the Download button.
    6. Run PowerShell as Administrator.
    7. Run the commands under Create the agent.
    8. Run .\config cmd

    More information to setup on premise build agent, you can refer to this article.