Selenium/Node.js/selenium-EXTENSION-jessie Jenkins job

From MediaWiki.org
Jump to navigation Jump to search

For this example, we will target English Wikipedia at the Beta Cluster. You will need internet access. The job runs once every day, but you can also start them manually.

Jenkins targets beta cluster.png

Advantages[edit]

  • You do not have to install anything on your machine.
  • You are probably already familiar with Jenkins.
  • While the tests are running, you can continue using your machine as usual, because everything is happening in Jenkins.
  • Debugging failed tests will be reasonably easy, since you will see logs and screenshots of the test run.
  • It will be reasonable fast.

Disadvantages[edit]

  • You will need internet connection while running the tests.
  • You might not be familiar with Jenkins, so you will have to learn how to use yet another tool.

Check if the Jenkins job is configured to run for a repository[edit]

- project:
    name: RelatedArticles
    repository: mediawiki/extensions/RelatedArticles

    jobs:
     - 'selenium-{name}-jessie'

- project:
    name: Popups
    repository: mediawiki/extensions/Popups

    jobs:
     - 'selenium-{name}-jessie'

Run the Selenium tests[edit]

  • Log in to Jenkins.
  • Go to a job. (Examples: selenium-RelatedArticles-jessie, selenium-Popups-jessie.)
  • Click Build with Parameters.
  • Click Build.
  • In Build History a new job will be blinking at the top of the list, for example #106.
  • Click job number, in this case #106.
  • Click Console Output.
  • If the job has been running for a while, there will be Full Log link at the top of the page. You can click it to load the entire console output.
Started by user Zeljko Filipin
...
+ MEDIAWIKI_USER='Selenium user'
+ MW_SERVER=https://en.wikipedia.beta.wmflabs.org:443
+ MW_SCRIPT_PATH=/w
+ ./node_modules/.bin/wdio tests/selenium/wdio.conf.jenkins.js --spec extensions/RelatedArticles/tests/selenium/specs/readmore.js
+ chromedriver --url-base=/wd/hub --port=4444
Starting ChromeDriver 2.27 (undefined) on port 4444
Only local connections are allowed.
------------------------------------------------------------------
[chrome #0-0] Session ID: d253f23847b8ef888adf67e685361af5
[chrome #0-0] Spec: /home/jenkins/workspace/selenium-RelatedArticles-jessie/src/extensions/RelatedArticles/tests/selenium/specs/readmore.js
[chrome #0-0] Running: chrome
[chrome #0-0]
[chrome #0-0]   ReadMore
[chrome #0-0]
[chrome #0-0]   ReadMore
[chrome #0-0]       ✓ ReadMore is not present on Vector
[chrome #0-0]       ✓ ReadMore is present in Minerva
[chrome #0-0]
[chrome #0-0]
[chrome #0-0] 2 passing (6s)
[chrome #0-0]

Wrote xunit report to [../log/].

2 passing (7.60s)
...
Archiving artifacts
Recording test results
Finished: SUCCESS