@seleniumhq/code-export-csharp-xunit 3.17.4 → 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.
@@ -0,0 +1,24 @@
1
+ import { CommandShape } from '@seleniumhq/side-model';
2
+ declare function emit(command: CommandShape): Promise<import("@seleniumhq/side-code-export").ExportFlexCommandShape>;
3
+ declare const _default: {
4
+ emit: typeof emit;
5
+ emitters: {
6
+ [x: string]: import("@seleniumhq/side-code-export").ProcessedCommandEmitter;
7
+ };
8
+ variableLookup: (varName: string) => string;
9
+ variableSetter: (varName: string, value: string) => string;
10
+ register: (command: string, emitter: import("@seleniumhq/side-code-export").PrebuildEmitter) => void;
11
+ extras: {
12
+ emitWaitForWindow: () => Promise<{
13
+ name: string;
14
+ commands: {
15
+ level: number;
16
+ statement: string;
17
+ }[];
18
+ generateMethodDeclaration: (name: string) => string;
19
+ }>;
20
+ emitNewWindowHandling: (command: CommandShape, emittedCommand: import("@seleniumhq/side-code-export").ExportFlexCommandShape) => Promise<string>;
21
+ };
22
+ };
23
+ export default _default;
24
+ //# sourceMappingURL=command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAMrD,iBAAS,IAAI,CAAC,OAAO,EAAE,YAAY,0EAKlC;;;;;;;;;;;;;;;;;;;;;AAkOD,wBAIC"}
@@ -0,0 +1,195 @@
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ const code_export_csharp_commons_1 = require("@seleniumhq/code-export-csharp-commons");
20
+ const side_code_export_1 = require("@seleniumhq/side-code-export");
21
+ const emitters = { ...code_export_csharp_commons_1.Command.emitters };
22
+ side_code_export_1.codeExport.register.preprocessors(emitters);
23
+ function emit(command) {
24
+ return side_code_export_1.codeExport.emit.command(command, emitters[command.command], {
25
+ variableLookup: code_export_csharp_commons_1.Command.variableLookup,
26
+ emitNewWindowHandling: code_export_csharp_commons_1.Command.extras.emitNewWindowHandling,
27
+ });
28
+ }
29
+ emitters.assert = emitAssert;
30
+ emitters.verify = emitAssert;
31
+ function emitAssert(varName, value) {
32
+ return Promise.resolve(`Assert.Equal(vars["${varName}"].ToString(), "${value}");`);
33
+ }
34
+ emitters.assertAlert = emitAssertAlert;
35
+ emitters.assertConfirmation = emitAssertAlert;
36
+ emitters.assertPrompt = emitAssertAlert;
37
+ function emitAssertAlert(AlertText) {
38
+ return Promise.resolve(`Assert.Equal(driver.SwitchTo().Alert().Text, "${AlertText}");`);
39
+ }
40
+ emitters.assertChecked = emitVerifyChecked;
41
+ emitters.verifyChecked = emitVerifyChecked;
42
+ async function emitVerifyChecked(locator) {
43
+ return Promise.resolve(`Assert.True(driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)}).Selected);`);
44
+ }
45
+ emitters.assertEditable = emitVerifyEditable;
46
+ emitters.verifyEditable = emitVerifyEditable;
47
+ async function emitVerifyEditable(locator) {
48
+ const commands = [
49
+ { level: 0, statement: '{' },
50
+ {
51
+ level: 1,
52
+ statement: `var element = driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)});`,
53
+ },
54
+ {
55
+ level: 1,
56
+ statement: 'Boolean isEditable = element.Enabled && element.GetAttribute("readonly") == null;',
57
+ },
58
+ { level: 1, statement: 'Assert.True(isEditable);' },
59
+ { level: 0, statement: '}' },
60
+ ];
61
+ return Promise.resolve({ commands });
62
+ }
63
+ emitters.assertElementPresent = emitVerifyElementPresent;
64
+ emitters.verifyElementPresent = emitVerifyElementPresent;
65
+ async function emitVerifyElementPresent(locator) {
66
+ const commands = [
67
+ { level: 0, statement: '{' },
68
+ {
69
+ level: 1,
70
+ statement: `IReadOnlyCollection<IWebElement> elements = driver.FindElements(${await code_export_csharp_commons_1.location.emit(locator)});`,
71
+ },
72
+ { level: 1, statement: 'Assert.True(elements.Count > 0);' },
73
+ { level: 0, statement: '}' },
74
+ ];
75
+ return Promise.resolve({ commands });
76
+ }
77
+ emitters.assertElementNotPresent = emitVerifyElementNotPresent;
78
+ emitters.verifyElementNotPresent = emitVerifyElementNotPresent;
79
+ async function emitVerifyElementNotPresent(locator) {
80
+ const commands = [
81
+ { level: 0, statement: '{' },
82
+ {
83
+ level: 1,
84
+ statement: `IReadOnlyCollection<IWebElement> elements = driver.FindElements(${await code_export_csharp_commons_1.location.emit(locator)});`,
85
+ },
86
+ { level: 1, statement: 'Assert.True(elements.Count == 0);' },
87
+ { level: 0, statement: '}' },
88
+ ];
89
+ return Promise.resolve({ commands });
90
+ }
91
+ emitters.assertNotChecked = emitVerifyNotChecked;
92
+ emitters.verifyNotChecked = emitVerifyNotChecked;
93
+ async function emitVerifyNotChecked(locator) {
94
+ return Promise.resolve(`Assert.False(driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)}).Selected);`);
95
+ }
96
+ emitters.assertNotEditable = emitVerifyNotEditable;
97
+ emitters.verifyNotEdtiable = emitVerifyNotEditable;
98
+ async function emitVerifyNotEditable(locator) {
99
+ const commands = [
100
+ { level: 0, statement: '{' },
101
+ {
102
+ level: 1,
103
+ statement: `var element = driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)});`,
104
+ },
105
+ {
106
+ level: 1,
107
+ statement: 'Boolean isEditable = element.Enabled && element.GetAttribute("readonly") == null;',
108
+ },
109
+ { level: 1, statement: 'Assert.False(isEditable);' },
110
+ { level: 0, statement: '}' },
111
+ ];
112
+ return Promise.resolve({ commands });
113
+ }
114
+ emitters.assertNotSelectedValue = emitVerifyNotSelectedValue;
115
+ emitters.verifyNotSelectedValue = emitVerifyNotSelectedValue;
116
+ async function emitVerifyNotSelectedValue(locator, expectedValue) {
117
+ const commands = [
118
+ { level: 0, statement: '{' },
119
+ {
120
+ level: 1,
121
+ statement: `String value = driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)}).GetAttribute("value");`,
122
+ },
123
+ {
124
+ level: 1,
125
+ statement: `Assert.NotEqual(value, ${side_code_export_1.codeExport.emit.text(expectedValue)});`,
126
+ },
127
+ { level: 0, statement: '}' },
128
+ ];
129
+ return Promise.resolve({ commands });
130
+ }
131
+ emitters.assertNotText = emitVerifyNotText;
132
+ emitters.verifyNotText = emitVerifyNotText;
133
+ async function emitVerifyNotText(locator, text) {
134
+ const result = `driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)}).Text`;
135
+ return Promise.resolve(`Assert.NotEqual(${result}, "${side_code_export_1.codeExport.emit.text(text)}");`);
136
+ }
137
+ emitters.assertSelectedLabel = emitVerifySelectedLabel;
138
+ emitters.verifySelectedLabel = emitVerifySelectedLabel;
139
+ async function emitVerifySelectedLabel(locator, labelValue) {
140
+ const commands = [
141
+ { level: 0, statement: '{' },
142
+ {
143
+ level: 1,
144
+ statement: `var element = driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)});`,
145
+ },
146
+ { level: 1, statement: 'String value = element.GetAttribute("value");' },
147
+ {
148
+ level: 1,
149
+ statement: `String locator = String.Format("option[@value='%s']", "value");`,
150
+ },
151
+ {
152
+ level: 1,
153
+ statement: 'String selectedText = element.FindElement(By.XPath(locator)).Text;',
154
+ },
155
+ {
156
+ level: 1,
157
+ statement: `Assert.Equal(selectedText, "${labelValue}");`,
158
+ },
159
+ { level: 0, statement: '}' },
160
+ ];
161
+ return Promise.resolve({
162
+ commands,
163
+ });
164
+ }
165
+ emitters.assertSelectedValue = emitVerifyValue;
166
+ emitters.verifySelectedValue = emitVerifyValue;
167
+ emitters.assertValue = emitVerifyValue;
168
+ async function emitVerifyValue(locator, value) {
169
+ const commands = [
170
+ { level: 0, statement: '{' },
171
+ {
172
+ level: 1,
173
+ statement: `String value = driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)}).GetAttribute("value");`,
174
+ },
175
+ { level: 1, statement: `Assert.Equal(value, "${value}");` },
176
+ { level: 0, statement: '}' },
177
+ ];
178
+ return Promise.resolve({ commands });
179
+ }
180
+ emitters.assertText = emitVerifyText;
181
+ emitters.verifyText = emitVerifyText;
182
+ async function emitVerifyText(locator, text) {
183
+ return Promise.resolve(`Assert.Equal(driver.FindElement(${await code_export_csharp_commons_1.location.emit(locator)}).Text, "${side_code_export_1.codeExport.emit.text(text)}");`);
184
+ }
185
+ emitters.assertTitle = emitVerifyTitle;
186
+ emitters.verifyTitle = emitVerifyTitle;
187
+ async function emitVerifyTitle(title) {
188
+ return Promise.resolve(`Assert.Equal(driver.Title, "${title}");`);
189
+ }
190
+ exports.default = {
191
+ ...code_export_csharp_commons_1.Command,
192
+ emit,
193
+ emitters,
194
+ };
195
+ //# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.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,uFAA0E;AAC1E,mEAAqE;AAGrE,MAAM,QAAQ,GAAG,EAAE,GAAG,oCAAO,CAAC,QAAQ,EAA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AAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAC3C,CAAA;AACH,CAAC;AAED,QAAQ,CAAC,WAAW,GAAG,eAAe,CAAA;AACtC,QAAQ,CAAC,WAAW,GAAG,eAAe,CAAA;AAEtC,KAAK,UAAU,eAAe,CAAC,KAAa;IAC1C,OAAO,OAAO,CAAC,OAAO,CAAC,+BAA+B,KAAK,KAAK,CAAC,CAAA;AACnE,CAAC;AAED,kBAAe;IACb,GAAG,oCAAO;IACV,IAAI;IACJ,QAAQ;CACT,CAAA"}
package/dist/hook.d.ts ADDED
@@ -0,0 +1,46 @@
1
+ import { HookFunctionInputs } from '@seleniumhq/side-code-export';
2
+ export declare const emitters: {
3
+ readonly afterAll: typeof empty;
4
+ readonly afterEach: typeof afterEach;
5
+ readonly beforeAll: typeof empty;
6
+ readonly beforeEach: typeof beforeEach;
7
+ readonly declareDependencies: typeof declareDependencies;
8
+ readonly declareMethods: typeof empty;
9
+ readonly declareVariables: typeof declareVariables;
10
+ readonly inEachBegin: typeof empty;
11
+ readonly inEachEnd: typeof empty;
12
+ };
13
+ export default emitters;
14
+ declare function beforeEach(): HookFunctionInputs;
15
+ declare function afterEach(): {
16
+ startingSyntax: {
17
+ commands: {
18
+ level: number;
19
+ statement: string;
20
+ }[];
21
+ };
22
+ endingSyntax: {
23
+ commands: {
24
+ level: number;
25
+ statement: string;
26
+ }[];
27
+ };
28
+ };
29
+ declare function declareDependencies(): {
30
+ startingSyntax: {
31
+ commands: {
32
+ level: number;
33
+ statement: string;
34
+ }[];
35
+ };
36
+ };
37
+ declare function declareVariables(): {
38
+ startingSyntax: {
39
+ commands: {
40
+ level: number;
41
+ statement: string;
42
+ }[];
43
+ };
44
+ };
45
+ declare function empty(): {};
46
+ //# sourceMappingURL=hook.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hook.d.ts","sourceRoot":"","sources":["../src/hook.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAA;AAEjE,eAAO,MAAM,QAAQ;;;;;;;;;;CAUX,CAAA;AAEV,eAAe,QAAQ,CAAC;AAExB,iBAAS,UAAU,uBA6BlB;AAED,iBAAS,SAAS;;;;;;;;;;;;;EAcjB;AAED,iBAAS,mBAAmB;;;;;;;EAmB3B;AAED,iBAAS,gBAAgB;;;;;;;EAiBxB;AAED,iBAAS,KAAK,OAEb"}
package/dist/hook.js ADDED
@@ -0,0 +1,116 @@
1
+ "use strict";
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
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.emitters = void 0;
20
+ exports.emitters = {
21
+ afterAll: empty,
22
+ afterEach,
23
+ beforeAll: empty,
24
+ beforeEach,
25
+ declareDependencies,
26
+ declareMethods: empty,
27
+ declareVariables,
28
+ inEachBegin: empty,
29
+ inEachEnd: empty,
30
+ };
31
+ exports.default = exports.emitters;
32
+ function beforeEach() {
33
+ const params = {
34
+ startingSyntax: ({ browserName, gridUrl } = {}) => ({
35
+ commands: [
36
+ { level: 0, statement: `public SuiteTests()` },
37
+ { level: 0, statement: `{` },
38
+ {
39
+ level: 1,
40
+ statement: gridUrl
41
+ ? `driver = new RemoteWebDriver(new Uri("${gridUrl}"), new ${browserName ? browserName : 'Chrome'}Options().ToCapabilities());`
42
+ : `driver = new ${browserName ? browserName : 'Chrome'}Driver();`,
43
+ },
44
+ {
45
+ level: 1,
46
+ statement: `js = (IJavaScriptExecutor)driver;`,
47
+ },
48
+ {
49
+ level: 1,
50
+ statement: `vars = new Dictionary<String, Object>();`,
51
+ },
52
+ ],
53
+ }),
54
+ endingSyntax: {
55
+ commands: [{ level: 0, statement: '}' }],
56
+ },
57
+ };
58
+ return params;
59
+ }
60
+ function afterEach() {
61
+ const params = {
62
+ startingSyntax: {
63
+ commands: [
64
+ { level: 0, statement: `public void Dispose()` },
65
+ { level: 0, statement: `{` },
66
+ { level: 1, statement: `driver.Quit();` },
67
+ ],
68
+ },
69
+ endingSyntax: {
70
+ commands: [{ level: 0, statement: '}' }],
71
+ },
72
+ };
73
+ return params;
74
+ }
75
+ function declareDependencies() {
76
+ const params = {
77
+ startingSyntax: {
78
+ commands: [
79
+ { level: 0, statement: `using System;` },
80
+ { level: 0, statement: `using System.Collections.Generic;` },
81
+ { level: 0, statement: `using System.Linq;` },
82
+ { level: 0, statement: 'using System.Threading;' },
83
+ { level: 0, statement: `using OpenQA.Selenium;` },
84
+ { level: 0, statement: `using OpenQA.Selenium.Chrome;` },
85
+ { level: 0, statement: `using OpenQA.Selenium.Firefox;` },
86
+ { level: 0, statement: `using OpenQA.Selenium.Remote;` },
87
+ { level: 0, statement: `using OpenQA.Selenium.Support.UI;` },
88
+ { level: 0, statement: `using OpenQA.Selenium.Interactions;` },
89
+ { level: 0, statement: `using Xunit;` },
90
+ ],
91
+ },
92
+ };
93
+ return params;
94
+ }
95
+ function declareVariables() {
96
+ const params = {
97
+ startingSyntax: {
98
+ commands: [
99
+ { level: 0, statement: `public IWebDriver driver {get; private set;}` },
100
+ {
101
+ level: 0,
102
+ statement: `public IDictionary<String, Object> vars {get; private set;}`,
103
+ },
104
+ {
105
+ level: 0,
106
+ statement: `public IJavaScriptExecutor js {get; private set;}`,
107
+ },
108
+ ],
109
+ },
110
+ };
111
+ return params;
112
+ }
113
+ function empty() {
114
+ return {};
115
+ }
116
+ //# s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,EAAE,mCAAmC,EAAE;gBAC5D,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,qCAAqC,EAAE;gBAC9D,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE;aACxC;SACF;KACF,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,gBAAgB;IACvB,MAAM,MAAM,GAAG;QACb,cAAc,EAAE;YACd,QAAQ,EAAE;gBACR,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,8CAA8C,EAAE;gBACvE;oBACE,KAAK,EAAE,CAAC;oBACR,SAAS,EAAE,6DAA6D;iBACzE;gBACD;oBACE,KAAK,EAAE,CAAC;oBACR,SAAS,EAAE,mDAAmD;iBAC/D;aACF;SACF;KACF,CAAA;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,EAAE,CAAA;AACX,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { LanguageEmitter, LanguageEmitterOpts } from '@seleniumhq/side-code-export';
2
+ export declare const displayName = "C# xUnit";
3
+ export declare const opts: LanguageEmitterOpts;
4
+ declare const language: LanguageEmitter;
5
+ export default language;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAiBA,OAAO,EAGL,eAAe,EACf,mBAAmB,EACpB,MAAM,8BAA8B,CAAA;AAMrC,eAAO,MAAM,WAAW,aAAa,CAAA;AAErC,eAAO,MAAM,IAAI,EAAE,mBA0BlB,CAAA;AAED,QAAA,MAAM,QAAQ,EAAE,eA2Ef,CAAA;AA0CD,eAAe,QAAQ,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,151 @@
1
+ "use strict";
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 hook_1 = __importDefault(require("./hook"));
26
+ const code_export_csharp_commons_1 = require("@seleniumhq/code-export-csharp-commons");
27
+ // Define language options
28
+ exports.displayName = 'C# xUnit';
29
+ exports.opts = {
30
+ emitter: command_1.default,
31
+ displayName: exports.displayName,
32
+ name: 'csharp-xunit',
33
+ hooks: (0, side_code_export_1.generateHooks)(hook_1.default),
34
+ fileExtension: '.cs',
35
+ commandPrefixPadding: ' ',
36
+ terminatingKeyword: '}',
37
+ commentPrefix: '//',
38
+ generateFilename: (name) => {
39
+ return `${side_code_export_1.codeExport.parsers.capitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}Test${exports.opts.fileExtension}`;
40
+ },
41
+ generateMethodDeclaration: (name) => {
42
+ return `public void ${side_code_export_1.codeExport.parsers.sanitizeName(name)}() \n{`;
43
+ },
44
+ generateTestDeclaration: (name) => {
45
+ return `[Fact]\npublic void ${side_code_export_1.codeExport.parsers.capitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}() {`;
46
+ },
47
+ generateSuiteDeclaration: () => {
48
+ return `public class SuiteTests : IDisposable {`;
49
+ },
50
+ };
51
+ const language = {
52
+ emit: {
53
+ test: async function emitTest({ test, tests, project, enableOriginTracing, beforeEachOptions, enableDescriptionAsComment, }) {
54
+ const testDeclaration = exports.opts.generateTestDeclaration(test.name);
55
+ const result = await side_code_export_1.codeExport.emit.test(test, tests, {
56
+ ...exports.opts,
57
+ testDeclaration,
58
+ enableOriginTracing,
59
+ enableDescriptionAsComment,
60
+ project,
61
+ });
62
+ const suiteName = test.name;
63
+ const suiteDeclaration = exports.opts.generateSuiteDeclaration(suiteName);
64
+ var _suite = await side_code_export_1.codeExport.emit.suite(result, tests, {
65
+ ...exports.opts,
66
+ suiteDeclaration,
67
+ suiteName,
68
+ project,
69
+ beforeEachOptions,
70
+ });
71
+ return {
72
+ filename: exports.opts.generateFilename(test.name),
73
+ body: side_code_export_1.codeExport.emit.orderedSuite(_suite),
74
+ };
75
+ },
76
+ suite: async function emitSuite({ suite, tests, project, enableOriginTracing, beforeEachOptions, enableDescriptionAsComment, }) {
77
+ const result = await side_code_export_1.codeExport.emit.testsFromSuite(tests, suite, exports.opts, {
78
+ enableOriginTracing,
79
+ enableDescriptionAsComment,
80
+ generateTestDeclaration: exports.opts.generateTestDeclaration,
81
+ project,
82
+ });
83
+ const suiteDeclaration = exports.opts.generateSuiteDeclaration(suite.name);
84
+ var _suite = await side_code_export_1.codeExport.emit.suite(result, tests, {
85
+ ...exports.opts,
86
+ suiteDeclaration,
87
+ suite,
88
+ suiteName: suite.name,
89
+ project,
90
+ beforeEachOptions,
91
+ });
92
+ return {
93
+ filename: exports.opts.generateFilename(suite.name),
94
+ body: emitOrderedSuite(_suite, suite.name),
95
+ };
96
+ },
97
+ locator: code_export_csharp_commons_1.location.emit,
98
+ command: command_1.default.emit,
99
+ },
100
+ opts: exports.opts,
101
+ register: {
102
+ command: command_1.default.register,
103
+ variable: exports.opts.hooks.declareVariables.register,
104
+ dependency: exports.opts.hooks.declareDependencies.register,
105
+ beforeAll: exports.opts.hooks.beforeAll.register,
106
+ beforeEach: exports.opts.hooks.beforeEach.register,
107
+ afterEach: exports.opts.hooks.afterEach.register,
108
+ afterAll: exports.opts.hooks.afterAll.register,
109
+ inEachBegin: exports.opts.hooks.inEachBegin.register,
110
+ inEachEnd: exports.opts.hooks.inEachEnd.register,
111
+ },
112
+ };
113
+ function generateNamespace(name) {
114
+ return `namespace ${side_code_export_1.codeExport.parsers.capitalize(side_code_export_1.codeExport.parsers.sanitizeName(name))}\n{\n`;
115
+ }
116
+ function emitOrderedSuite(emittedSuite, name) {
117
+ let result = '';
118
+ result += emittedSuite.headerComment;
119
+ result += emittedSuite.dependencies;
120
+ result += `${generateNamespace(name)}`;
121
+ result += emittedSuite.suiteDeclaration;
122
+ result += emittedSuite.variables;
123
+ //result += emittedSuite.beforeAll
124
+ result += emittedSuite.beforeEach;
125
+ result += emittedSuite.afterEach;
126
+ //result += emittedSuite.afterAll
127
+ result += emittedSuite.methods;
128
+ if (emittedSuite.tests.testDeclaration) {
129
+ const test = emittedSuite.tests;
130
+ result += test.testDeclaration;
131
+ result += test.inEachBegin;
132
+ result += test.commands;
133
+ result += test.inEachEnd;
134
+ result += test.testEnd;
135
+ }
136
+ else {
137
+ for (const testName in emittedSuite.tests) {
138
+ const test = emittedSuite.tests[testName];
139
+ result += test.testDeclaration;
140
+ result += test.inEachBegin;
141
+ result += test.commands;
142
+ result += test.inEachEnd;
143
+ result += test.testEnd;
144
+ }
145
+ }
146
+ result += emittedSuite.suiteEnd;
147
+ result += '}'; // terminate namespace
148
+ return result;
149
+ }
150
+ exports.default = language;
151
+ //# 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,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;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-xunit",
3
- "version": "3.17.4",
3
+ "version": "4.0.0-alpha.0",
4
4
  "description": "Export Selenium IDE project contents to C# XUnit",
