@zohodesk/testinglibrary 0.1.8-cbdd-26.3 → 0.1.8-eslint-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.
Files changed (44) hide show
  1. package/.babelrc +18 -18
  2. package/.eslintrc.js +31 -31
  3. package/.prettierrc +5 -5
  4. package/README.md +17 -17
  5. package/bin/cli.js +2 -2
  6. package/build/Eslint-soanarQube-Config/reportConfigSonar.js +40 -0
  7. package/build/bdd-poc/config/pathConfig.js +7 -3
  8. package/build/bdd-poc/core-runner/createCallbacksMap.js +4 -3
  9. package/build/bdd-poc/core-runner/exportMethods.js +9 -7
  10. package/build/bdd-poc/{intialize.js → core-runner/intialize.js} +4 -2
  11. package/build/bdd-poc/core-runner/main.js +14 -8
  12. package/build/bdd-poc/core-runner/stepRunner.js +52 -22
  13. package/build/bdd-poc/errors/throwError.js +4 -1
  14. package/build/bdd-poc/{test/stepsDefinition/createTestCode.js → gherkin-parser/createTestTemplate.js} +14 -14
  15. package/build/bdd-poc/{test → gherkin-parser}/cucumber/cucumberSynatxParser.js +3 -2
  16. package/build/bdd-poc/{test → gherkin-parser}/cucumber/data-driven/dataSourceMap.js +3 -17
  17. package/build/bdd-poc/{test → gherkin-parser}/stepsDefinition/extractTestInputs.js +3 -0
  18. package/build/bdd-poc/{test → gherkin-parser/stepsDefinition}/generateStep.js +10 -10
  19. package/build/bdd-poc/{test/stepsDefinition/parserSteps.js → gherkin-parser/stepsDefinition/parserStepsArguments.js} +12 -12
  20. package/build/bdd-poc/index.js +4 -4
  21. package/build/bdd-poc/snippets/stepsnippets.js +12 -9
  22. package/build/core/playwright/readConfigFile.js +30 -30
  23. package/build/core/playwright/setup/config-creator.js +13 -6
  24. package/build/core/playwright/setup/config-utils.js +7 -7
  25. package/build/core/playwright/test-runner.js +3 -3
  26. package/build/index.d.ts +13 -15
  27. package/build/index.js +6 -4
  28. package/build/lib/cli.js +7 -0
  29. package/build/parser/sample.feature +34 -34
  30. package/build/parser/sample.spec.js +18 -18
  31. package/build/setup-folder-structure/reportEnhancement/addonScript.html +24 -24
  32. package/build/setup-folder-structure/samples/auth-setup-sample.js +72 -72
  33. package/build/setup-folder-structure/samples/authUsers-sample.json +8 -8
  34. package/build/setup-folder-structure/samples/env-config-sample.json +20 -20
  35. package/build/setup-folder-structure/samples/git-ignore.sample.js +36 -36
  36. package/build/setup-folder-structure/samples/uat-config-sample.js +44 -44
  37. package/build/utils/cliArgsToObject.js +25 -25
  38. package/changelog.md +131 -131
  39. package/jest.config.js +63 -63
  40. package/npm-shrinkwrap.json +6098 -5994
  41. package/package.json +57 -56
  42. package/playwright.config.js +112 -112
  43. /package/build/bdd-poc/{test → gherkin-parser}/cucumber/cucumber.js +0 -0
  44. /package/build/bdd-poc/{test → gherkin-parser}/tagsHandle.js +0 -0
@@ -4,12 +4,22 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.traverseASTstep = traverseASTstep;
7
+ exports.createStepArgumentsMap = createStepArgumentsMap;
8
8
  var _acorn = require("acorn");
9
9
  var _fileUtils = require("../../../utils/fileUtils");
10
10
  var _fastGlob = _interopRequireDefault(require("fast-glob"));
11
11
  var _pathConfig = require("../../config/pathConfig");
12
12
  globalThis.testDataMap = new Map();
