How to run Dojo DOH unit-tests through Jenkins?

后端 未结 3 1359
北恋
北恋 2021-02-07 10:59

Has anyone tried integrating Dojo DOH unit-tests with Jenkins?

I\'d like to do the following, but don\'t want to reinvent it if this has already been done. So, I\'m think

3条回答
  •  情书的邮戳
    2021-02-07 11:27

    1. Automated Dojo testing - DOH & Selenium-RC (Rob Coup - 2008/01/03)

    Plan:

    • Have a config file defining which browsers to launch, which machines they're on, and what tests to run.
    • Launch each browser via Selenium-RC
    • Run the tests via the normal DOH browser runner.
    • Use Selenium to extract the results from DOH.
    • Collate the results from the various browsers and produce something useful.

    Solution:

    • Drop seleniumRunner.js, seleniumRunner.config.js, seleniumRunner.sh (or the .bat if you're on Windows), and selenium-java-client-driver.jar into util/doh/ in your Dojo install.
    • Put selenium-server.jar on each test machine, then run java -jar selenium-server.jar -multiWindow so it listens for the browser-control messages.
    • Edit seleniumRunner.config.js and change browsers and rootUrl to match your setup. The rootUrl needs to be reachable from each test machine.
    • run ./seleniumRunner.sh seleniumRunner.config.js from util/doh/ on your workstation
    • It'll load the config, fire up the browsers on each machine, run the unit tests from Dojo core, and print the pass/fail/error stats for each.
    • Each browser is kicked off and monitored in a separate thread (not strictly necessary but too cool to resist doing).

    Issues:

    • unless I ran the selenium server in multiWindow mode Safari and Firefox would pop up Print dialogs (!?!) whenever the test page was loaded. But Safari never initialised the test page if it was in multiWindow mode. On OSX and Windows. gah.
    • Opera on OSX didn't set up the Selenium proxy properly (localhost:4444 for reference).
    • IE didn't like doing a dojo.connect() via the selenium javascript commands for some reason.

    2. Seems reasonable to me.

    3. Jenkins Selenium plugin

    This plugin turns your Jenkins cluster into a Selenium2 Grid cluster, so that you can utilize your heterogeneous Jenkins clusters to carry out Selenium tests. This plugin is a turn-key solution — no additional installation nor configuration is necessary to make it work. The plugin installs Selenium Grid on all the slaves automatically and set up a grid on its own.

提交回复
热议问题