5
5
  "repository": "https://github.com/SeleniumHQ/selenium-ide",
6
6
  "keywords": [
@@ -9,20 +9,19 @@
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",
18
- "devDependencies": {
19
- "@babel/cli": "^7.4.4",
20
- "@babel/plugin-proposal-object-rest-spread": "^7.4.4",
21
- "@babel/preset-env": "^7.4.5"
22
- },
13
+ "types": "dist/index.d.ts",
23
14
  "dependencies": {
24
- "@seleniumhq/code-export-csharp-commons": "^3.17.4",
25
- "@seleniumhq/side-code-export": "^4.0.0-alpha.0"
15
+ "@seleniumhq/code-export-csharp-commons": "^4.0.0-alpha.0",
16
+ "@seleniumhq/side-code-export": "^4.0.0-alpha.1"
26
17
  },
27
- "gitHead": "351d5762ed774d624831bf9a7a02ae4fb8e70ea9"
28
- }
18
+ "devDependencies": {
19
+ "@seleniumhq/side-model": "^4.0.0-alpha.2"
20
+ },
21
+ "gitHead": "f58e327e7616e23a3e926e4b80cf9952164e5744",
22
+ "scripts": {
23
+ "build": "tsc --build --verbose",
24
+ "clean": "rm -rf dist tsconfig.tsbuildinfo node_modules",
25
+ "watch": "tsc --watch"
26
+ }
27
+ }
@@ -15,31 +15,25 @@
15
15
  // specific language governing permissions and limitations
