@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
|
@@ -123,9 +123,9 @@ actions = ActionChains(self.driver)
|
|
|
123
123
|
actions.drag_and_drop(dragged, dropped).perform()"
|
|
124
124
|
`;
|
|
125
125
|
|
|
126
|
-
exports[`command code emitter should emit \`echo\` command 1`] = `"print(
|
|
126
|
+
exports[`command code emitter should emit \`echo\` command 1`] = `"print(\\"blah\\")"`;
|
|
127
127
|
|
|
128
|
-
exports[`command code emitter should emit \`echo\` command with variables 1`] = `"print(
|
|
128
|
+
exports[`command code emitter should emit \`echo\` command with variables 1`] = `"print(\\"blah = {}\\".format(self.vars[\\"blah\\"]))"`;
|
|
129
129
|
|
|
130
130
|
exports[`command code emitter should emit \`edit content\` command 1`] = `
|
|
131
131
|
"element = self.driver.find_element(By.ID, \\"contentEditable\\")
|
|
@@ -225,7 +225,7 @@ actions.move_to_element(element).release().perform()"
|
|
|
225
225
|
|
|
226
226
|
exports[`command code emitter should emit \`open\` with absolute url 1`] = `"self.driver.get(\\"https://www.seleniumhq.org/\\")"`;
|
|
227
227
|
|
|
228
|
-
exports[`command code emitter should emit \`pause\` command 1`] = `"time.sleep(
|
|
228
|
+
exports[`command code emitter should emit \`pause\` command 1`] = `"time.sleep(0.3)"`;
|
|
229
229
|
|
|
230
230
|
exports[`command code emitter should emit \`remove selection\` command 1`] = `
|
|
231
231
|
"dropdown = self.driver.find_element(By.CSS_SELECTOR, \\"select\\")
|
|
@@ -348,17 +348,19 @@ assert value == \\"test\\""
|
|
|
348
348
|
|
|
349
349
|
exports[`command code emitter should emit \`verify\` command 1`] = `"assert(self.vars[\\"varrrName\\"] == \\"blah\\")"`;
|
|
350
350
|
|
|
351
|
-
exports[`command code emitter should emit \`waitForElementEditable\` command 1`] = `"WebDriverWait(self.driver,
|
|
351
|
+
exports[`command code emitter should emit \`waitForElementEditable\` command 1`] = `"WebDriverWait(self.driver, 5).until(expected_conditions.element_to_be_clickable((By.CSS_SELECTOR, \\"#blah\\")))"`;
|
|
352
352
|
|
|
353
|
-
exports[`command code emitter should emit \`waitForElementNotEditable\` command 1`] = `"WebDriverWait(self.driver,
|
|
353
|
+
exports[`command code emitter should emit \`waitForElementNotEditable\` command 1`] = `"WebDriverWait(self.driver, 5).until_not(expected_conditions.element_to_be_clickable((By.CSS_SELECTOR, \\"#blah\\")))"`;
|
|
354
354
|
|
|
355
|
-
exports[`command code emitter should emit \`waitForElementNotPresent\` command 1`] = `"WebDriverWait(self.driver,
|
|
355
|
+
exports[`command code emitter should emit \`waitForElementNotPresent\` command 1`] = `"WebDriverWait(self.driver, 5).until(expected_conditions.invisibility_of_element_located((By.CSS_SELECTOR, \\"#blah\\")))"`;
|
|
356
356
|
|
|
357
|
-
exports[`command code emitter should emit \`waitForElementNotVisible\` command 1`] = `"WebDriverWait(self.driver,
|
|
357
|
+
exports[`command code emitter should emit \`waitForElementNotVisible\` command 1`] = `"WebDriverWait(self.driver, 5).until(expected_conditions.invisibility_of_element_located((By.CSS_SELECTOR, \\"#blah\\")))"`;
|
|
358
358
|
|
|
359
|
-
exports[`command code emitter should emit \`waitForElementPresent\` command 1`] = `"WebDriverWait(self.driver,
|
|
359
|
+
exports[`command code emitter should emit \`waitForElementPresent\` command 1`] = `"WebDriverWait(self.driver, 5).until(expected_conditions.presence_of_element_located((By.CSS_SELECTOR, \\"#blah\\")))"`;
|
|
360
360
|
|
|
361
|
-
exports[`command code emitter should emit \`waitForElementVisible\` command 1`] = `"WebDriverWait(self.driver,
|
|
361
|
+
exports[`command code emitter should emit \`waitForElementVisible\` command 1`] = `"WebDriverWait(self.driver, 5).until(expected_conditions.visibility_of_element_located((By.CSS_SELECTOR, \\"#blah\\")))"`;
|
|
362
|
+
|
|
363
|
+
exports[`command code emitter should emit \`waitForText\` command 1`] = `"WebDriverWait(self.driver, 30).until(expected_conditions.text_to_be_present_in_element((By.CSS_SELECTOR, \\"#blah\\"), \\"text\\"))"`;
|
|
362
364
|
|
|
363
365
|
exports[`command code emitter should emit \`while\` command 1`] = `
|
|
364
366
|
Object {
|
|
@@ -127,7 +127,7 @@ from selenium.webdriver.support.wait import WebDriverWait
|
|
|
127
127
|
from selenium.webdriver.common.keys import Keys
|
|
128
128
|
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
|
|
129
129
|
|
|
130
|
-
class
|
|
130
|
+
class TestReusedmethods():
|
|
131
131
|
def setup_method(self, method):
|
|
132
132
|
self.driver = webdriver.Chrome()
|
|
133
133
|
self.vars = {}
|
|
@@ -140,7 +140,11 @@ class TestLogin():
|
|
|
140
140
|
self.driver.find_element(By.LINK_TEXT, \\"Form Authentication\\").click()
|
|
141
141
|
self.driver.find_element(By.ID, \\"username\\").send_keys(self.vars[\\"username\\"])
|
|
142
142
|
self.driver.find_element(By.ID, \\"password\\").send_keys(self.vars[\\"password\\"])
|
|
143
|
-
self.driver.
|
|
143
|
+
if self.driver.execute_script(\\"return (true)\\"):
|
|
144
|
+
self.driver.find_element(By.CSS_SELECTOR, \\".fa\\").click()
|
|
145
|
+
|
|
146
|
+
def tinymethod(self):
|
|
147
|
+
self.vars[\\"value\\"] = \\"field\\"
|
|
144
148
|
|
|
145
149
|
def test_invalidcredentials(self):
|
|
146
150
|
self.vars[\\"username\\"] = \\"blah\\"
|
|
@@ -152,6 +156,12 @@ class TestLogin():
|
|
|
152
156
|
self.vars[\\"password\\"] = \\"SuperSecretPassword!\\"
|
|
153
157
|
self.login()
|
|
154
158
|
|
|
159
|
+
def test_twomethods(self):
|
|
160
|
+
self.vars[\\"username\\"] = \\"blah\\"
|
|
161
|
+
self.vars[\\"password\\"] = \\"blah\\"
|
|
162
|
+
self.login()
|
|
163
|
+
self.tinymethod()
|
|
164
|
+
|
|
155
165
|
"
|
|
156
166
|
`;
|
|
157
167
|
|
|
@@ -305,7 +315,8 @@ class TestValidcredentials():
|
|
|
305
315
|
self.driver.find_element(By.LINK_TEXT, \\"Form Authentication\\").click()
|
|
306
316
|
self.driver.find_element(By.ID, \\"username\\").send_keys(self.vars[\\"username\\"])
|
|
307
317
|
self.driver.find_element(By.ID, \\"password\\").send_keys(self.vars[\\"password\\"])
|
|
308
|
-
self.driver.
|
|
318
|
+
if self.driver.execute_script(\\"return (true)\\"):
|
|
319
|
+
self.driver.find_element(By.CSS_SELECTOR, \\".fa\\").click()
|
|
309
320
|
|
|
310
321
|
def test_validcredentials(self):
|
|
311
322
|
self.vars[\\"username\\"] = \\"tomsmith\\"
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
ControlFlowCommandNames,
|
|
22
22
|
} from '../../../selenium-ide/src/neo/models/Command'
|
|
23
23
|
import { opts } from '../../src/index'
|
|
24
|
-
import { codeExport as exporter } from '@seleniumhq/side-
|
|
24
|
+
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
25
25
|
|
|
26
26
|
const commandPrefixPadding = opts.commandPrefixPadding
|
|
27
27
|
|
|
@@ -272,7 +272,7 @@ describe('command code emitter', () => {
|
|
|
272
272
|
it('should emit `echo` command with variables', () => {
|
|
273
273
|
const command = {
|
|
274
274
|
command: 'echo',
|
|
275
|
-
target: '${blah}',
|
|
275
|
+
target: 'blah = ${blah}',
|
|
276
276
|
value: '',
|
|
277
277
|
}
|
|
278
278
|
return expect(prettify(command)).resolves.toMatchSnapshot()
|
|
@@ -839,6 +839,14 @@ describe('command code emitter', () => {
|
|
|
839
839
|
}
|
|
840
840
|
return expect(prettify(command)).resolves.toMatchSnapshot()
|
|
841
841
|
})
|
|
842
|
+
it('should emit `waitForText` command', () => {
|
|
843
|
+
const command = {
|
|
844
|
+
command: 'waitForText',
|
|
845
|
+
target: 'css=#blah',
|
|
846
|
+
value: 'text',
|
|
847
|
+
}
|
|
848
|
+
return expect(prettify(command)).resolves.toMatchSnapshot()
|
|
849
|
+
})
|
|
842
850
|
it('should emit `answer on visible prompt` command', () => {
|
|
843
851
|
const command = {
|
|
844
852
|
command: 'webdriverAnswerOnVisiblePrompt',
|
|
@@ -17,8 +17,14 @@
|
|
|
17
17
|
|
|
18
18
|
import fs from 'fs'
|
|
19
19
|
import path from 'path'
|
|
20
|
-
import
|
|
21
|
-
|
|
20
|
+
import codeExport, {
|
|
21
|
+
emitTest,
|
|
22
|
+
emitSuite,
|
|
23
|
+
_emitMethod,
|
|
24
|
+
_findTestByName,
|
|
25
|
+
} from '../../src'
|
|
26
|
+
import Command from '../../src/command'
|
|
27
|
+
import { project as projectProcessor } from '@seleniumhq/side-code-export'
|
|
22
28
|
|
|
23
29
|
function readFile(filename) {
|
|
24
30
|
return JSON.parse(
|
|
@@ -28,7 +34,7 @@ function readFile(filename) {
|
|
|
28
34
|
'..',
|
|
29
35
|
'..',
|
|
30
36
|
'..',
|
|
31
|
-
'side-
|
|
37
|
+
'side-code-export',
|
|
32
38
|
'__test__',
|
|
33
39
|
'test-files',
|
|
34
40
|
filename
|
|
@@ -132,6 +138,9 @@ describe('Code Export Python pytest', () => {
|
|
|
132
138
|
expect(results.body).toBeDefined()
|
|
133
139
|
expect(results.body).toMatchSnapshot()
|
|
134
140
|
})
|
|
141
|
+
it('should export the command emitter', () => {
|
|
142
|
+
expect(Command.emit).toStrictEqual(codeExport.emit.command)
|
|
143
|
+
})
|
|
135
144
|
})
|
|
136
145
|
|
|
137
146
|
function normalizeProject(project) {
|
|
@@ -35,6 +35,13 @@ describe('selection location code emitter', () => {
|
|
|
35
35
|
`By.XPATH, "//option[. = '${selector}']"`
|
|
36
36
|
)
|
|
37
37
|
})
|
|
38
|
+
it('should emit label locator with variable', () => {
|
|
39
|
+
const type = 'label'
|
|
40
|
+
const selector = 'self.vars["label"]'
|
|
41
|
+
return expect(emit(`${type}=${selector}`)).resolves.toEqual(
|
|
42
|
+
`By.XPATH, "//option[. = '{}']".format(${selector})`
|
|
43
|
+
)
|
|
44
|
+
})
|
|
38
45
|
it('should emit id locator', () => {
|
|
39
46
|
const type = 'id'
|
|
40
47
|
const selector = 'someId'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seleniumhq/code-export-python-pytest",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.4",
|
|
4
4
|
"description": "Export Selenium IDE project contents to Python pytest",
|
|
5
5
|
"repository": "https://github.com/SeleniumHQ/selenium-ide",
|
|
6
6
|
"keywords": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@babel/preset-env": "^7.4.5"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@seleniumhq/side-
|
|
24
|
+
"@seleniumhq/side-code-export": "^4.0.0-alpha.0"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "351d5762ed774d624831bf9a7a02ae4fb8e70ea9"
|
|
27
27
|
}
|
package/src/command.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
import { codeExport as exporter } from '@seleniumhq/side-
|
|
18
|
+
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
19
19
|
import location from './location'
|
|
20
20
|
import selection from './selection'
|
|
21
21
|
|
|
@@ -113,6 +113,7 @@ export const emitters = {
|
|
|
113
113
|
waitForElementNotPresent: emitWaitForElementNotPresent,
|
|
114
114
|
waitForElementNotVisible: emitWaitForElementNotVisible,
|
|
115
115
|
webdriverAnswerOnVisiblePrompt: emitAnswerOnNextPrompt,
|
|
116
|
+
waitForText: emitWaitForText,
|
|
116
117
|
webdriverChooseCancelOnVisibleConfirmation: emitChooseCancelOnNextConfirmation,
|
|
117
118
|
webdriverChooseCancelOnVisiblePrompt: emitChooseCancelOnNextConfirmation,
|
|
118
119
|
webdriverChooseOkOnVisibleConfirmation: emitChooseOkOnNextConfirmation,
|
|
@@ -380,9 +381,21 @@ async function emitDragAndDrop(dragged, dropped) {
|
|
|
380
381
|
return Promise.resolve({ commands })
|
|
381
382
|
}
|
|
382
383
|
|
|
384
|
+
function translateToPythonString(str) {
|
|
385
|
+
const regExp = /self.vars\["\w+"]/
|
|
386
|
+
const vars = str.match(regExp)
|
|
387
|
+
|
|
388
|
+
if (vars && vars.length > 0) {
|
|
389
|
+
const fmtStr = str.replace(regExp, '{}')
|
|
390
|
+
return `"${fmtStr}".format(${vars.join(', ')})`
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return `"${str}"`
|
|
394
|
+
}
|
|
395
|
+
|
|
383
396
|
async function emitEcho(message) {
|
|
384
|
-
const _message = message
|
|
385
|
-
return Promise.resolve(`print(
|
|
397
|
+
const _message = translateToPythonString(message)
|
|
398
|
+
return Promise.resolve(`print(${_message})`)
|
|
386
399
|
}
|
|
387
400
|
|
|
388
401
|
async function emitEditContent(locator, content) {
|
|
@@ -484,7 +497,8 @@ function emitOpen(target) {
|
|
|
484
497
|
}
|
|
485
498
|
|
|
486
499
|
async function emitPause(time) {
|
|
487
|
-
const
|
|
500
|
+
const sec = time / 1000
|
|
501
|
+
const commands = [{ level: 0, statement: `time.sleep(${sec})` }]
|
|
488
502
|
return Promise.resolve({ commands })
|
|
489
503
|
}
|
|
490
504
|
|
|
@@ -854,10 +868,11 @@ async function emitVerifyTitle(title) {
|
|
|
854
868
|
}
|
|
855
869
|
|
|
856
870
|
async function emitWaitForElementEditable(locator, timeout) {
|
|
871
|
+
const sec = timeout / 1000
|
|
857
872
|
const commands = [
|
|
858
873
|
{
|
|
859
874
|
level: 0,
|
|
860
|
-
statement: `WebDriverWait(self.driver, ${
|
|
875
|
+
statement: `WebDriverWait(self.driver, ${sec}).until(expected_conditions.element_to_be_clickable((${await location.emit(
|
|
861
876
|
locator
|
|
862
877
|
)})))`,
|
|
863
878
|
},
|
|
@@ -865,15 +880,30 @@ async function emitWaitForElementEditable(locator, timeout) {
|
|
|
865
880
|
return Promise.resolve({ commands })
|
|
866
881
|
}
|
|
867
882
|
|
|
883
|
+
async function emitWaitForText(locator, text) {
|
|
884
|
+
const timeout = 30000
|
|
885
|
+
const sec = timeout / 1000
|
|
886
|
+
const commands = [
|
|
887
|
+
{
|
|
888
|
+
level: 0,
|
|
889
|
+
statement: `WebDriverWait(self.driver, ${sec}).until(expected_conditions.text_to_be_present_in_element((${await location.emit(
|
|
890
|
+
locator
|
|
891
|
+
)}), "${text}"))`,
|
|
892
|
+
},
|
|
893
|
+
]
|
|
894
|
+
return Promise.resolve({ commands })
|
|
895
|
+
}
|
|
896
|
+
|
|
868
897
|
function skip() {
|
|
869
898
|
return Promise.resolve(undefined)
|
|
870
899
|
}
|
|
871
900
|
|
|
872
901
|
async function emitWaitForElementPresent(locator, timeout) {
|
|
902
|
+
const sec = timeout / 1000
|
|
873
903
|
const commands = [
|
|
874
904
|
{
|
|
875
905
|
level: 0,
|
|
876
|
-
statement: `WebDriverWait(self.driver, ${
|
|
906
|
+
statement: `WebDriverWait(self.driver, ${sec}).until(expected_conditions.presence_of_element_located((${await location.emit(
|
|
877
907
|
locator
|
|
878
908
|
)})))`,
|
|
879
909
|
},
|
|
@@ -882,10 +912,11 @@ async function emitWaitForElementPresent(locator, timeout) {
|
|
|
882
912
|
}
|
|
883
913
|
|
|
884
914
|
async function emitWaitForElementVisible(locator, timeout) {
|
|
915
|
+
const sec = timeout / 1000
|
|
885
916
|
const commands = [
|
|
886
917
|
{
|
|
887
918
|
level: 0,
|
|
888
|
-
statement: `WebDriverWait(self.driver, ${
|
|
919
|
+
statement: `WebDriverWait(self.driver, ${sec}).until(expected_conditions.visibility_of_element_located((${await location.emit(
|
|
889
920
|
locator
|
|
890
921
|
)})))`,
|
|
891
922
|
},
|
|
@@ -896,10 +927,11 @@ async function emitWaitForElementVisible(locator, timeout) {
|
|
|
896
927
|
}
|
|
897
928
|
|
|
898
929
|
async function emitWaitForElementNotEditable(locator, timeout) {
|
|
930
|
+
const sec = timeout / 1000
|
|
899
931
|
const commands = [
|
|
900
932
|
{
|
|
901
933
|
level: 0,
|
|
902
|
-
statement: `WebDriverWait(self.driver, ${
|
|
934
|
+
statement: `WebDriverWait(self.driver, ${sec}).until_not(expected_conditions.element_to_be_clickable((${await location.emit(
|
|
903
935
|
locator
|
|
904
936
|
)})))`,
|
|
905
937
|
},
|
|
@@ -910,10 +942,11 @@ async function emitWaitForElementNotEditable(locator, timeout) {
|
|
|
910
942
|
}
|
|
911
943
|
|
|
912
944
|
async function emitWaitForElementNotPresent(locator, timeout) {
|
|
945
|
+
const sec = timeout / 1000
|
|
913
946
|
const commands = [
|
|
914
947
|
{
|
|
915
948
|
level: 0,
|
|
916
|
-
statement: `WebDriverWait(self.driver, ${
|
|
949
|
+
statement: `WebDriverWait(self.driver, ${sec}).until(expected_conditions.invisibility_of_element_located((${await location.emit(
|
|
917
950
|
locator
|
|
918
951
|
)})))`,
|
|
919
952
|
},
|
|
@@ -924,10 +957,11 @@ async function emitWaitForElementNotPresent(locator, timeout) {
|
|
|
924
957
|
}
|
|
925
958
|
|
|
926
959
|
async function emitWaitForElementNotVisible(locator, timeout) {
|
|
960
|
+
const sec = timeout / 1000
|
|
927
961
|
const commands = [
|
|
928
962
|
{
|
|
929
963
|
level: 0,
|
|
930
|
-
statement: `WebDriverWait(self.driver, ${
|
|
964
|
+
statement: `WebDriverWait(self.driver, ${sec}).until(expected_conditions.invisibility_of_element_located((${await location.emit(
|
|
931
965
|
locator
|
|
932
966
|
)})))`,
|
|
933
967
|
},
|
package/src/hook.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// KIND, either express or implied. See the License for the specific language governing permissions and limitations
|
|
15
15
|
// under the License.
|
|
16
16
|
|
|
17
|
-
import { codeExport as exporter } from '@seleniumhq/side-
|
|
17
|
+
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
18
18
|
|
|
19
19
|
const emitters = {
|
|
20
20
|
afterAll,
|
package/src/index.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
import { codeExport as exporter } from '@seleniumhq/side-
|
|
18
|
+
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
19
19
|
import emitter from './command'
|
|
20
20
|
import location from './location'
|
|
21
21
|
import { generateHooks } from './hook'
|
|
@@ -62,6 +62,7 @@ export async function emitTest({
|
|
|
62
62
|
project,
|
|
63
63
|
enableOriginTracing,
|
|
64
64
|
beforeEachOptions,
|
|
65
|
+
enableDescriptionAsComment,
|
|
65
66
|
}) {
|
|
66
67
|
global.baseUrl = baseUrl
|
|
67
68
|
const testDeclaration = generateTestDeclaration(test.name)
|
|
@@ -69,6 +70,7 @@ export async function emitTest({
|
|
|
69
70
|
...opts,
|
|
70
71
|
testDeclaration,
|
|
71
72
|
enableOriginTracing,
|
|
73
|
+
enableDescriptionAsComment,
|
|
72
74
|
project,
|
|
73
75
|
})
|
|
74
76
|
const suiteName = test.name
|
|
@@ -94,10 +96,12 @@ export async function emitSuite({
|
|
|
94
96
|
project,
|
|
95
97
|
enableOriginTracing,
|
|
96
98
|
beforeEachOptions,
|
|
99
|
+
enableDescriptionAsComment,
|
|
97
100
|
}) {
|
|
98
101
|
global.baseUrl = baseUrl
|
|
99
102
|
const result = await exporter.emit.testsFromSuite(tests, suite, opts, {
|
|
100
103
|
enableOriginTracing,
|
|
104
|
+
enableDescriptionAsComment,
|
|
101
105
|
generateTestDeclaration,
|
|
102
106
|
project,
|
|
103
107
|
})
|
|
@@ -120,6 +124,7 @@ export default {
|
|
|
120
124
|
test: emitTest,
|
|
121
125
|
suite: emitSuite,
|
|
122
126
|
locator: location.emit,
|
|
127
|
+
command: emitter.emit,
|
|
123
128
|
},
|
|
124
129
|
register: {
|
|
125
130
|
command: emitter.register,
|
package/src/location.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
import { codeExport as exporter } from '@seleniumhq/side-
|
|
18
|
+
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
19
19
|
|
|
20
20
|
const emitters = {
|
|
21
21
|
id: emitId,
|
package/src/selection.js
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// specific language governing permissions and limitations
|
|
16
16
|
// under the License.
|
|
17
17
|
|
|
18
|
-
import { codeExport as exporter } from '@seleniumhq/side-
|
|
18
|
+
import { codeExport as exporter } from '@seleniumhq/side-code-export'
|
|
19
19
|
|
|
20
20
|
const emitters = {
|
|
21
21
|
id: emitId,
|
|
@@ -41,6 +41,9 @@ function emitValue(value) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function emitLabel(label) {
|
|
44
|
+
if (label.startsWith('self.vars[')) {
|
|
45
|
+
return Promise.resolve(`By.XPATH, "//option[. = '{}']".format(${label})`)
|
|
46
|
+
}
|
|
44
47
|
return Promise.resolve(`By.XPATH, "//option[. = '${label}']"`)
|
|
45
48
|
}
|
|
46
49
|
|