@seleniumhq/code-export-python-pytest 3.17.2 → 4.0.0-alpha.0

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/dist/index.js CHANGED
@@ -1,138 +1,120 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.emitTest = emitTest;
7
- exports.emitSuite = emitSuite;
8
- exports.default = exports.opts = exports.displayName = void 0;
9
-
10
- var _sideUtils = require("@seleniumhq/side-utils");
11
-
12
- var _command = _interopRequireDefault(require("./command"));
13
-
14
- var _location = _interopRequireDefault(require("./location"));
15
-
16
- var _hook = require("./hook");
17
-
18
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
- function _objectSpread2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
21
-
22
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
-
2
+ // Licensed to the Software Freedom Conservancy (SFC) under one
3
+ // or more contributor license agreements. See the NOTICE file
4
+ // distributed with this work for additional information
5
+ // regarding copyright ownership. The SFC licenses this file
6
+ // to you under the Apache License, Version 2.0 (the
7
+ // "License"); you may not use this file except in compliance
8
+ // with the License. You may obtain a copy of the License at
9
+ //
10
+ // http://www.apache.org/licenses/LICENSE-2.0
11
+ //
12
+ // Unless required by applicable law or agreed to in writing,
13
+ // software distributed under the License is distributed on an
14
+ // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ // KIND, either express or implied. See the License for the
16
+ // specific language governing permissions and limitations
17
+ // under the License.
18
+ var __importDefault = (this && this.__importDefault) || function (mod) {
19
+ return (mod && mod.__esModule) ? mod : { "default": mod };
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ exports.opts = exports.displayName = void 0;
23
+ const side_code_export_1 = require("@seleniumhq/side-code-export");
24
+ const command_1 = __importDefault(require("./command"));
25
+ const location_1 = __importDefault(require("./location"));
26
+ const hook_1 = __importDefault(require("./hook"));
24
27
  // Define language options
25
- const displayName = 'Python pytest';
26
- exports.displayName = displayName;
27
- let opts = {};
28
- exports.opts = opts;
29
- opts.emitter = _command.default;
30
- opts.hooks = (0, _hook.generateHooks)();
31
- opts.fileExtension = '.py';
32
- opts.commandPrefixPadding = ' ';
33
- opts.terminatingKeyword = '';
34
- opts.commentPrefix = '#';
35
- opts.generateMethodDeclaration = generateMethodDeclaration; // Create generators for dynamic string creation of primary entities (e.g., filename, methods, test, and suite)
36
-
37
- function generateTestDeclaration(name) {
38
- return `def test_${_sideUtils.codeExport.parsers.uncapitalize(_sideUtils.codeExport.parsers.sanitizeName(name))}(self):`;
39
- }
40
-
41
- function generateMethodDeclaration(name) {
42
- return `def ${_sideUtils.codeExport.parsers.uncapitalize(_sideUtils.codeExport.parsers.sanitizeName(name))}(self):`;
43
- }
44
-
45
- function generateSuiteDeclaration(name) {
46
- return `class Test${_sideUtils.codeExport.parsers.capitalize(_sideUtils.codeExport.parsers.sanitizeName(name))}():`;
47
- }
48
-
49
- function generateFilename(name) {
50
- return `test_${_sideUtils.codeExport.parsers.uncapitalize(_sideUtils.codeExport.parsers.sanitizeName(name))}${opts.fileExtension}`;
51
- } // Emit an individual test, wrapped in a suite (using the test name as the suite name)
52
-
53
-
54
- async function emitTest({
55
- baseUrl,
56
- test,
57
- tests,
58
- project,
59
- enableOriginTracing,
60
- beforeEachOptions,
61
- enableDescriptionAsComment
62
- }) {
63
- global.baseUrl = baseUrl;
64
- const testDeclaration = generateTestDeclaration(test.name);
65
- const result = await _sideUtils.codeExport.emit.test(test, tests, _objectSpread2({}, opts, {
66
- testDeclaration,
67
- enableOriginTracing,
68
- enableDescriptionAsComment,
69
- project
70
- }));
71
- const suiteName = test.name;
72
- const suiteDeclaration = generateSuiteDeclaration(suiteName);
73
-
74
- const _suite = await _sideUtils.codeExport.emit.suite(result, tests, _objectSpread2({}, opts, {
75
- suiteDeclaration,
76
- suiteName,
77
- project,
78
- beforeEachOptions
79
- }));
80
-
81
- return {
82
- filename: generateFilename(test.name),
83
- body: _sideUtils.codeExport.emit.orderedSuite(_suite)
84
- };
85
- } // Emit a suite with all of its tests
86
-
87
-
88
- async function emitSuite({
89
- baseUrl,
90
- suite,
91
- tests,
92
- project,
93
- enableOriginTracing,
94
- beforeEachOptions,
95
- enableDescriptionAsComment
96
- }) {
97
- global.baseUrl = baseUrl;
98
- const result = await _sideUtils.codeExport.emit.testsFromSuite(tests, suite, opts, {
99
- enableOriginTracing,
100
- enableDescriptionAsComment,
101
- generateTestDeclaration,
102
- project
103
- });
104
- const suiteDeclaration = generateSuiteDeclaration(suite.name);
105
-
106
- const _suite = await _sideUtils.codeExport.emit.suite(result, tests, _objectSpread2({}, opts, {
107
- suiteDeclaration,
108
- suite,
109
- project,
110
- beforeEachOptions
111
- }));
112
-
113
- return {
114
- filename: generateFilename(suite.name),
115
- body: _sideUtils.codeExport.emit.orderedSuite(_suite)
116
- };
117
- }
118
-
119
- var _default = {
120
- emit: {
121
- test: emitTest,
122
- suite: emitSuite,
123
- locator: _location.default.emit,
124
- command: _command.default.emit
125
- },
126
- register: {
127
- command: _command.default.register,
128
- variable: opts.hooks.declareVariables.register,
129
- dependency: opts.hooks.declareDependencies.register,
130
- beforeAll: opts.hooks.beforeAll.register,
131
- beforeEach: opts.hooks.beforeEach.register,
132
- afterEach: opts.hooks.afterEach.register,
133
- afterAll: opts.hooks.afterAll.register,
134
- inEachBegin: opts.hooks.inEachBegin.register,
135
- inEachEnd: opts.hooks.inEachEnd.register
136
- }
28
+ exports.displayName = 'Python pytest';
29
+ exports.opts = {
30
+ emitter: command_1.default,
31
+ displayName: exports.displayName,
32
+ name: 'python-pytest',
33
+ hooks: (0, side_code_export_1.generateHooks)(hook_1.default),
34
+ fileExtension: '.py',
35
+ commandPrefixPadding: ' ',
36
+ terminatingKeyword: '',
37
+ commentPrefix: '#',
38
+ // Create generators for dynamic string creation of primary entities (e.g., filename, methods, test, and suite)
39
+ generateTestDeclaration: function generateTestDeclaration(name) {
40
+ return `def test_${side_code_export_1.codeExport.parsers.uncapitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}(self):`;
41
+ },
42
+ generateMethodDeclaration: function generateMethodDeclaration(name) {
43
+ return `def ${side_code_export_1.codeExport.parsers.uncapitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}(self):`;
44
+ },
45
+ generateSuiteDeclaration: function generateSuiteDeclaration(name) {
46
+ return `class Test${side_code_export_1.codeExport.parsers.capitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}():`;
47
+ },
48
+ generateFilename: function generateFilename(name) {
49
+ return `test_${side_code_export_1.codeExport.parsers.uncapitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}${exports.opts.fileExtension}`;
50
+ },
51
+ };
52
+ const language = {
53
+ emit: {
54
+ locator: location_1.default.emit,
55
+ command: command_1.default.emit,
56
+ suite: async function emitSuite({ baseUrl, suite, tests, project, enableOriginTracing, beforeEachOptions, enableDescriptionAsComment, }) {
57
+ // @ts-expect-error globals yuck
58
+ global.baseUrl = baseUrl;
59
+ const result = await side_code_export_1.codeExport.emit.testsFromSuite(tests, suite, exports.opts, {
60
+ enableOriginTracing,
61
+ generateTestDeclaration: exports.opts.generateTestDeclaration,
62
+ enableDescriptionAsComment,
63
+ project,
64
+ });
65
+ const suiteDeclaration = exports.opts.generateSuiteDeclaration(suite.name);
66
+ const _suite = await side_code_export_1.codeExport.emit.suite(result, tests, {
67
+ ...exports.opts,
68
+ suiteDeclaration,
69
+ suite,
70
+ suiteName: suite.name,
71
+ project,
72
+ beforeEachOptions,
73
+ });
74
+ return {
75
+ filename: exports.opts.generateFilename(suite.name),
76
+ body: side_code_export_1.codeExport.emit.orderedSuite(_suite),
77
+ };
78
+ },
79
+ // Emit an individual test, wrapped in a suite (using the test name as the suite name)
80
+ test: async function emitTest({ baseUrl, test, tests, project, enableOriginTracing, beforeEachOptions, enableDescriptionAsComment, }) {
81
+ // @ts-expect-error globals yuck
82
+ global.baseUrl = baseUrl;
83
+ const testDeclaration = exports.opts.generateTestDeclaration(test.name);
84
+ const result = await side_code_export_1.codeExport.emit.test(test, tests, {
85
+ ...exports.opts,
86
+ testDeclaration,
87
+ enableOriginTracing,
88
+ enableDescriptionAsComment,
89
+ project,
90
+ });
91
+ const suiteName = test.name;
92
+ const suiteDeclaration = exports.opts.generateSuiteDeclaration(suiteName);
93
+ const _suite = await side_code_export_1.codeExport.emit.suite(result, tests, {
94
+ ...exports.opts,
95
+ suiteDeclaration,
96
+ suiteName,
97
+ project,
98
+ beforeEachOptions,
99
+ });
100
+ return {
101
+ filename: exports.opts.generateFilename(test.name),
102
+ body: side_code_export_1.codeExport.emit.orderedSuite(_suite),
103
+ };
104
+ },
105
+ },
106
+ opts: exports.opts,
107
+ register: {
108
+ command: command_1.default.register,
109
+ variable: exports.opts.hooks.declareVariables.register,
110
+ dependency: exports.opts.hooks.declareDependencies.register,
111
+ beforeAll: exports.opts.hooks.beforeAll.register,
112
+ beforeEach: exports.opts.hooks.beforeEach.register,
113
+ afterEach: exports.opts.hooks.afterEach.register,
114
+ afterAll: exports.opts.hooks.afterAll.register,
115
+ inEachBegin: exports.opts.hooks.inEachBegin.register,
116
+ inEachEnd: exports.opts.hooks.inEachEnd.register,
117
+ },
137
118
  };
138
- exports.default = _default;
119
+ exports.default = language;
120
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,w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CAAC,QAAQ;QACxC,QAAQ,EAAE,YAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ;QACtC,WAAW,EAAE,YAAI,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ;QAC5C,SAAS,EAAE,YAAI,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ;KACzC;CACF,CAAA;AAED,kBAAe,QAAQ,CAAA"}
@@ -0,0 +1,6 @@
1
+ export declare function emit(location: string): Promise<string>;
2
+ declare const _default: {
3
+ emit: typeof emit;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../src/location.ts"],"names":[],"mappings":"AA6BA,wBAAgB,IAAI,CAAC,QAAQ,EAAE,MAAM,mBAEpC;;;;AAED,wBAEC"}
package/dist/location.js CHANGED
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.emit = emit;
7
- exports.default = void 0;
8
-
9
- var _sideUtils = require("@seleniumhq/side-utils");
10
-
11
2
  // Licensed to the Software Freedom Conservancy (SFC) under one
12
3
  // or more contributor license agreements. See the NOTICE file
13
4
  // distributed with this work for additional information
@@ -24,45 +15,41 @@ var _sideUtils = require("@seleniumhq/side-utils");
24
15
  // KIND, either express or implied. See the License for the
25
16
  // specific language governing permissions and limitations
26
17
  // under the License.
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.emit = void 0;
20
+ const side_code_export_1 = require("@seleniumhq/side-code-export");
27
21
  const emitters = {
28
- id: emitId,
29
- name: emitName,
30
- link: emitLink,
31
- linkText: emitLink,
32
- partialLinkText: emitPartialLinkText,
33
- css: emitCss,
34
- xpath: emitXpath
22
+ id: emitId,
23
+ name: emitName,
24
+ link: emitLink,
25
+ linkText: emitLink,
26
+ partialLinkText: emitPartialLinkText,
27
+ css: emitCss,
28
+ xpath: emitXpath,
35
29
  };
36
-
37
30
  function emit(location) {
38
- return _sideUtils.codeExport.emit.location(location, emitters);
31
+ return side_code_export_1.codeExport.emit.location(location, emitters);
39
32
  }
40
-
41
- var _default = {
42
- emit
33
+ exports.emit = emit;
34
+ exports.default = {
35
+ emit,
43
36
  };
44
- exports.default = _default;
45
-
46
37
  function emitId(selector) {
47
- return Promise.resolve(`By.ID, "${selector}"`);
38
+ return Promise.resolve(`By.ID, "${selector}"`);
48
39
  }
49
-
50
40
  function emitName(selector) {
51
- return Promise.resolve(`By.NAME, "${selector}"`);
41
+ return Promise.resolve(`By.NAME, "${selector}"`);
52
42
  }
53
-
54
43
  function emitLink(selector) {
55
- return Promise.resolve(`By.LINK_TEXT, "${selector}"`);
44
+ return Promise.resolve(`By.LINK_TEXT, "${selector}"`);
56
45
  }
57
-
58
46
  function emitPartialLinkText(selector) {
59
- return Promise.resolve(`By.PARTIAL_LINK_TEXT, "${selector}"`);
47
+ return Promise.resolve(`By.PARTIAL_LINK_TEXT, "${selector}"`);
60
48
  }
61
-
62
49
  function emitCss(selector) {
63
- return Promise.resolve(`By.CSS_SELECTOR, "${selector}"`);
50
+ return Promise.resolve(`By.CSS_SELECTOR, "${selector}"`);
64
51
  }
65
-
66
52
  function emitXpath(selector) {
67
- return Promise.resolve(`By.XPATH, "${selector}"`);
68
- }
53
+ return Promise.resolve(`By.XPATH, "${selector}"`);
54
+ }
55
+ //# sourceMappingURL=location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.js","sourceRoot":"","sources":["../src/location.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;;;AAErB,mEAAqE;AAErE,MAAM,QAAQ,GAAG;IACf,EAAE,EAAE,MAAM;IACV,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,QAAQ;IAClB,eAAe,EAAE,mBAAmB;IACpC,GAAG,EAAE,OAAO;IACZ,KAAK,EAAE,SAAS;CACjB,CAAA;AAED,SAAgB,IAAI,CAAC,QAAgB;IACnC,OAAO,6BAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACnD,CAAC;AAFD,oBAEC;AAED,kBAAe;IACb,IAAI;CACL,CAAA;AAED,SAAS,MAAM,CAAC,QAAgB;IAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,WAAW,QAAQ,GAAG,CAAC,CAAA;AAChD,CAAC;AAED,SAAS,QAAQ,CAAC,QAAgB;IAChC,OAAO,OAAO,CAAC,OAAO,CAAC,aAAa,QAAQ,GAAG,CAAC,CAAA;AAClD,CAAC;AAED,SAAS,QAAQ,CAAC,QAAgB;IAChC,OAAO,OAAO,CAAC,OAAO,CAAC,kBAAkB,QAAQ,GAAG,CAAC,CAAA;AACvD,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgB;IAC3C,OAAO,OAAO,CAAC,OAAO,CAAC,0BAA0B,QAAQ,GAAG,CAAC,CAAA;AAC/D,CAAC;AAED,SAAS,OAAO,CAAC,QAAgB;IAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,qBAAqB,QAAQ,GAAG,CAAC,CAAA;AAC1D,CAAC;AAED,SAAS,SAAS,CAAC,QAAgB;IACjC,OAAO,OAAO,CAAC,OAAO,CAAC,cAAc,QAAQ,GAAG,CAAC,CAAA;AACnD,CAAC"}
@@ -0,0 +1,6 @@
1
+ export declare function emit(location: string): Promise<string>;
2
+ declare const _default: {
3
+ emit: typeof emit;
4
+ };
5
+ export default _default;
6
+ //# sourceMappingURL=selection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.d.ts","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":"AA0BA,wBAAgB,IAAI,CAAC,QAAQ,EAAE,MAAM,mBAEpC;;;;AAED,wBAEC"}
package/dist/selection.js CHANGED
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.emit = emit;
7
- exports.default = void 0;
8
-
9
- var _sideUtils = require("@seleniumhq/side-utils");
10
-
11
2
  // Licensed to the Software Freedom Conservancy (SFC) under one
12
3
  // or more contributor license agreements. See the NOTICE file
13
4
  // distributed with this work for additional information
@@ -24,38 +15,35 @@ var _sideUtils = require("@seleniumhq/side-utils");
24
15
  // KIND, either express or implied. See the License for the
25
16
  // specific language governing permissions and limitations
26
17
  // under the License.
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.emit = void 0;
20
+ const side_code_export_1 = require("@seleniumhq/side-code-export");
27
21
  const emitters = {
28
- id: emitId,
29
- value: emitValue,
30
- label: emitLabel,
31
- index: emitIndex
22
+ id: emitId,
23
+ value: emitValue,
24
+ label: emitLabel,
25
+ index: emitIndex,
32
26
  };
33
-
34
27
  function emit(location) {
35
- return _sideUtils.codeExport.emit.selection(location, emitters);
28
+ return side_code_export_1.codeExport.emit.selection(location, emitters);
36
29
  }
37
-
38
- var _default = {
39
- emit
30
+ exports.emit = emit;
31
+ exports.default = {
32
+ emit,
40
33
  };
41
- exports.default = _default;
42
-
43
34
  function emitId(id) {
44
- return Promise.resolve(`By.CSS_SELECTOR, "*[id='${id}']"`);
35
+ return Promise.resolve(`By.CSS_SELECTOR, "*[id='${id}']"`);
45
36
  }
46
-
47
37
  function emitValue(value) {
48
- return Promise.resolve(`By.CSS_SELECTOR, "*[value='${value}']"`);
38
+ return Promise.resolve(`By.CSS_SELECTOR, "*[value='${value}']"`);
49
39
  }
50
-
51
40
  function emitLabel(label) {
52
- if (label.startsWith('self.vars[')) {
53
- return Promise.resolve(`By.XPATH, "//option[. = '{}']".format(${label})`);
54
- }
55
-
56
- return Promise.resolve(`By.XPATH, "//option[. = '${label}']"`);
41
+ if (label.startsWith('self.vars[')) {
42
+ return Promise.resolve(`By.XPATH, "//option[. = '{}']".format(${label})`);
43
+ }
44
+ return Promise.resolve(`By.XPATH, "//option[. = '${label}']"`);
57
45
  }
58
-
59
46
  function emitIndex(index) {
60
- return Promise.resolve(`By.CSS_SELECTOR, "*:nth-child(${index})"`);
61
- }
47
+ return Promise.resolve(`By.CSS_SELECTOR, "*:nth-child(${index})"`);
48
+ }
49
+ //# sourceMappingURL=selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selection.js","sourceRoot":"","sources":["../src/selection.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,+DAA+D;AAC/D,wDAAwD;AACxD,6DAA6D;AAC7D,oDAAoD;AACpD,6DAA6D;AAC7D,6DAA6D;AAC7D,EAAE;AACF,+CAA+C;AAC/C,EAAE;AACF,6DAA6D;AAC7D,8DAA8D;AAC9D,yDAAyD;AACzD,4DAA4D;AAC5D,0DAA0D;AAC1D,qBAAqB;;;AAErB,mEAAqE;AAErE,MAAM,QAAQ,GAAG;IACf,EAAE,EAAE,MAAM;IACV,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;CACjB,CAAA;AAED,SAAgB,IAAI,CAAC,QAAgB;IACnC,OAAO,6BAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;AACpD,CAAC;AAFD,oBAEC;AAED,kBAAe;IACb,IAAI;CACL,CAAA;AAED,SAAS,MAAM,CAAC,EAAU;IACxB,OAAO,OAAO,CAAC,OAAO,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAA;AAC5D,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,8BAA8B,KAAK,KAAK,CAAC,CAAA;AAClE,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,IAAI,KAAK,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;QAClC,OAAO,OAAO,CAAC,OAAO,CAAC,yCAAyC,KAAK,GAAG,CAAC,CAAA;KAC1E;IACD,OAAO,OAAO,CAAC,OAAO,CAAC,4BAA4B,KAAK,KAAK,CAAC,CAAA;AAChE,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,OAAO,CAAC,OAAO,CAAC,iCAAiC,KAAK,IAAI,CAAC,CAAA;AACpE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seleniumhq/code-export-python-pytest",
3
- "version": "3.17.2",
3
+ "version": "4.0.0-alpha.0",
4
4
  "description": "Export Selenium IDE project contents to Python pytest",
5
5
  "repository": "https://github.com/SeleniumHQ/selenium-ide",
6
6
  "keywords": [
@@ -9,18 +9,17 @@
9
9
  "export"
10
10
  ],
11
11
  "license": "Apache-2.0",
12
- "private": false,
13
- "scripts": {
14
- "build": "babel -d dist src --ignore=__test__",
15
- "watch": "yarn build -w"
16
- },
17
12
  "main": "dist/index.js",
13
+ "dependencies": {
14
+ "@seleniumhq/side-code-export": "^4.0.0-alpha.2"
15
+ },
18
16
  "devDependencies": {
19
- "@babel/cli": "^7.4.4",
20
- "@babel/plugin-proposal-object-rest-spread": "^7.4.4",
21
- "@babel/preset-env": "^7.4.5"
17
+ "@seleniumhq/side-model": "^4.0.0-alpha.2"
22
18
  },
23
- "dependencies": {
24
- "@seleniumhq/side-utils": "^3.17.2"
19
+ "gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744",
20
+ "scripts": {
21
+ "build": "tsc",
22
+ "clean": "rm -rf dist tsconfig.tsbuildinfo node_modules",
23
+ "watch": "tsc --watch"
25
24
  }
26
- }
25
+ }