Skip to content

Commit 5c065f1

Browse files
authored
Merge pull request #9 from the-t-in-rtf/GH-8
GH-8: Migrate to `fluid-lint-all`. Update all (safe) dependencies (resolves #8).
2 parents 0007a20 + 5ae9d3c commit 5c065f1

File tree

25 files changed

+71
-71
lines changed

25 files changed

+71
-71
lines changed

.fluidlintallrc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"sources": {
3+
"md": [ "./*.md", "./docs/*.md"],
4+
"js": ["./src/**/*.js", "./tests/**/*.js", "./*.js"],
5+
"json": ["src/**/*.json", "tests/**/*.json", "./*.json"],
6+
"json5": [],
7+
"other": ["./.*", "!./package-lock.json"]
8+
},
9+
"eslint": {
10+
"md": {
11+
"options": {
12+
"rules": {
13+
"no-redeclare": false
14+
}
15+
}
16+
}
17+
}
18+
}

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: npm install
3232

3333
- name: Lint Code
34-
run: $(npm bin)/grunt lint
34+
run: npm run lint
3535

3636
- name: Node Tests
3737
run: xvfb-run --auto-servernum npm test

Gruntfile.js

-19
This file was deleted.

package.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
"description": "A series of Fluid components that help write tests using the WebDriver API.",
55
"main": "index.js",
66
"scripts": {
7-
"pretest": "node node_modules/rimraf/bin.js coverage/*",
8-
"test": "node node_modules/istanbul/lib/cli.js cover tests/all-tests.js"
7+
"lint": "fluid-lint-all",
8+
"pretest": "npx rimraf coverage/*",
9+
"test": "istanbul cover tests/all-tests.js"
910
},
1011
"repository": {
1112
"type": "git",
@@ -16,20 +17,18 @@
1617
"homepage": "https://github.com/fluid-project/fluid-webdriver#readme",
1718
"dependencies": {
1819
"accessibility-developer-tools": "2.12.0",
19-
"axe-core": "3.5.5",
20-
"brace-expansion": "1.1.11",
21-
"infusion": "3.0.0-dev.20200326T173810Z.24ddb2718",
20+
"axe-core": "4.1.1",
21+
"brace-expansion": "2.0.0",
22+
"infusion": "3.0.0-dev.20201113T153152Z.32176dcbe.FLUID-6145",
2223
"selenium-webdriver": "3.6.0"
2324
},
2425
"devDependencies": {
25-
"eslint": "7.4.0",
26-
"eslint-config-fluid": "1.4.0",
27-
"fluid-express": "1.0.16",
28-
"fluid-grunt-lint-all": "1.0.8",
29-
"grunt": "1.2.1",
26+
"eslint": "7.17.0",
27+
"eslint-config-fluid": "2.0.0",
28+
"fluid-express": "1.0.17",
29+
"fluid-lint-all": "1.0.0",
3030
"istanbul": "0.4.5",
31-
"kettle": "1.12.0",
32-
"node-jqunit": "1.1.8",
33-
"rimraf": "3.0.2"
31+
"kettle": "2.0.0",
32+
"node-jqunit": "1.1.8"
3433
}
3534
}

