@seleniumhq/code-export-python-pytest 3.16.0 → 3.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/__test__/src/__snapshots__/command.spec.js.snap +11 -9
- package/__test__/src/__snapshots__/index.spec.js.snap +14 -3
- package/__test__/src/command.spec.js +10 -2
- package/__test__/src/index.spec.js +12 -3
- package/__test__/src/selection.spec.js +7 -0
- package/package.json +3 -3
- package/src/command.js +44 -10
- package/src/hook.js +1 -1
- package/src/index.js +6 -1
- package/src/location.js +1 -1
- package/src/selection.js +4 -1
- package/dist/command.js +0 -882
- package/dist/hook.js +0 -179
- package/dist/hooks/afterAll.js +0 -48
- package/dist/hooks/afterEach.js +0 -49
- package/dist/hooks/beforeAll.js +0 -48
- package/dist/hooks/beforeEach.js +0 -50
- package/dist/hooks/declareDependencies.js +0 -66
- package/dist/hooks/declareMethods.js +0 -53
- package/dist/hooks/declareVariables.js +0 -48
- package/dist/hooks/inEach.js +0 -42
- package/dist/hooks/inEachBegin.js +0 -42
- package/dist/hooks/inEachEnd.js +0 -42
- package/dist/hooks/index.js +0 -61
- package/dist/index.js +0 -133
- package/dist/location.js +0 -68
- package/dist/parsers.js +0 -31
- package/dist/selection.js +0 -57
- package/yarn-error.log +0 -2196
package/dist/hook.js
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.generateHooks = generateHooks;
|
|
7
|
-
|
|
8
|
-
var _sideUtils = require("@seleniumhq/side-utils");
|
|
9
|
-
|
|
10
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
11
|
-
// or more contributor license agreements. See the NOTICE file
|
|
12
|
-
// distributed with this work for additional information
|
|
13
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
14
|
-
// to you under the Apache License, Version 2.0 (the
|
|
15
|
-
// "License"); you may not use this file except in compliance
|
|
16
|
-
// with the License. You may obtain a copy of the License at
|
|
17
|
-
//
|
|
18
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
-
//
|
|
20
|
-
// Unless required by applicable law or agreed to in writing,
|
|
21
|
-
// software distributed under the License is distributed on an
|
|
22
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
23
|
-
// KIND, either express or implied. See the License for the specific language governing permissions and limitations
|
|
24
|
-
// under the License.
|
|
25
|
-
const emitters = {
|
|
26
|
-
afterAll,
|
|
27
|
-
afterEach,
|
|
28
|
-
beforeAll,
|
|
29
|
-
beforeEach,
|
|
30
|
-
declareDependencies,
|
|
31
|
-
declareMethods: empty,
|
|
32
|
-
declareVariables: empty,
|
|
33
|
-
inEachBegin: empty,
|
|
34
|
-
inEachEnd: empty
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function generate(hookName) {
|
|
38
|
-
return new _sideUtils.codeExport.hook(emitters[hookName]());
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function generateHooks() {
|
|
42
|
-
let result = {};
|
|
43
|
-
Object.keys(emitters).forEach(hookName => {
|
|
44
|
-
result[hookName] = generate(hookName);
|
|
45
|
-
});
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function afterAll() {
|
|
50
|
-
const params = {
|
|
51
|
-
startingSyntax: {
|
|
52
|
-
commands: [{
|
|
53
|
-
level: 0,
|
|
54
|
-
statement: 'def teardown_class(cls):'
|
|
55
|
-
}]
|
|
56
|
-
},
|
|
57
|
-
endingSyntax: {
|
|
58
|
-
commands: [{
|
|
59
|
-
level: 0,
|
|
60
|
-
statement: ''
|
|
61
|
-
}]
|
|
62
|
-
},
|
|
63
|
-
registrationLevel: 1
|
|
64
|
-
};
|
|
65
|
-
return params;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function afterEach() {
|
|
69
|
-
const params = {
|
|
70
|
-
startingSyntax: {
|
|
71
|
-
commands: [{
|
|
72
|
-
level: 0,
|
|
73
|
-
statement: 'def teardown_method(self, method):'
|
|
74
|
-
}, {
|
|
75
|
-
level: 1,
|
|
76
|
-
statement: 'self.driver.quit()'
|
|
77
|
-
}]
|
|
78
|
-
},
|
|
79
|
-
endingSyntax: {
|
|
80
|
-
commands: [{
|
|
81
|
-
level: 0,
|
|
82
|
-
statement: ''
|
|
83
|
-
}]
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
return params;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function beforeAll() {
|
|
90
|
-
const params = {
|
|
91
|
-
startingSyntax: {
|
|
92
|
-
commands: [{
|
|
93
|
-
level: 0,
|
|
94
|
-
statement: 'def setup_class(cls):'
|
|
95
|
-
}]
|
|
96
|
-
},
|
|
97
|
-
endingSyntax: {
|
|
98
|
-
commands: [{
|
|
99
|
-
level: 0,
|
|
100
|
-
statement: ''
|
|
101
|
-
}]
|
|
102
|
-
},
|
|
103
|
-
registrationLevel: 1
|
|
104
|
-
};
|
|
105
|
-
return params;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function beforeEach() {
|
|
109
|
-
const params = {
|
|
110
|
-
startingSyntax: ({
|
|
111
|
-
browserName,
|
|
112
|
-
gridUrl
|
|
113
|
-
} = {}) => ({
|
|
114
|
-
commands: [{
|
|
115
|
-
level: 0,
|
|
116
|
-
statement: 'def setup_method(self, method):'
|
|
117
|
-
}, {
|
|
118
|
-
level: 1,
|
|
119
|
-
statement: gridUrl ? `self.driver = webdriver.Remote(command_executor='${gridUrl}', desired_capabilities=DesiredCapabilities.${browserName ? browserName.toUpperCase() : 'CHROME'})` : `self.driver = webdriver.${browserName ? browserName : 'Chrome'}()`
|
|
120
|
-
}, {
|
|
121
|
-
level: 1,
|
|
122
|
-
statement: 'self.vars = {}'
|
|
123
|
-
}]
|
|
124
|
-
}),
|
|
125
|
-
endingSyntax: {
|
|
126
|
-
commands: [{
|
|
127
|
-
level: 0,
|
|
128
|
-
statement: ''
|
|
129
|
-
}]
|
|
130
|
-
}
|
|
131
|
-
};
|
|
132
|
-
return params;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
function declareDependencies() {
|
|
136
|
-
const params = {
|
|
137
|
-
startingSyntax: {
|
|
138
|
-
commands: [{
|
|
139
|
-
level: 0,
|
|
140
|
-
statement: 'import pytest'
|
|
141
|
-
}, {
|
|
142
|
-
level: 0,
|
|
143
|
-
statement: 'import time'
|
|
144
|
-
}, {
|
|
145
|
-
level: 0,
|
|
146
|
-
statement: 'import json'
|
|
147
|
-
}, {
|
|
148
|
-
level: 0,
|
|
149
|
-
statement: 'from selenium import webdriver'
|
|
150
|
-
}, {
|
|
151
|
-
level: 0,
|
|
152
|
-
statement: 'from selenium.webdriver.common.by import By'
|
|
153
|
-
}, {
|
|
154
|
-
level: 0,
|
|
155
|
-
statement: 'from selenium.webdriver.common.action_chains import ActionChains'
|
|
156
|
-
}, {
|
|
157
|
-
level: 0,
|
|
158
|
-
statement: 'from selenium.webdriver.support import expected_conditions'
|
|
159
|
-
}, {
|
|
160
|
-
level: 0,
|
|
161
|
-
statement: 'from selenium.webdriver.support.wait import WebDriverWait'
|
|
162
|
-
}, {
|
|
163
|
-
level: 0,
|
|
164
|
-
statement: 'from selenium.webdriver.common.keys import Keys'
|
|
165
|
-
}, {
|
|
166
|
-
level: 0,
|
|
167
|
-
statement: 'from selenium.webdriver.common.desired_capabilities import DesiredCapabilities'
|
|
168
|
-
}, {
|
|
169
|
-
level: 0,
|
|
170
|
-
statement: ''
|
|
171
|
-
}]
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
return params;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function empty() {
|
|
178
|
-
return {};
|
|
179
|
-
}
|
package/dist/hooks/afterAll.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let afterAll = `
|
|
24
|
-
@AfterAll
|
|
25
|
-
public void finalTearDown() {
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
let hooks = [];
|
|
29
|
-
|
|
30
|
-
function register(statement) {
|
|
31
|
-
hooks.push(statement);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function clear() {
|
|
35
|
-
hooks = [];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
39
|
-
if (isOptional && !hooks.length) return '';
|
|
40
|
-
return afterAll + hooks.join('\r\n') + ` }
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
exports.default = {
|
|
45
|
-
register,
|
|
46
|
-
clear,
|
|
47
|
-
emit
|
|
48
|
-
};
|
package/dist/hooks/afterEach.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let afterEach = `
|
|
24
|
-
@After
|
|
25
|
-
public void tearDown() {
|
|
26
|
-
driver.quit();
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
let hooks = [];
|
|
30
|
-
|
|
31
|
-
function register(statement) {
|
|
32
|
-
hooks.push(statement);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function clear() {
|
|
36
|
-
hooks = [];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
40
|
-
if (isOptional && !hooks.length) return '';
|
|
41
|
-
return afterEach + hooks.join('\r\n') + ` }
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
exports.default = {
|
|
46
|
-
register,
|
|
47
|
-
clear,
|
|
48
|
-
emit
|
|
49
|
-
};
|
package/dist/hooks/beforeAll.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let beforeAll = `
|
|
24
|
-
@BeforeAll
|
|
25
|
-
public void initialSetUp() {
|
|
26
|
-
`;
|
|
27
|
-
|
|
28
|
-
let hooks = [];
|
|
29
|
-
|
|
30
|
-
function register(statement) {
|
|
31
|
-
hooks.push(statement);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function clear() {
|
|
35
|
-
hooks = [];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
39
|
-
if (isOptional && !hooks.length) return '';
|
|
40
|
-
return beforeAll + hooks.join('\r\n') + ` }
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
exports.default = {
|
|
45
|
-
register,
|
|
46
|
-
clear,
|
|
47
|
-
emit
|
|
48
|
-
};
|
package/dist/hooks/beforeEach.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let beforeEach = `
|
|
24
|
-
@Before
|
|
25
|
-
public void setUp() {
|
|
26
|
-
driver = new FirefoxDriver();
|
|
27
|
-
js = (JavascriptExecutor) driver;
|
|
28
|
-
`;
|
|
29
|
-
|
|
30
|
-
let hooks = [];
|
|
31
|
-
|
|
32
|
-
function register(statement) {
|
|
33
|
-
hooks.push(statement);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function clear() {
|
|
37
|
-
hooks = [];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
41
|
-
if (isOptional && !hooks.length) return '';
|
|
42
|
-
return beforeEach + hooks.join('\r\n') + ` }
|
|
43
|
-
`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.default = {
|
|
47
|
-
register,
|
|
48
|
-
clear,
|
|
49
|
-
emit
|
|
50
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let dependencies = `
|
|
24
|
-
import org.junit.Test;
|
|
25
|
-
import org.junit.Before;
|
|
26
|
-
import org.junit.After;
|
|
27
|
-
import static org.junit.Assert.*;
|
|
28
|
-
import static org.hamcrest.CoreMatchers.is;
|
|
29
|
-
import static org.hamcrest.core.IsNot.not;
|
|
30
|
-
import org.openqa.selenium.By;
|
|
31
|
-
import org.openqa.selenium.WebDriver;
|
|
32
|
-
import org.openqa.selenium.firefox.FirefoxDriver;
|
|
33
|
-
import org.openqa.selenium.Dimension;
|
|
34
|
-
import org.openqa.selenium.WebElement;
|
|
35
|
-
import org.openqa.selenium.interactions.Actions;
|
|
36
|
-
import org.openqa.selenium.support.ui.ExpectedConditions;
|
|
37
|
-
import org.openqa.selenium.support.ui.WebDriverWait;
|
|
38
|
-
import org.openqa.selenium.JavascriptExecutor;
|
|
39
|
-
import org.openqa.selenium.Alert;
|
|
40
|
-
import org.openqa.selenium.Keys;
|
|
41
|
-
import java.util.HashMap;
|
|
42
|
-
import java.util.List;
|
|
43
|
-
import java.util.ArrayList;
|
|
44
|
-
|
|
45
|
-
`;
|
|
46
|
-
|
|
47
|
-
let hooks = [];
|
|
48
|
-
|
|
49
|
-
function register(statement) {
|
|
50
|
-
hooks.push(statement);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function clear() {
|
|
54
|
-
hooks = [];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
58
|
-
if (isOptional && !hooks.length) return '';
|
|
59
|
-
return dependencies + hooks.join('\r\n');
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
exports.default = {
|
|
63
|
-
register,
|
|
64
|
-
clear,
|
|
65
|
-
emit
|
|
66
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let hooks = [];
|
|
24
|
-
|
|
25
|
-
function register(name, commands) {
|
|
26
|
-
let result = '';
|
|
27
|
-
result += `
|
|
28
|
-
public void ${name}() {
|
|
29
|
-
`;
|
|
30
|
-
if (commands) {
|
|
31
|
-
commands.forEach(command => {
|
|
32
|
-
result += `\t${command}
|
|
33
|
-
`;
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
result += `}`;
|
|
37
|
-
if (!hooks.includes(result)) hooks.push(result);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function clear() {
|
|
41
|
-
hooks = [];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
45
|
-
if (isOptional && !hooks.length) return '';
|
|
46
|
-
return hooks.length ? hooks.join('\n\r') : '';
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
exports.default = {
|
|
50
|
-
register,
|
|
51
|
-
clear,
|
|
52
|
-
emit
|
|
53
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let variables = `
|
|
24
|
-
private WebDriver driver;
|
|
25
|
-
private HashMap<String, Object> vars = new HashMap<String, Object>();
|
|
26
|
-
JavascriptExecutor js;
|
|
27
|
-
`;
|
|
28
|
-
|
|
29
|
-
let hooks = [];
|
|
30
|
-
|
|
31
|
-
function register(statement) {
|
|
32
|
-
hooks.push(statement);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function clear() {
|
|
36
|
-
hooks = [];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
40
|
-
if (isOptional && !hooks.length) return '';
|
|
41
|
-
return variables + hooks.join('\r\n');
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
exports.default = {
|
|
45
|
-
register,
|
|
46
|
-
clear,
|
|
47
|
-
emit
|
|
48
|
-
};
|
package/dist/hooks/inEach.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let hooks = [];
|
|
24
|
-
|
|
25
|
-
function register(statement) {
|
|
26
|
-
hooks.push(statement);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function clear() {
|
|
30
|
-
hooks = [];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
34
|
-
if (isOptional && !hooks.length) return '';
|
|
35
|
-
return hooks.join('\r\n');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
exports.default = {
|
|
39
|
-
register,
|
|
40
|
-
clear,
|
|
41
|
-
emit
|
|
42
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let hooks = [];
|
|
24
|
-
|
|
25
|
-
function register(statement) {
|
|
26
|
-
hooks.push(statement);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function clear() {
|
|
30
|
-
hooks = [];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
34
|
-
if (isOptional && !hooks.length) return '';
|
|
35
|
-
return hooks.join('\r\n');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
exports.default = {
|
|
39
|
-
register,
|
|
40
|
-
clear,
|
|
41
|
-
emit
|
|
42
|
-
};
|
package/dist/hooks/inEachEnd.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
// Licensed to the Software Freedom Conservancy (SFC) under one
|
|
7
|
-
// or more contributor license agreements. See the NOTICE file
|
|
8
|
-
// distributed with this work for additional information
|
|
9
|
-
// regarding copyright ownership. The SFC licenses this file
|
|
10
|
-
// to you under the Apache License, Version 2.0 (the
|
|
11
|
-
// "License"); you may not use this file except in compliance
|
|
12
|
-
// with the License. You may obtain a copy of the License at
|
|
13
|
-
//
|
|
14
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
15
|
-
//
|
|
16
|
-
// Unless required by applicable law or agreed to in writing,
|
|
17
|
-
// software distributed under the License is distributed on an
|
|
18
|
-
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
19
|
-
// KIND, either express or implied. See the License for the
|
|
20
|
-
// specific language governing permissions and limitations
|
|
21
|
-
// under the License.
|
|
22
|
-
|
|
23
|
-
let hooks = [];
|
|
24
|
-
|
|
25
|
-
function register(statement) {
|
|
26
|
-
hooks.push(statement);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function clear() {
|
|
30
|
-
hooks = [];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function emit({ isOptional } = { isOptional: false }) {
|
|
34
|
-
if (isOptional && !hooks.length) return '';
|
|
35
|
-
return hooks.join('\r\n');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
exports.default = {
|
|
39
|
-
register,
|
|
40
|
-
clear,
|
|
41
|
-
emit
|
|
42
|
-
};
|