Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/javascript/ie-driver/test/test_bootstrap.js
2868 views
1
// Licensed to the Software Freedom Conservancy (SFC) under one
2
// or more contributor license agreements. See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership. The SFC licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License. You may obtain a copy of the License at
8
//
9
// http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied. See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
/**
19
* @fileoverview Bootstrap file that loads all of the WebDriver scripts in the
20
* correct order. Once loaded, pages can use {@code goog.require} statements
21
* from Google Closure to load additional files as needed.
22
*
23
* Example Usage:
24
*
25
* <html>
26
* <head>
27
* <script src="test_bootstrap.js"></script>
28
* <script>
29
* goog.require('goog.debug.Logger');
30
* </script>
31
* <script>
32
* window.onload = function() {
33
* goog.debug.Logger.getLogger('').info(
34
* 'The page has finished loading');
35
* };
36
* </script>
37
* </head>
38
* <body></body>
39
* </html>
40
*/
41
42
(function() {
43
var scripts = document.getElementsByTagName('script');
44
var directoryPath = './';
45
var thisFile = 'test_bootstrap.js';
46
47
for (var i = 0; i < scripts.length; i++) {
48
var src = scripts[i].src;
49
var len = src.length;
50
if (src.substr(len - thisFile.length) == thisFile) {
51
directoryPath = src.substr(0, len - thisFile.length);
52
break;
53
}
54
}
55
56
// All of the files to load. Files are specified in the order they must be
57
// loaded, NOT alphabetical order.
58
var files = [
59
'../../../third_party/closure/goog/base.js',
60
'../../deps.js'
61
];
62
63
for (var j = 0; j < files.length; j++) {
64
document.write('<script type="text/javascript" src="' +
65
directoryPath + files[j] + '"></script>');
66
}
67
})();
68
69