summaryrefslogtreecommitdiffstats
path: root/polygerrit-ui/app/test/functional/infra/test-infra.js
blob: 26196941ab214ec26ecacae56863eaf4cbf29648 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
'use strict';

const {Builder} = require('selenium-webdriver');

let driver;

function setup() {
  return new Builder()
      .forBrowser('chrome')
      .usingServer('http://localhost:4444/wd/hub')
      .build()
      .then(d => {
        driver = d;
        return driver.get('http://localhost:8080');
      })
      .then(() => driver);
}

function cleanup() {
  return driver.quit();
}

exports.setup = setup;
exports.cleanup = cleanup;