1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 | 'use strict';
|
19 |
|
20 | var assert = require('../testing/assert'),
|
21 | test = require('../lib/test'),
|
22 | Pages = test.Pages;
|
23 |
|
24 |
|
25 | test.suite(function(env) {
|
26 | var browsers = env.browsers;
|
27 |
|
28 | var driver;
|
29 | test.before(function() {
|
30 | driver = env.builder().build();
|
31 | });
|
32 |
|
33 | test.after(function() {
|
34 | driver.quit();
|
35 | });
|
36 |
|
37 | describe('fingerprinting', function() {
|
38 | test.it('it should fingerprint the navigator object', function*() {
|
39 | yield driver.get(Pages.simpleTestPage);
|
40 |
|
41 | let wd = yield driver.executeScript('return navigator.webdriver');
|
42 | assert(wd).equalTo(true);
|
43 | });
|
44 |
|
45 | test.it('fingerprint must not be writable', function*() {
|
46 | yield driver.get(Pages.simpleTestPage);
|
47 |
|
48 | let wd = yield driver.executeScript(
|
49 | 'navigator.webdriver = "ohai"; return navigator.webdriver');
|
50 | assert(wd).equalTo(true);
|
51 | });
|
52 |
|
53 | test.it('leaves fingerprint on svg pages', function*() {
|
54 | yield driver.get(Pages.svgPage);
|
55 |
|
56 | let wd = yield driver.executeScript('return navigator.webdriver');
|
57 | assert(wd).equalTo(true);
|
58 | });
|
59 | });
|
60 |
|
61 |
|
62 | }, {browsers: ['legacy-firefox']});
|