16
16
  // under the License.
17
17
 
18
- import { codeExport as exporter } from '@seleniumhq/side-code-export'
19
18
  import { Command, location } from '@seleniumhq/code-export-csharp-commons'
19
+ import { codeExport as exporter } from '@seleniumhq/side-code-export'
20
+ import { CommandShape } from '@seleniumhq/side-model'
21
+
20
22
  const emitters = { ...Command.emitters }
21
23
 
22
24
  exporter.register.preprocessors(emitters)
23
25
 
24
- function register(command, emitter) {
25
- exporter.register.emitter({ command, emitter, emitters: emitters })
26
- }
27
-
28
- function emit(command) {
26
+ function emit(command: CommandShape) {
29
27
  return exporter.emit.command(command, emitters[command.command], {
30
28
  variableLookup: Command.variableLookup,
31
29
  emitNewWindowHandling: Command.extras.emitNewWindowHandling,
32
30
  })
33
31
  }
34
32
 
35
- function canEmit(commandName) {
36
- return !!emitters[commandName]
37
- }
38
-
39
33
  emitters.assert = emitAssert
40
34
  emitters.verify = emitAssert
41
35
 
42
- function emitAssert(varName, value) {
36
+ function emitAssert(varName: string, value: string) {
43
37
  return Promise.resolve(
44
38
  `Assert.Equal(vars["${varName}"].ToString(), "${value}");`
45
39
  )
@@ -49,7 +43,7 @@ emitters.assertAlert = emitAssertAlert
49
43
  emitters.assertConfirmation = emitAssertAlert
50
44
  emitters.assertPrompt = emitAssertAlert
51
45
 
52
- function emitAssertAlert(AlertText) {
46
+ function emitAssertAlert(AlertText: string) {
53
47
  return Promise.resolve(
54
48
  `Assert.Equal(driver.SwitchTo().Alert().Text, "${AlertText}");`
55
49
  )
@@ -58,7 +52,7 @@ function emitAssertAlert(AlertText) {
58
52
  emitters.assertChecked = emitVerifyChecked
59
53
  emitters.verifyChecked = emitVerifyChecked
60
54
 
61
- async function emitVerifyChecked(locator) {
55
+ async function emitVerifyChecked(locator: string) {
62
56
  return Promise.resolve(
63
57
  `Assert.True(driver.FindElement(${await location.emit(locator)}).Selected);`
64
58
  )
@@ -67,7 +61,7 @@ async function emitVerifyChecked(locator) {
67
61
  emitters.assertEditable = emitVerifyEditable
68
62
  emitters.verifyEditable = emitVerifyEditable
69
63
 
70
- async function emitVerifyEditable(locator) {
64
+ async function emitVerifyEditable(locator: string) {
71
65
  const commands = [
72
66
  { level: 0, statement: '{' },
73
67
  {
@@ -90,7 +84,7 @@ async function emitVerifyEditable(locator) {
90
84
  emitters.assertElementPresent = emitVerifyElementPresent
91
85
  emitters.verifyElementPresent = emitVerifyElementPresent
92
86
 
93
- async function emitVerifyElementPresent(locator) {
87
+ async function emitVerifyElementPresent(locator: string) {
94
88
  const commands = [
95
89
  { level: 0, statement: '{' },
96
90
  {
@@ -108,7 +102,7 @@ async function emitVerifyElementPresent(locator) {
108
102
  emitters.assertElementNotPresent = emitVerifyElementNotPresent
109
103
  emitters.verifyElementNotPresent = emitVerifyElementNotPresent
110
104
 
111
- async function emitVerifyElementNotPresent(locator) {
105
+ async function emitVerifyElementNotPresent(locator: string) {
112
106
  const commands = [
113
107
  { level: 0, statement: '{' },
114
108
  {
@@ -126,7 +120,7 @@ async function emitVerifyElementNotPresent(locator) {
126
120
  emitters.assertNotChecked = emitVerifyNotChecked
127
121
  emitters.verifyNotChecked = emitVerifyNotChecked
128
122
 
129
- async function emitVerifyNotChecked(locator) {
123
+ async function emitVerifyNotChecked(locator: string) {
130
124
  return Promise.resolve(
131
125
  `Assert.False(driver.FindElement(${await location.emit(
132
126
  locator
@@ -137,7 +131,7 @@ async function emitVerifyNotChecked(locator) {
137
131
  emitters.assertNotEditable = emitVerifyNotEditable
138
132
  emitters.verifyNotEdtiable = emitVerifyNotEditable
139
133
 
140
- async function emitVerifyNotEditable(locator) {
134
+ async function emitVerifyNotEditable(locator: string) {
141
135
  const commands = [
142
136
  { level: 0, statement: '{' },
143
137
  {
@@ -160,7 +154,7 @@ async function emitVerifyNotEditable(locator) {
160
154
  emitters.assertNotSelectedValue = emitVerifyNotSelectedValue
161
155
  emitters.verifyNotSelectedValue = emitVerifyNotSelectedValue
162
156
 
163
- async function emitVerifyNotSelectedValue(locator, expectedValue) {
157
+ async function emitVerifyNotSelectedValue(locator: string, expectedValue: string) {
164
158
  const commands = [
165
159
  { level: 0, statement: '{' },
166
160
  {
@@ -183,7 +177,7 @@ async function emitVerifyNotSelectedValue(locator, expectedValue) {
183
177
  emitters.assertNotText = emitVerifyNotText
184
178
  emitters.verifyNotText = emitVerifyNotText
185
179
 
186
- async function emitVerifyNotText(locator, text) {
180
+ async function emitVerifyNotText(locator: string, text: string) {
187
181
  const result = `driver.FindElement(${await location.emit(locator)}).Text`
188
182
  return Promise.resolve(
189
183
  `Assert.NotEqual(${result}, "${exporter.emit.text(text)}");`
@@ -193,7 +187,7 @@ async function emitVerifyNotText(locator, text) {
193
187
  emitters.assertSelectedLabel = emitVerifySelectedLabel
194
188
  emitters.verifySelectedLabel = emitVerifySelectedLabel
195
189
 
196
- async function emitVerifySelectedLabel(locator, labelValue) {
190
+ async function emitVerifySelectedLabel(locator: string, labelValue: string) {
197
191
  const commands = [
198
192
  { level: 0, statement: '{' },
199
193
  {
@@ -227,7 +221,7 @@ emitters.assertSelectedValue = emitVerifyValue
227
221
  emitters.verifySelectedValue = emitVerifyValue
228
222
  emitters.assertValue = emitVerifyValue
229
223
 
230
- async function emitVerifyValue(locator, value) {
224
+ async function emitVerifyValue(locator: string, value: string) {
231
225
  const commands = [
232
226
  { level: 0, statement: '{' },
233
227
  {
@@ -245,7 +239,7 @@ async function emitVerifyValue(locator, value) {
245
239
  emitters.assertText = emitVerifyText
246
240
  emitters.verifyText = emitVerifyText
247
241
 
248
- async function emitVerifyText(locator, text) {
242
+ async function emitVerifyText(locator: string, text: string) {
249
243
  return Promise.resolve(
250
244
  `Assert.Equal(driver.FindElement(${await location.emit(
251
245
  locator
@@ -256,13 +250,12 @@ async function emitVerifyText(locator, text) {
256
250
  emitters.assertTitle = emitVerifyTitle
257
251
  emitters.verifyTitle = emitVerifyTitle
258
252
 
259
- async function emitVerifyTitle(title) {
253
+ async function emitVerifyTitle(title: string) {
260
254
  return Promise.resolve(`Assert.Equal(driver.Title, "${title}");`)
261
255
  }
262
256
 
263
257
  export default {
264
- canEmit,
258
+ ...Command,
265
259
  emit,
266
- register,
267
- extras: { emitWaitForWindow: Command.extras.emitWaitForWindow },
260
+ emitters,
268
261
  }
@@ -15,9 +15,9 @@
15
15
  // specific language governing permissions and limitations
16
16
  // under the License.
17
17
 
18
- import { codeExport as exporter } from '@seleniumhq/side-code-export'
18
+ import { HookFunctionInputs } from '@seleniumhq/side-code-export'
19
19
 
20
- const emitters = {
20
+ export const emitters = {
21
21
  afterAll: empty,
22
22
  afterEach,
23
23
  beforeAll: empty,
@@ -27,22 +27,12 @@ const emitters = {
27
27
  declareVariables,
28
28
  inEachBegin: empty,
29
29
  inEachEnd: empty,
30
- }
30
+ } as const
31
31
 
32
- function generate(hookName) {
33
- return new exporter.hook(emitters[hookName]())
34
- }
35
-
36
- export function generateHooks() {
37
- let result = {}
38
- Object.keys(emitters).forEach(hookName => {
39
- result[hookName] = generate(hookName)
40
- })
41
- return result
42
- }
32
+ export default emitters;
43
33
 
44
34
  function beforeEach() {
45
- const params = {
35
+ const params: HookFunctionInputs = {
46
36
  startingSyntax: ({ browserName, gridUrl } = {}) => ({
47
37
  commands: [
48
38
  { level: 0, statement: `public SuiteTests()` },
package/src/index.ts ADDED
@@ -0,0 +1,176 @@
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
+ import {
19
+ codeExport as exporter,
20
+ generateHooks,
21
+ LanguageEmitter,
22
+ LanguageEmitterOpts,
23
+ } from '@seleniumhq/side-code-export'
24
+ import emitter from './command'
25
+ import hooks from './hook'
26
+ import { location } from '@seleniumhq/code-export-csharp-commons'
27
+
28
+ // Define language options
29
+ export const displayName = 'C# xUnit'
30
+
31
+ export const opts: LanguageEmitterOpts = {
32
+ emitter: emitter,
33
+ displayName,
34
+ name: 'csharp-xunit',
35
+ hooks: generateHooks(hooks),
36
+ fileExtension: '.cs',
37
+ commandPrefixPadding: ' ',
38
+ terminatingKeyword: '}',
39
+ commentPrefix: '//',
40
+ generateFilename: (name) => {
41
+ return `${exporter.parsers.capitalize(
42
+ exporter.parsers.sanitizeName(name)
43
+ )}Test${opts.fileExtension}`
44
+ },
45
+
46
+ generateMethodDeclaration: (name) => {
47
+ return `public void ${exporter.parsers.sanitizeName(name)}() \n{`
48
+ },
49
+ generateTestDeclaration: (name) => {
50
+ return `[Fact]\npublic void ${exporter.parsers.capitalize(
51
+ exporter.parsers.sanitizeName(name)
52
+ )}() {`
53
+ },
54
+ generateSuiteDeclaration: () => {
55
+ return `public class SuiteTests : IDisposable {`
56
+ },
57
+ }
58
+
59
+ const language: LanguageEmitter = {
60
+ emit: {
61
+ test: async function emitTest({
62
+ test,
63
+ tests,
64
+ project,
65
+ enableOriginTracing,
66
+ beforeEachOptions,
67
+ enableDescriptionAsComment,
68
+ }) {
69
+ const testDeclaration = opts.generateTestDeclaration(test.name)
70
+ const result = await exporter.emit.test(test, tests, {
71
+ ...opts,
72
+ testDeclaration,
73
+ enableOriginTracing,
74
+ enableDescriptionAsComment,
75
+ project,
76
+ })
77
+ const suiteName = test.name
78
+ const suiteDeclaration = opts.generateSuiteDeclaration(suiteName)
79
+ var _suite = await exporter.emit.suite(result, tests, {
80
+ ...opts,
81
+ suiteDeclaration,
82
+ suiteName,
83
+ project,
84
+ beforeEachOptions,
85
+ })
86
+ return {
87
+ filename: opts.generateFilename(test.name),
88
+ body: exporter.emit.orderedSuite(_suite),
89
+ }
90
+ },
91
+ suite: async function emitSuite({
92
+ suite,
93
+ tests,
94
+ project,
95
+ enableOriginTracing,
96
+ beforeEachOptions,
97
+ enableDescriptionAsComment,
98
+ }) {
99
+ const result = await exporter.emit.testsFromSuite(tests, suite, opts, {
100
+ enableOriginTracing,
101
+ enableDescriptionAsComment,
102
+ generateTestDeclaration: opts.generateTestDeclaration,
103
+ project,
104
+ })
105
+ const suiteDeclaration = opts.generateSuiteDeclaration(suite.name)
106
+ var _suite = await exporter.emit.suite(result, tests, {
107
+ ...opts,
108
+ suiteDeclaration,
109
+ suite,
110
+ suiteName: suite.name,
111
+ project,
112
+ beforeEachOptions,
113
+ })
114
+ return {
115
+ filename: opts.generateFilename(suite.name),
116
+ body: emitOrderedSuite(_suite, suite.name),
117
+ }
118
+ },
119
+ locator: location.emit,
120
+ command: emitter.emit,
121
+ },
122
+ opts,
123
+ register: {
124
+ command: emitter.register,
125
+ variable: opts.hooks.declareVariables.register,
126
+ dependency: opts.hooks.declareDependencies.register,
127
+ beforeAll: opts.hooks.beforeAll.register,
128
+ beforeEach: opts.hooks.beforeEach.register,
129
+ afterEach: opts.hooks.afterEach.register,
130
+ afterAll: opts.hooks.afterAll.register,
131
+ inEachBegin: opts.hooks.inEachBegin.register,
132
+ inEachEnd: opts.hooks.inEachEnd.register,
133
+ },
134
+ }
135
+
136
+ function generateNamespace(name: string) {
137
+ return `namespace ${exporter.parsers.capitalize(
138
+ exporter.parsers.sanitizeName(name)
139
+ )}\n{\n`
140
+ }
141
+
142
+ function emitOrderedSuite(emittedSuite: any, name: string) {
143
+ let result = ''
144
+ result += emittedSuite.headerComment
145
+ result += emittedSuite.dependencies
146
+ result += `${generateNamespace(name)}`
147
+ result += emittedSuite.suiteDeclaration
148
+ result += emittedSuite.variables
149
+ //result += emittedSuite.beforeAll
150
+ result += emittedSuite.beforeEach
151
+ result += emittedSuite.afterEach
152
+ //result += emittedSuite.afterAll
153
+ result += emittedSuite.methods
154
+ if (emittedSuite.tests.testDeclaration) {
155
+ const test = emittedSuite.tests
156
+ result += test.testDeclaration
157
+ result += test.inEachBegin
158
+ result += test.commands
159
+ result += test.inEachEnd
160
+ result += test.testEnd
161
+ } else {
162
+ for (const testName in emittedSuite.tests) {
163
+ const test = emittedSuite.tests[testName]
164
+ result += test.testDeclaration
165
+ result += test.inEachBegin
166
+ result += test.commands
167
+ result += test.inEachEnd
168
+ result += test.testEnd
169
+ }
170
+ }
171
+ result += emittedSuite.suiteEnd
172
+ result += '}' // terminate namespace
173
+ return result
174
+ }
175
+
176
+ export default language
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "baseUrl": "./src",
5
+ "rootDir": "src",
6
+ "outDir": "dist"
7
+ },
8
+ "include": ["src/**/*.ts", "src/index.ts"],
9
+ "exclude": ["**/__mocks__", "**/__tests__"],
10
+ "references": [
11
+ {
12
+ "path": "../code-export-csharp-commons"
13
+ },
14
+ {
15
+ "path": "../side-code-export"
16
+ },
17
+ {
18
+ "path": "../side-model"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@4.8.4/node_modules/typescript/lib/lib.esnext.intl.d.ts","../side-code-export/dist/code-export/preprocessor.d.ts","../side-model/dist/types.d.ts","../side-model/dist/argtypes.d.ts","../side-model/dist/commands.d.ts","../side-model/dist/index.d.ts","../side-code-export/dist/code-export/hook.d.ts","../side-code-export/dist/types.d.ts","../side-code-export/dist/code-export/emit.d.ts","../side-code-export/dist/code-export/register.d.ts","../side-code-export/dist/code-export/find.d.ts","../side-code-export/dist/code-export/parsers.d.ts","../side-code-export/dist/code-export/prettify.d.ts","../side-code-export/dist/code-export/render.d.ts","../side-code-export/dist/code-export/utils.d.ts","../side-code-export/dist/code-export/index.d.ts","../side-code-export/dist/file-writer/emit-suite.d.ts","../side-code-export/dist/file-writer/emit-test.d.ts","../side-code-export/dist/file-writer/index.d.ts","../side-code-export/dist/string-escape/index.d.ts","../side-code-export/dist/project/index.d.ts","../side-code-export/dist/index.d.ts","../code-export-csharp-commons/dist/command.d.ts","../code-export-csharp-commons/dist/location.d.ts","../code-export-csharp-commons/dist/index.d.ts","./src/command.ts","./src/hook.ts","./src/index.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/assert.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/assert/strict.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/globals.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/async_hooks.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/buffer.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/child_process.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/cluster.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/console.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/constants.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/crypto.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/dgram.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/dns.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/dns/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/domain.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/events.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/fs.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/fs/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/http.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/http2.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/https.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/inspector.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/module.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/net.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/os.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/path.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/perf_hooks.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/process.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/punycode.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/querystring.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/readline.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/repl.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream/consumers.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/stream/web.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/string_decoder.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/test.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/timers.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/timers/promises.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/tls.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/trace_events.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/tty.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/url.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/util.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/v8.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/vm.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/wasi.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/worker_threads.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/zlib.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/globals.global.d.ts","../../node_modules/.pnpm/@types+node@16.11.64/node_modules/@types/node/ts4.8/index.d.ts","../../node_modules/.pnpm/chalk@4.1.2/node_modules/chalk/index.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/cleanupsemantic.d.ts","../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/types.d.ts","../../node_modules/.pnpm/pretty-format@27.5.1/node_modules/pretty-format/build/index.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/types.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/difflines.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/printdiffs.d.ts","../../node_modules/.pnpm/jest-diff@27.5.1/node_modules/jest-diff/build/index.d.ts","../../node_modules/.pnpm/jest-matcher-utils@27.5.1/node_modules/jest-matcher-utils/build/index.d.ts","../../node_modules/.pnpm/@types+jest@27.5.2/node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"3260e3386d9535b804205bdddb5618a9a27735bd22927f48ad54363abcd23d45","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"8b79cac9f57821f27ed9a5d63e0a60148fdfab86cf2066d7d93cb0e5d6026927","ad3e6fc6281b0036180bee24a439ba1e3587b7ea8ba84e974693239638352d15","aaac729999565f9cbe5e2c821417f108f46f3c5a932a717ad366591c20eecae9","fbb0fc873377eb8fd3091e97a0b38f2ac02b27c6c613cf61ec941d72ad3c0b22","e5889c0f7db36740230d923eefb81491f8890737e4b0e1e66646c8770f96d0cb","63d1c422a82b68b6192aa80d1841ceafb0082b5537b163398b1b47e326b2f987","befbb27557bbc3f1e6b7c5deaca66b7d72bceb1ef332b1b1c41db4d9d81ff210","ea35db4d108bae9db024d853d39cc13716b04a06d95e69af666e7b261161c583","bd6a04ab3fc64eaae736955cd48ef52bfd94a11a0ef7694d451c79cb7c0f9130","60d861eaab9db1a35eb7d43829e59d493140124bfeeeac64298029552a660c6f","a5aa779662dc7e323f1c6c5924e654943cf619aafd0473303a47617bd9477554","52f824e4551b88ec365088441bc6232cd585e0b13b2e1f4b17aaa135c1e5b81d","4826631255bbd4e40b7a72fe15ad379276a2e37d4cb6dfb454e01d5df6cde82d","d073344f1c91f1b5a8fe503e26450c279a96b80285a0a45add61064c5940eaf6","fd6fe050df20d4405edad19550c1f9d5158c2438910e7f42a5ba9f5a132c3e94","896bec96ef1abd73556bb3d77c84ddaec7f4c5d2f5bec58804df244cf4e2762d","31ac9ce243bb9c300669b252a68fcf92fec9cdac119e480e8fbe651fef39a359","2e971399faf34ec2dd70870db2cde985b0fbe9fb4e934f23378057fbfc1afde6","cb96a8697472754b800531a598ddfe6ec0adf1a7e9004f407c3a0124b9cb2e81","e885be9b048709f26ef1263a2815849a7696a11ecbafdf2d662e7e459505be26","26d80ce722c3cadfeff780079219f53985c1830fee09448ddffd74d928f976e6","47fa19fa25a0dc34d0730ed87b93bbaaf620253bab8ba61b76a7526e13327b36","8ec0e603c5c435c586b8e058c1682687cf50a2a6cbc98765e5b3c6614dfaa070","90d2a7a7ada9bf1ce4f4a1f81b881bda9d6b4fab24a418bdeeefb7d401ebd953",{"version":"9f7566fa1686f677da61b61ddb50423eb2e9983ed26170ff36392fc7e81d7e3a","signature":"3d79bd34b2c2608133d9321117ec54de8c187d4b0c89758fc32d9d45fb6f03b3"},{"version":"e8dcc190f3e4283db7d197800348e7fcbb66d045b6095c8742c041e94d1df1ef","signature":"9db86209122d4fa261df49ad35594b266944425c2dc7c28c163fbd945cc20351"},{"version":"a31598a2f880bd483eb16a861769486c112c06b40b085e0733a16ccd6ac179b6","signature":"0c01ba81ffbd0ee17aca935820891b6927215f0e9df2400256d9da4634b18d58"},"0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"2f6c9750131d5d2fdaba85c164a930dc07d2d7e7e8970b89d32864aa6c72620c","affectsGlobalScope":true},"56d13f223ab40f71840795f5bef2552a397a70666ee60878222407f3893fb8d0",{"version":"aeeee3998c5a730f8689f04038d41cf4245c9edbf6ef29a698e45b36e399b8ed","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","3a0c45fe95e8f0e2c5247d48acf3a522d2ef29f1ab0effb3c59a9c4fdd5edbcd","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","c993aac3b6d4a4620ef9651497069eb84806a131420e4f158ea9396fb8eb9b8c","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","06ccebc2c2db57d6bdbca63b71c4ae5e6ddc42d972fd8f122d4c1a28aa111b25",{"version":"81e8508d1e82278f5d3fee936f267e00c308af36219bfcee2631f9513c9c4017","affectsGlobalScope":true},"413a4be7f94f631235bbc83dad36c4d15e5a2ff02bca1efdbd03636d6454631b","20c468256fd68d3ef1fa53526e76d51d6aa91711e84d72c0343589b99238287e","a5f6d22760eef0178bebc5b5b5664a403109615a9c49da879ccd84438bd55223","8d4c16a26d59e3ce49741a7d4a6e8206b884e226cf308667c7778a0b2c0fee7f","ee3bad055a79f188626b1a7046f04ab151fdd3581e55c51d32face175bd9d06f","d61c7c41eb1960b1285e242fd102c162b65c0522985b839fadda59874308a170",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"1dbccafbca82a60fdfb0fb3c28e2493ff76d06647a512dcf72a086022e8b6f91","d10f4929cd610c26926d6784fc3f9f4120b789c03081b5d65fb2d2670a00fa04","fb0989383c6109f20281b3d31265293daefdd76d0d30551782c1654e93704f48","a4210a84a82b3e7a8cec5b2f3616e46d523f4f10cc1576d8f2fb89d0987b341e",{"version":"8207e7e6db9aa5fc7e61c8f17ba74cf9c115d26f51f91ee93f790815a7ea9dfb","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","02b3239cf1b1ff8737e383ed5557f0247499d15f5bd21ab849b1a24687b6100c","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"33eee034727baf564056b4ea719075c23d3b4767d0b5f9c6933b81f3d77774d2","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637","a4471d2bdba495b2a6a30b8765d5e0282fa7009d88345a9528f73c37869d3b93",{"version":"aee7013623e7632fba449d4df1da92925b27d9b816cb05546044dbfe54c88ef4","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","c9d70d3d7191a66a81cb554557f8ed1cf736ea8397c44a864fe52689de18865a","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4",{"version":"1aad825534c73852a1f3275e527d729a2c0640f539198fdfdfeb83b839851910","affectsGlobalScope":true},"badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"e3685a8957b4e2af64c3f04a58289ee0858a649dbcd963a2b897fe85858ae18a","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","d8aab31ba8e618cc3eea10b0945de81cb93b7e8150a013a482332263b9305322","462bccdf75fcafc1ae8c30400c9425e1a4681db5d605d1a0edb4f990a54d8094","5923d8facbac6ecf7c84739a5c701a57af94a6f6648d6229a6c768cf28f0f8cb","7adecb2c3238794c378d336a8182d4c3dd2c4fa6fa1785e2797a3db550edea62","dc12dc0e5aa06f4e1a7692149b78f89116af823b9e1f1e4eae140cd3e0e674e6","1bfc6565b90c8771615cd8cfcf9b36efc0275e5e83ac7d9181307e96eb495161","8a8a96898906f065f296665e411f51010b51372fa260d5373bf9f64356703190","7f82ef88bdb67d9a850dd1c7cd2d690f33e0f0acd208e3c9eba086f3670d4f73",{"version":"ccfd8774cd9b929f63ff7dcf657977eb0652e3547f1fcac1b3a1dc5db22d4d58","affectsGlobalScope":true}],"options":{"composite":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"sourceMap":true,"strict":true,"target":8},"fileIdsList":[[114,125,130],[70,114],[73,114],[74,79,114],[75,85,86,93,102,113,114],[75,76,85,93,114],[77,114],[78,79,86,94,114],[79,102,110,114],[80,82,85,93,114],[81,114],[82,83,114],[84,85,114],[85,114],[85,86,87,102,113,114],[85,86,87,102,114],[114],[88,93,102,113,114],[85,86,88,89,93,102,110,113,114],[88,90,102,110,113,114],[70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],[85,91,114],[92,113,114],[82,85,93,102,114],[94,114],[95,114],[73,96,114],[97,112,114,118],[98,114],[99,114],[85,100,114],[100,101,114,116],[85,102,103,104,114],[102,104,114],[102,103,114],[105,114],[106,114],[85,108,109,114],[108,109,114],[79,93,110,114],[111,114],[93,112,114],[74,88,99,113,114],[79,114],[102,114,115],[114,116],[114,117],[74,79,85,87,96,102,113,114,116,118],[102,114,119],[114,123,126],[114,123,126,127,128],[114,125],[114,122,129],[114,124],[47,50,63,114],[47,63,64,65,114],[47,63,66,114],[63,114],[63,66,67,68,114],[43,47,48,49,114],[47,114],[47,49,50,114],[43,47,48,50,51,52,53,54,55,56,63,114],[49,50,114],[49,54,114],[49,114],[47,49,114],[58,59,114],[49,57,60,61,62,114],[47,48,57,114],[45,114],[44,45,46,114],[47,63],[63]],"referencedMap":[[131,1],[70,2],[71,2],[73,3],[74,4],[75,5],[76,6],[77,7],[78,8],[79,9],[80,10],[81,11],[82,12],[83,12],[84,13],[85,14],[86,15],[87,16],[72,17],[120,17],[88,18],[89,19],[90,20],[121,21],[91,22],[92,23],[93,24],[94,25],[95,26],[96,27],[97,28],[98,29],[99,30],[100,31],[101,32],[102,33],[104,34],[103,35],[105,36],[106,37],[107,17],[108,38],[109,39],[110,40],[111,41],[112,42],[113,43],[114,44],[115,45],[116,46],[117,47],[118,48],[119,49],[122,17],[123,17],[127,50],[129,51],[128,50],[126,52],[130,53],[125,54],[124,17],[8,17],[9,17],[11,17],[10,17],[2,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[19,17],[3,17],[4,17],[23,17],[20,17],[21,17],[22,17],[24,17],[25,17],[26,17],[5,17],[27,17],[28,17],[29,17],[30,17],[6,17],[31,17],[32,17],[33,17],[34,17],[7,17],[35,17],[40,17],[41,17],[36,17],[37,17],[38,17],[39,17],[1,17],[42,17],[64,55],[66,56],[65,17],[67,57],[68,58],[69,59],[50,60],[52,61],[48,62],[57,63],[53,17],[43,17],[54,64],[51,64],[55,65],[56,66],[58,67],[59,67],[60,68],[63,69],[62,61],[61,17],[49,70],[45,17],[46,71],[47,72],[44,17]],"exportedModulesMap":[[131,1],[70,2],[71,2],[73,3],[74,4],[75,5],[76,6],[77,7],[78,8],[79,9],[80,10],[81,11],[82,12],[83,12],[84,13],[85,14],[86,15],[87,16],[72,17],[120,17],[88,18],[89,19],[90,20],[121,21],[91,22],[92,23],[93,24],[94,25],[95,26],[96,27],[97,28],[98,29],[99,30],[100,31],[101,32],[102,33],[104,34],[103,35],[105,36],[106,37],[107,17],[108,38],[109,39],[110,40],[111,41],[112,42],[113,43],[114,44],[115,45],[116,46],[117,47],[118,48],[119,49],[122,17],[123,17],[127,50],[129,51],[128,50],[126,52],[130,53],[125,54],[124,17],[8,17],[9,17],[11,17],[10,17],[2,17],[12,17],[13,17],[14,17],[15,17],[16,17],[17,17],[18,17],[19,17],[3,17],[4,17],[23,17],[20,17],[21,17],[22,17],[24,17],[25,17],[26,17],[5,17],[27,17],[28,17],[29,17],[30,17],[6,17],[31,17],[32,17],[33,17],[34,17],[7,17],[35,17],[40,17],[41,17],[36,17],[37,17],[38,17],[39,17],[1,17],[42,17],[64,55],[66,56],[65,17],[67,73],[68,74],[69,74],[50,60],[52,61],[48,62],[57,63],[53,17],[43,17],[54,64],[51,64],[55,65],[56,66],[58,67],[59,67],[60,68],[63,69],[62,61],[61,17],[49,70],[45,17],[46,71],[47,72],[44,17]],"semanticDiagnosticsPerFile":[131,70,71,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,72,120,88,89,90,121,91,92,93,94,95,96,97,98,99,100,101,102,104,103,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,122,123,127,129,128,126,130,125,124,8,9,11,10,2,12,13,14,15,16,17,18,19,3,4,23,20,21,22,24,25,26,5,27,28,29,30,6,31,32,33,34,7,35,40,41,36,37,38,39,1,42,64,66,65,67,68,69,50,52,48,57,53,43,54,51,55,56,58,59,60,63,62,61,49,45,46,47,44],"latestChangedDtsFile":"./dist/index.d.ts"},"version":"4.8.4"}
package/.babelrc DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "presets": [
3
- ["@babel/preset-env",
4
- {
5
- "targets": {
6
- "node": "8"
7
- }
8
- }]
9
- ],
10
- "plugins": [
11
- "@babel/plugin-proposal-object-rest-spread"
12
- ]
13
- }
package/src/index.js DELETED
@@ -1,180 +0,0 @@
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
- import { codeExport as exporter } from '@seleniumhq/side-code-export'
19
- import emitter from './command'
20
- import { location } from '@seleniumhq/code-export-csharp-commons'
21
- import { generateHooks } from './hook'
22
- import _default from 'diff-sequences'
23
-
24
- // Define language options
25
- export const displayName = 'C# xUnit'
26
-
27
- export let opts = {}
28
- opts.emitter = emitter
29
- opts.hooks = generateHooks()
30
- opts.fileExtension = '.cs'
31
- opts.commandPrefixPadding = ' '
32
- opts.terminatingKeyword = '}'
33
- opts.commentPrefix = '//'
34
- opts.generateMethodDeclaration = generateMethodDeclaration
35
-
36
- // Create generators for dynamic string creation of primary entities (e.g., filename, methods, test, and suite)
37
- function generateTestDeclaration(name) {
38
- return `[Fact]\npublic void ${exporter.parsers.capitalize(
39
- exporter.parsers.sanitizeName(name)
40
- )}() {`
41
- }
42
-
43
- function generateSuiteDeclaration() {
44
- return `public class SuiteTests : IDisposable {`
45
- }
46
-
47
- function generateMethodDeclaration(name) {
48
- return `public void ${exporter.parsers.sanitizeName(name)}() \n{`
49
- }
50
-
51
- function generateNamespace(name) {
52
- return `namespace ${exporter.parsers.capitalize(
53
- exporter.parsers.sanitizeName(name)
54
- )}\n{\n`
55
- }
56
-
57
- function generateFilename(name) {
58
- return `${exporter.parsers.capitalize(
59
- exporter.parsers.sanitizeName(name)
60
- )}Test${opts.fileExtension}`
61
- }
62
-
63
- // Emit an individual test, wrapped in a suite (using the test name as the suite name)
64
- export async function emitTest({
65
- baseUrl,
66
- test,
67
- tests,
68
- project,
69
- enableOriginTracing,
70
- beforeEachOptions,
71
- enableDescriptionAsComment,
72
- }) {
73
- global.baseUrl = baseUrl
74
- const testDeclaration = generateTestDeclaration(test.name)
75
- const result = await exporter.emit.test(test, tests, {
76
- ...opts,
77
- testDeclaration,
78
- enableOriginTracing,
79
- enableDescriptionAsComment,
80
- project,
81
- })
82
- const suiteName = test.name
83
- const suiteDeclaration = generateSuiteDeclaration()
84
- var _suite = await exporter.emit.suite(result, tests, {
85
- ...opts,
86
- suiteDeclaration,
87
- suiteName,
88
- project,
89
- beforeEachOptions,
90
- })
91
- return {
92
- filename: generateFilename(test.name),
93
- body: exporter.emit.orderedSuite(_suite),
94
- }
95
- }
96
-
97
- // Emit a suite with all of its tests
98
- export async function emitSuite({
99
- baseUrl,
100
- suite,
101
- tests,
102
- project,
103
- enableOriginTracing,
104
- beforeEachOptions,
105
- enableDescriptionAsComment,
106
- }) {
107
- global.baseUrl = baseUrl
108
- const result = await exporter.emit.testsFromSuite(tests, suite, opts, {
109
- enableOriginTracing,
110
- enableDescriptionAsComment,
111
- generateTestDeclaration,
112
- project,
113
- })
114
- const suiteDeclaration = generateSuiteDeclaration()
115
- var _suite = await exporter.emit.suite(result, tests, {
116
- ...opts,
117
- suiteDeclaration,
118
- suite,
119
- project,
120
- beforeEachOptions,
121
- })
122
- return {
123
- filename: generateFilename(suite.name),
124
- body: emitOrderedSuite(_suite, suite.name),
125
- }
126
- }
127
-
128
- function emitOrderedSuite(emittedSuite, name) {
129
- let result = ''
130
- result += emittedSuite.headerComment
131
- result += emittedSuite.dependencies
132
- result += `${generateNamespace(name)}`
133
- result += emittedSuite.suiteDeclaration
134
- result += emittedSuite.variables
135
- //result += emittedSuite.beforeAll
136
- result += emittedSuite.beforeEach
137
- result += emittedSuite.afterEach
138
- //result += emittedSuite.afterAll
139
- result += emittedSuite.methods
140
- if (emittedSuite.tests.testDeclaration) {
141
- const test = emittedSuite.tests
142
- result += test.testDeclaration
143
- result += test.inEachBegin
144
- result += test.commands
145
- result += test.inEachEnd
146
- result += test.testEnd
147
- } else {
148
- for (const testName in emittedSuite.tests) {
149
- const test = emittedSuite.tests[testName]
150
- result += test.testDeclaration
151
- result += test.inEachBegin
152
- result += test.commands
153
- result += test.inEachEnd
154
- result += test.testEnd
155
- }
156
- }
157
- result += emittedSuite.suiteEnd
158
- result += '}' // terminate namespace
159
- return result
160
- }
161
-
162
- export default {
163
- emit: {
164
- test: emitTest,
165
- suite: emitSuite,
166
- locator: location.emit,
167
- command: emitter.emit,
168
- },
169
- register: {
170
- command: emitter.register,
171
- variable: opts.hooks.declareVariables.register,
172
- dependency: opts.hooks.declareDependencies.register,
173
- beforeAll: opts.hooks.beforeAll.register,
174
- beforeEach: opts.hooks.beforeEach.register,
175
- afterEach: opts.hooks.afterEach.register,
176
- afterAll: opts.hooks.afterAll.register,
177
- inEachBegin: opts.hooks.inEachBegin.register,
178
- inEachEnd: opts.hooks.inEachEnd.register,
179
- },
180
- }