13
+ function createStepArgumentsMap() {
14
+ var $promise = [];
15
+ _fastGlob.default.globSync((0, _pathConfig.getStepFilePath)(), {
16
+ dot: true,
17
+ cwd: process.cwd()
18
+ }).forEach(filePath => {
19
+ $promise.push(parseNodeAST((0, _fileUtils.readFileContents)(filePath)));
20
+ });
21
+ Promise.all($promise);
22
+ }
13
23
  async function extractFixtureFrmNode(node) {
14
24
  var stepText;
15
25
  return await new Promise(resolve => {
@@ -51,17 +61,7 @@ function combineAllFixture(fixturesArray) {
51
61
  }
52
62
  return `{${allFixture}${lastFixture}}`;
53
63
  }
54
- function traverseASTstep() {
55
- var $promise = [];
56
- _fastGlob.default.globSync((0, _pathConfig.getStepFilePath)(), {
57
- dot: true,
58
- cwd: process.cwd()
59
- }).forEach(filePath => {
60
- $promise.push(nodeAST((0, _fileUtils.readFileContents)(filePath)));
61
- });
62
- Promise.all($promise);
63
- }
64
- function nodeAST(stepContent) {
64
+ function parseNodeAST(stepContent) {
65
65
  const options = {
66
66
  ecmaVersion: 2020,
67
67
  sourceType: 'module'
@@ -9,16 +9,16 @@ Object.defineProperty(exports, "createBdd", {
9
9
  return _exportMethods.createBdd;
10
10
  }
11
11
  });
12
- Object.defineProperty(exports, "createCucumberBDD", {
12
+ Object.defineProperty(exports, "createNativeBDD", {
13
13
  enumerable: true,
14
14
  get: function () {
15
- return _main.createCucumberBDD;
15
+ return _stepRunner.createNativeBDD;
16
16
  }
17
17
  });
18
- Object.defineProperty(exports, "createNativeBDD", {
18
+ Object.defineProperty(exports, "preProcessGherkin", {
19
19
  enumerable: true,
20
20
  get: function () {
21
- return _stepRunner.createNativeBDD;
21
+ return _main.preProcessGherkin;
22
22
  }
23
23
  });
24
24
  var _exportMethods = require("./core-runner/exportMethods");
@@ -3,10 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.testCase = testCase;
7
- exports.testFile = testFile;
8
- exports.testStep = testStep;
9
- exports.testSuite = testSuite;
6
+ exports.createStepFormat = createStepFormat;
7
+ exports.createTestFormat = createTestFormat;
8
+ exports.describeTest = describeTest;
10
9
  const TESTING_LIBRARY = '@zohodesk/testinglibrary';
11
10
  function stepReportHandle(Steps, Example) {
12
11
  var _steps = [...Steps];
@@ -19,7 +18,7 @@ function stepReportHandle(Steps, Example) {
19
18
  });
20
19
  return [...resultSteps.split(medium)];
21
20
  }
22
- function testStep(keyword, description, pageFixtureUsed_Step, testData, stepDescription, options) {
21
+ function createStepFormat(keyword, description, pageFixtureUsed_Step, testData, stepDescription, options) {
23
22
  return `await test.step('${keyword.trim()}:${stepDescription.replace(new RegExp(`'`, 'g'), ' ')}',async() => {
24
23
  await $${keyword}("${description}")(${pageFixtureUsed_Step},${testData})
25
24
  })`;
@@ -29,7 +28,7 @@ function testSuite(description, scenariotestBlock, tags, options = null) {
29
28
  ${scenariotestBlock}
30
29
  })`;
31
30
  }
32
- function testCase(steps, examples, description, pageFixtures, tags, option) {
31
+ function describeTest(steps, examples, description, pageFixtures, tags, option) {
33
32
  if (examples.length >= 1) {
34
33
  const exmapleScenario = examples.map(($ele, index) => {
35
34
  var exampleDescription = Object.values($ele).map(val => {
@@ -47,7 +46,7 @@ function testBlock(description, steps, pageFixtures) {
47
46
  ${steps.join(`\n\t`)}
48
47
  })`;
49
48
  }
50
- function testFile(testCase, relativeFilePath, $tags = ' ', options = null) {
49
+ function createTestFormat(testCases, relativeFilePath, $tags = ' ', options = null) {
51
50
  return ` // ${relativeFilePath}
52
51
  import { test, createNativeBDD } from "${TESTING_LIBRARY}";
53
52
  const {$Given,$When,$Then,$And} = createNativeBDD()
@@ -56,6 +55,10 @@ function testFile(testCase, relativeFilePath, $tags = ' ', options = null) {
56
55
  $tags: ({}, use, testInfo) => use(${JSON.stringify($tags)}
57
56
  [testInfo.titlePath.slice(2).join("|")] || [])
58
57
  })
59
- ${testCase.join('')}
58
+ ${testCases.join('')}
60
59
  `;
61
- }
60
+ }
61
+
62
+ /**
63
+ * test templete else snippet
64
+ */
@@ -57,40 +57,40 @@ function combineDefaultConfigWithUserConfig(userConfiguration) {
57
57
  };
58
58
  }
59
59
 
60
- /**
61
- * @typedef {Object|null} viewportConfig
62
- * @property {number} width - width of the viewport
63
- * @property {number} height - height of the viewport
60
+ /**
61
+ * @typedef {Object|null} viewportConfig
62
+ * @property {number} width - width of the viewport
63
+ * @property {number} height - height of the viewport
64
64
  */
65
65
 
66
- /**
67
- * Represents the user configuration object.
68
- * @typedef {Object} UserConfig
69
- * @property {string} headless - Headless Browsers mode.
70
- * @property {number} trace - trace for test cases.
71
- * @property {boolean} video - video for test cases,
72
- * @property {boolean} debug - debug mode
73
- * @property {string} mode: mode in which the test cases needs to run
74
- * @property {boolean} isAuthMode - Auth Mode. config whether authentication step needed before running test cases
75
- * @property {string} authFilePath - File Path where the cookies stored
76
- * @property {any} browsers: List of browsers
77
- * @property {string} openReportOn: default Option value (never, on-failure and always)
78
- * @property {any} reportPath : directory where report is generate
79
- * @property {boolean} bddMode: Feature files needs to be processed
80
- * @property {number} expectTimeout: time in milliseconds which the expect condition should fail
81
- * @property {number} testTimeout: time in milliseconds which the test should fail
82
- * @property {Object} additionalPages: custom pages configuration
83
- * @property {string} featureFilesFolder: folder name under which feature-files will be placed. Default is feature-files
84
- * @property {string} stepDefinitionsFolder: folder name under which step implementations will be placed. Default is steps
85
- * @property {viewportConfig} viewport: viewport configuration for the browser. Default is { width: 1280, height: 720 }
86
- * @property {string} testIdAttribute: Change the default data-testid attribute. configure what attribute to search while calling getByTestId
87
- * @property {Array} editionOrder: Order in the form of larger editions in the back. Edition with the most privelages should be last
66
+ /**
67
+ * Represents the user configuration object.
68
+ * @typedef {Object} UserConfig
69
+ * @property {string} headless - Headless Browsers mode.
70
+ * @property {number} trace - trace for test cases.
71
+ * @property {boolean} video - video for test cases,
72
+ * @property {boolean} debug - debug mode
73
+ * @property {string} mode: mode in which the test cases needs to run
74
+ * @property {boolean} isAuthMode - Auth Mode. config whether authentication step needed before running test cases
75
+ * @property {string} authFilePath - File Path where the cookies stored
76
+ * @property {any} browsers: List of browsers
77
+ * @property {string} openReportOn: default Option value (never, on-failure and always)
78
+ * @property {any} reportPath : directory where report is generate
79
+ * @property {boolean} bddMode: Feature files needs to be processed
80
+ * @property {number} expectTimeout: time in milliseconds which the expect condition should fail
81
+ * @property {number} testTimeout: time in milliseconds which the test should fail
82
+ * @property {Object} additionalPages: custom pages configuration
83
+ * @property {string} featureFilesFolder: folder name under which feature-files will be placed. Default is feature-files
84
+ * @property {string} stepDefinitionsFolder: folder name under which step implementations will be placed. Default is steps
85
+ * @property {viewportConfig} viewport: viewport configuration for the browser. Default is { width: 1280, height: 720 }
86
+ * @property {string} testIdAttribute: Change the default data-testid attribute. configure what attribute to search while calling getByTestId
87
+ * @property {Array} editionOrder: Order in the form of larger editions in the back. Edition with the most privelages should be last
88
88
  */
89
89
 
90
- /**
91
- * Generates a configuration object from a file, if it exists.
92
- *
93
- * @returns {UserConfig}
90
+ /**
91
+ * Generates a configuration object from a file, if it exists.
92
+ *
93
+ * @returns {UserConfig}
94
94
  */
95
95
  function generateConfigFromFile() {
96
96
  const filePath = _path.default.resolve(process.cwd(), fileName);
@@ -9,8 +9,10 @@ var _test = require("@playwright/test");
9
9
  var _path = _interopRequireDefault(require("path"));
10
10
  var _readConfigFile = require("../readConfigFile");
11
11
  var _configUtils = require("./config-utils");
12
- var _dataSourceMap = require("../../../bdd-poc/test/cucumber/data-driven/dataSourceMap");
13
- var _createCallbacksMap = require("../../../bdd-poc/core-runner/createCallbacksMap");
12
+ var _intialize = require("../../../bdd-poc/core-runner/intialize");
13
+ // import { createTestDataMap } from '../../../bdd-poc/test/cucumber/data-driven/dataSourceMap';
14
+ // import { createStepsCallBack } from '../../../bdd-poc/core-runner/createCallbacksMap';
15
+
14
16
  const {
15
17
  browsers,
16
18
  trace,
@@ -45,12 +47,17 @@ const testOptions = (0, _configUtils.getTestUseOptions)({
45
47
  testIdAttribute
46
48
  });
47
49
 
48
- /**
49
- * Playwright configuration object
50
- *
51
- * @returns {import('@playwright/test').PlaywrightTestConfig}
50
+ /**
51
+ * Playwright configuration object
52
+ *
53
+ * @returns {import('@playwright/test').PlaywrightTestConfig}
52
54
  */
53
55
  async function getPlaywrightConfig() {
56
+ (0, _intialize.createGlobalMaps)();
57
+ /**
58
+ * createglobal Map = make it loose coupled
59
+ * expose from bdd parser (From module to core module)
60
+ */
54
61
  // globalThis.globalStepMap = new Map();
55
62
  // createStepsCallBack();
56
63
  // globalThis.globalTestDataMap = await createTestDataMap();
@@ -11,9 +11,9 @@ var _path = _interopRequireDefault(require("path"));
11
11
  var _readConfigFile = require("../readConfigFile");
12
12
  // import { defineBddConfig } from '../../../bdd-framework';
13
13
 
14
- /**
15
- ** Playwright project configuration
16
- * @returns {import('@playwright/test').Project}
14
+ /**
15
+ ** Playwright project configuration
16
+ * @returns {import('@playwright/test').Project}
17
17
  */
18
18
  function getBrowserConfig({
19
19
  browserName,
@@ -87,10 +87,10 @@ function getBrowserConfig({
87
87
  }
88
88
  }
89
89
 
90
- /**
91
- *
92
- * @param {*} param0
93
- * @returns {import('@playwright/test').Project[]}
90
+ /**
91
+ *
92
+ * @param {*} param0
93
+ * @returns {import('@playwright/test').Project[]}
94
94
  */
95
95
  function getProjects({
96
96
  browsers,
@@ -15,7 +15,7 @@ var _readConfigFile = require("./readConfigFile");
15
15
  var _rootPath = require("../../utils/rootPath");
16
16
  var _tagProcessor = require("./tag-processor");
17
17
  var _bddPoc = require("../../bdd-poc");
18
- var _intialize = require("../../bdd-poc/intialize");
18
+ // import { createGlobalMaps } from '../../bdd-poc/core-runner/intialize';
19
19
  // import { allowedTags } from '../../bdd-poc/test/tagsHandle';
20
20
 
21
21
  function parseUserArgs() {
@@ -128,8 +128,8 @@ function main() {
128
128
  const configPath = (0, _readConfigFile.isUserConfigFileAvailable)() ? require.resolve('./setup/config-creator.js') : require.resolve('../../../playwright.config.js');
129
129
  let promises = [];
130
130
  if (bddMode) {
131
- promises.push((0, _bddPoc.createCucumberBDD)());
132
- promises.push((0, _intialize.createGlobalMaps)());
131
+ promises.push((0, _bddPoc.preProcessGherkin)());
132
+ // promises.push(createGlobalMaps());
133
133
  }
134
134
  const args = ['test', '--config', configPath].concat(playwrightArgs);
135
135
  Promise.all(promises).then(() => runPlaywright(command, args)).catch(err => {
package/build/index.d.ts CHANGED
@@ -1,15 +1,13 @@
1
- import { expect, test } from './core/playwright/index';
2
- // import { fireEvent, render } from '@testing-library/react';
3
- import {
4
- PlaywrightTestArgs,
5
- PlaywrightTestOptions,
6
- PlaywrightWorkerArgs,
7
- PlaywrightWorkerOptions,
8
- TestType,
9
- Page
10
- } from '@playwright/test';
11
-
12
- import { createBdd, createNativeBDD } from './bdd-poc';
13
- const { Given, When, Then, Step, And } = createBdd();
14
- export { Given, When, Then, Step, And, createBdd, createNativeBDD };
15
- export * from '@playwright/test/types/test';
1
+ import { expect, test } from './core/playwright/index';
2
+ // import { fireEvent, render } from '@testing-library/react';
3
+ import {
4
+ PlaywrightTestArgs,
5
+ PlaywrightTestOptions,
6
+ PlaywrightWorkerArgs,
7
+ PlaywrightWorkerOptions,
8
+ TestType,
9
+ Page
10
+ } from '@playwright/test';
11
+
12
+
13
+ export * from '@playwright/test/types/test';
package/build/index.js CHANGED
@@ -35,11 +35,13 @@ const {
35
35
  Given,
36
36
  Then,
37
37
  When,
38
- And
38
+ And,
39
+ Step,
40
+ But
39
41
  } = (0, _bddPoc.createBdd)();
42
+ exports.But = But;
43
+ exports.Step = Step;
40
44
  exports.And = And;
41
45
  exports.When = When;
42
46
  exports.Then = Then;
43
- exports.Given = Given;
44
- const Step = exports.Step = Then;
45
- const But = exports.But = Then;
47
+ exports.Given = Given;
package/build/lib/cli.js CHANGED
@@ -9,6 +9,7 @@ var _setupProject = _interopRequireDefault(require("../setup-folder-structure/se
9
9
  var _parser = require("../parser/parser");
10
10
  var _clearCaches = _interopRequireDefault(require("../core/playwright/clear-caches"));
11
11
  var _helper = _interopRequireDefault(require("../setup-folder-structure/helper"));
12
+ var _reportConfigSonar = require("../Eslint-soanarQube-Config/reportConfigSonar");
12
13
  // import createJestRunner from '../core/jest/runner/jest-runner';
13
14
 
14
15
  const [,, option, ...otherOptions] = process.argv;
@@ -54,6 +55,12 @@ switch (option) {
54
55
  (0, _clearCaches.default)();
55
56
  break;
56
57
  }
58
+ case 'eslint':
59
+ {
60
+ _logger.Logger.log(_logger.Logger.SUCCESS_TYPE, 'Eslint Report Generated ...');
61
+ (0, _reportConfigSonar.sonarScannerAnalysis)();
62
+ break;
63
+ }
57
64
  case 'help':
58
65
  default:
59
66
  {
@@ -1,34 +1,34 @@
1
- Feature: Home Page
2
-
3
- Scenario: Home Page Default content
4
- Given user is on "<App>" home page
5
- Then user gets a "<App>" bootcamp section
6
- And username is also displayed on right corner
7
-
8
- Examples:
9
- | App |
10
- | GitHub |
11
-
12
- Scenario: GitHub Bootcamp Section
13
- Given user is on "<Site>" home page
14
- When user focuses on "<Site>" Bootcamp Section
15
- Then user gets an option to setup git
16
- And user gets an option to create repository
17
- And user gets an option to Fork Repository
18
- And user gets an option to work together
19
-
20
- Examples:
21
- | Site |
22
- | GitHub |
23
-
24
- Scenario: Top Banner content
25
- Given user is on "<Product>" home page
26
- When user focuses on Top Banner
27
- Then user gets an option of home page
28
- And user gets an option to search
29
- And user gets settings options
30
- And user gets an option to logout
31
-
32
- Examples:
33
- | Product |
34
- | GitHub |
1
+ Feature: Home Page
2
+
3
+ Scenario: Home Page Default content
4
+ Given user is on "<App>" home page
5
+ Then user gets a "<App>" bootcamp section
6
+ And username is also displayed on right corner
7
+
8
+ Examples:
9
+ | App |
10
+ | GitHub |
11
+
12
+ Scenario: GitHub Bootcamp Section
13
+ Given user is on "<Site>" home page
14
+ When user focuses on "<Site>" Bootcamp Section
15
+ Then user gets an option to setup git
16
+ And user gets an option to create repository
17
+ And user gets an option to Fork Repository
18
+ And user gets an option to work together
19
+
20
+ Examples:
21
+ | Site |
22
+ | GitHub |
23
+
24
+ Scenario: Top Banner content
25
+ Given user is on "<Product>" home page
26
+ When user focuses on Top Banner
27
+ Then user gets an option of home page
28
+ And user gets an option to search
29
+ And user gets settings options
30
+ And user gets an option to logout
31
+
32
+ Examples:
33
+ | Product |
34
+ | GitHub |
@@ -2,34 +2,34 @@
2
2
 
3
3
  var _testinglibrary = require("@zohodesk/testinglibrary");
4
4
  _testinglibrary.test.describe('Home Page', () => {
5
- /*
6
- ** Given user is on "<App>" home page
7
- ** Then user gets a "<App>" bootcamp section
8
- ** And username is also displayed on right corner
5
+ /*
6
+ ** Given user is on "<App>" home page
7
+ ** Then user gets a "<App>" bootcamp section
8
+ ** And username is also displayed on right corner
9
9
  */
10
10
  (0, _testinglibrary.test)('Home Page Default content', () => {
11
11
  // Your implementation here
12
12
  });
13
13
 
14
- /*
15
- ** Given user is on "<Site>" home page
16
- ** When user focuses on "<Site>" Bootcamp Section
17
- ** Then user gets an option to setup git
18
- ** And user gets an option to create repository
19
- ** And user gets an option to Fork Repository
20
- ** And user gets an option to work together
14
+ /*
15
+ ** Given user is on "<Site>" home page
16
+ ** When user focuses on "<Site>" Bootcamp Section
17
+ ** Then user gets an option to setup git
18
+ ** And user gets an option to create repository
19
+ ** And user gets an option to Fork Repository
20
+ ** And user gets an option to work together
21
21
  */
22
22
  (0, _testinglibrary.test)('GitHub Bootcamp Section', () => {
23
23
  // Your implementation here
24
24
  });
25
25
 
26
- /*
27
- ** Given user is on "<Product>" home page
28
- ** When user focuses on Top Banner
29
- ** Then user gets an option of home page
30
- ** And user gets an option to search
31
- ** And user gets settings options
32
- ** And user gets an option to logout
26
+ /*
27
+ ** Given user is on "<Product>" home page
28
+ ** When user focuses on Top Banner
29
+ ** Then user gets an option of home page
30
+ ** And user gets an option to search
31
+ ** And user gets settings options
32
+ ** And user gets an option to logout
33
33
  */
34
34
  (0, _testinglibrary.test)('Top Banner content', () => {
35
35
  // Your implementation here
@@ -1,25 +1,25 @@
1
- <script>
2
- function sortEdition(event) {
3
- var currentURL = window.location.href;
4
- const endPointCount = window.location.href.indexOf('#');
5
- if (!(endPointCount == -1)) {
6
- window.history.pushState({}, '', currentURL.slice(0, endPointCount));
7
- currentURL = currentURL.slice(0, endPointCount);
8
- }
9
- console.log(currentURL);
10
- window.open(`${currentURL}#?q=@edition_${event.target.value}`, '_self');
11
- }
12
- </script>
13
- <div class="mainContainer" style="margin-left: 20px; display: flex;">
14
- <div class="selectEditionContainer" style="padding: 20px;">
15
- <select class="selectEdition" style="padding: 5px; width: 100px; border-radius: 6px; border: 1px solid var(--color-border-default);" onchange="sortEdition(event)">
16
- <option value="EnterPrise">EnterPrise</option>
17
- <option value="Professional">Professional</option>
18
- <option value="Express">Express</option>
19
- <option value="Standard">Standard</option>
20
- <option value="Free">Free</option>
21
- </select>
22
- </div>
23
- </div>
24
-
1
+ <script>
2
+ function sortEdition(event) {
3
+ var currentURL = window.location.href;
4
+ const endPointCount = window.location.href.indexOf('#');
5
+ if (!(endPointCount == -1)) {
6
+ window.history.pushState({}, '', currentURL.slice(0, endPointCount));
7
+ currentURL = currentURL.slice(0, endPointCount);
8
+ }
9
+ console.log(currentURL);
10
+ window.open(`${currentURL}#?q=@edition_${event.target.value}`, '_self');
11
+ }
12
+ </script>
13
+ <div class="mainContainer" style="margin-left: 20px; display: flex;">
14
+ <div class="selectEditionContainer" style="padding: 20px;">
15
+ <select class="selectEdition" style="padding: 5px; width: 100px; border-radius: 6px; border: 1px solid var(--color-border-default);" onchange="sortEdition(event)">
16
+ <option value="EnterPrise">EnterPrise</option>
17
+ <option value="Professional">Professional</option>
18
+ <option value="Express">Express</option>
19
+ <option value="Standard">Standard</option>
20
+ <option value="Free">Free</option>
21
+ </select>
22
+ </div>
23
+ </div>
24
+
25
25