src/tests/allBrowsers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fluid.registerNamespace("fluid.test.webdriver.allBrowsers");
8383
*
8484
* Set the `SELENIUM_BROWSER` environment variable to implicitly force the webdriver instance to use the selected browser.
8585
*
86-
* @param {String} browser The browser to use.
86+
* @param {String} browser - The browser to use.
8787
*
8888
*/
8989
fluid.test.webdriver.allBrowsers.setBrowser = function (browser) {

src/tests/helper-functions.js

+22-18
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ fluid.registerNamespace("fluid.test.webdriver");
1515
* A function to that calls `elementFn` against DOM element `element` and compares the result to `expectedValue` using
1616
* `jqUnitFn`.
1717
*
18-
* @param {String} message A message describing this test.
19-
* @param {Object} element The DOM element to inspect.
20-
* @param {String} elementFn The function name we expected to run against the DOM element.
21-
* @param {Object} expectedValue The expected return value.
22-
* @param {String} jqUnitFn The jqUnit function to use for the test.
18+
* @param {String} message - A message describing this test.
19+
* @param {Object} element - The DOM element to inspect.
20+
* @param {String} elementFn - The function name we expected to run against the DOM element.
21+
* @param {Object} expectedValue - The expected return value.
22+
* @param {String} jqUnitFn - The jqUnit function to use for the test.
23+
*
2324
*/
2425
fluid.test.webdriver.inspectElement = function (message, element, elementFn, expectedValue, jqUnitFn) {
2526
jqUnitFn = jqUnitFn || "assertEquals";
@@ -32,10 +33,10 @@ fluid.test.webdriver.inspectElement = function (message, element, elementFn, exp
3233
*
3334
* Get an element's `value` attribute and compare it to an expected value using a particular jqUnit function.
3435
*
35-
* @param {String} message A message describing this test.
36-
* @param {Object} element The DOM element to inspect.
37-
* @param {Object} expectedValue The expected value of the element.
38-
* @param {String} jqUnitFn The jqUnit function to use for the comparison, typically `assertEquals` or `assertDeepEq`.
36+
* @param {String} message - A message describing this test.
37+
* @param {Object} element - The DOM element to inspect.
38+
* @param {Object} expectedValue - The expected value of the element.
39+
* @param {String} jqUnitFn - The jqUnit function to use for the comparison, typically `assertEquals` or `assertDeepEq`.
3940
*
4041
*/
4142
fluid.test.webdriver.testElementValue = function (message, element, expectedValue, jqUnitFn) {
@@ -49,9 +50,9 @@ fluid.test.webdriver.testElementValue = function (message, element, expectedValu
4950
*
5051
* A function to verify whether an element is selected.
5152
*
52-
* @param {String} message A message describing this test.
53-
* @param {Object} element The DOM element to inspect.
54-
* @param {Boolean} selected True if the element should be selected, false otherwise.
53+
* @param {String} message - A message describing this test.
54+
* @param {Object} element - The DOM element to inspect.
55+
* @param {Boolean} selected - True if the element should be selected, false otherwise.
5556
*
5657
*/
5758
fluid.test.webdriver.testElementSelected = function (message, element, selected) {
@@ -64,10 +65,10 @@ fluid.test.webdriver.testElementSelected = function (message, element, selected)
6465
* A function to compare an array of elements with an array of expected values. Ideal for use with
6566
* `{fluid.webdriver}.findElements`, which returns an array of elements.
6667
*
67-
* @param {String} message A message describing this test.
68-
* @param {Array} elements An array of DOM elements.
69-
* @param {String} elementFn The element function to call for each DOM element.
70-
* @param {Array} expectedValues An array of expected return values.
68+
* @param {String} message - A message describing this test.
69+
* @param {Array} elements - An array of DOM elements.
70+
* @param {String} elementFn - The element function to call for each DOM element.
71+
* @param {Array} expectedValues - An array of expected return values.
7172
*
7273
*/
7374
fluid.test.webdriver.inspectElements = function (message, elements, elementFn, expectedValues) {
@@ -86,8 +87,8 @@ fluid.test.webdriver.inspectElements = function (message, elements, elementFn, e
8687
*
8788
* Some things, like Capabilities, are Map objects that we would like to be able to inspect as plain old Javascript objects.
8889
*
89-
* @param {Map} map A map to be converted.
90-
* @return {Object} The map in JSON form.
90+
* @param {Map} map - A map to be converted.
91+
* @return {Object} - The map in JSON form.
9192
*
9293
*/
9394
fluid.test.webdriver.mapToObject = function (map) {
@@ -105,6 +106,7 @@ fluid.test.webdriver.mapToObject = function (map) {
105106
*
106107
* @param {Array} failures - An array of failure messages returned by an accessibility scanner (see below).
107108
* @param {Boolean} shouldHaveFailures - Whether the results should contain failures (`false` by default).
109+
*
108110
*/
109111
fluid.test.webdriver.checkAccessibilityScanResults = function (failures, shouldHaveFailures) {
110112
if (shouldHaveFailures) {
@@ -135,6 +137,7 @@ fluid.test.webdriver.invokeGlobal = function (functionPath, fnArgs, environment)
135137

136138
fluid.registerNamespace("fluid.test.webdriver.axe");
137139

140+
/* eslint-disable jsdoc/check-param-names */
138141
/**
139142
*
140143
* A function to run aXe in a browser and then return the results. Should be used with `executeAsyncScript`.
@@ -144,6 +147,7 @@ fluid.registerNamespace("fluid.test.webdriver.axe");
144147
*
145148
* @param {Function} callback - The WebDriver API itself supplies a callback that we use to return the results of the scan.
146149
*/
150+
/* eslint-enable jsdoc/check-param-names */
147151
fluid.test.webdriver.axe.runAxe = function () {
148152
/* globals axe */
149153
var callback = arguments[arguments.length - 1];

tests/js/actions/browser-actions-click.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ fluid.webdriver.loadTestingSupport();
1313

1414
fluid.registerNamespace("fluid.tests.webdriver.actions.text");
1515

16-
/* globals document */
1716
fluid.tests.webdriver.actions.text.getRadioButtonValue = function () {
1817
return document.sampleForm.color.value;
1918
};

tests/js/actions/html/click.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
<input type="radio" name="color" value="blue" id="blue-button" checked="checked"/>
1212
</form>
1313
</body>
14-
</html>
14+
</html>

tests/js/actions/html/tabs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
<input tabindex="0" type="text" id="text-field-3"/>
1010
</form>
1111
</body>
12-
</html>
12+
</html>

tests/js/actions/html/text.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
<input type="text" id="text-field"/>
88
</form>
99
</body>
10-
</html>
10+
</html>

tests/js/axe/html/bad.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
<body>
77
<p role="main">This is content.</p>
88
</body>
9-
</html>
9+
</html>

tests/js/axe/html/good.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ <h1>Welcome to the content.</h1>
99
<p>This is content.</p>
1010
</div>
1111
</body>
12-
</html>
12+
</html>

tests/js/axe/html/injection.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ <h1>Welcome to the content.</h1>
88
<p>This is content.</p>
99
</div>
1010
</body>
11-
</html>
11+
</html>

tests/js/axs/html/bad.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
<body>
77
<p role="bogus">This is content.</p>
88
</body>
9-
</html>
9+
</html>

tests/js/axs/html/good.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
<h1>Welcome to the good content.</h1>
88
<p>This is content.</p>
99
</body>
10-
</html>
10+
</html>

tests/js/axs/html/injection.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<body>
66
<p>This is content.</p>
77
</body>
8-
</html>
8+
</html>

tests/js/browser-navigation/html/first.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
<title>browser navigation tests (page 1)</title>
44
</head>
55
<body id="first-body">This is the first page.</body>
6-
</html>
6+
</html>

tests/js/browser-navigation/html/refresh.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
</div>
1313
</form>
1414
</body>
15-
</html>
15+
</html>

tests/js/browser-navigation/html/second.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
<title>browser navigation tests (page 2)</title>
44
</head>
55
<body id="second-body">This is the second page.</body>
6-
</html>
6+
</html>

tests/js/executeScript/html/executeScript.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<body>
66
<p>This page will have script content injected into it, run the code, and then return the result to the node side.</p>
77
</body>
8-
</html>
8+
</html>

tests/js/findElement/html/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515

1616
<a href="#">Complete Link Text</a>
1717
</body>
18-
</html>
18+
</html>

tests/js/fluid/html/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
<p>This is content.</p>
99
<script src="../js/fluid-test-fixtures.js"></script>
1010
</body>
11-
</html>
11+
</html>

tests/js/fluid/js/fluid-test-fixtures.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
/* eslint no-undef: 0 */
2-
/* globals fluid */
32
(function () {
43
"use strict";
54
fluid.registerNamespace("fluid.tests.webdriver.fluid");

tests/js/get/html/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<body>
66
<p>Hello, World.</p>
77
</body>
8-
</html>
8+
</html>

tests/js/takeScreenshot/html/takeScreenshot.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
A polygon shaped like a stylized "X".
1111
</svg>
1212
</body>
13-
</html>
13+
</html>

0 commit comments

Comments
 (0)