SeleniumHQ / selenium-ide

Open Source record and playback test automation for the web.
https://selenium.dev/selenium-ide/
Apache License 2.0
2.8k stars 762 forks source link

Selenium IDE has a large application market in China, so I localized the source code (trunk branch) and added some features and fixed some bugs that I found. Perhaps I can help promote Selenium IDE in China. #1812

Closed fernandozw closed 5 months ago

fernandozw commented 5 months ago

1. New features added

Localization supports multi-language display of page copy, improves the usability of Selenium ide, and facilitates subsequent promotion and use. The following are the newly added and modified file contents.

(1) Add an enumeration file: selenium-ide-trunk/packages/selenium-ide/src/browser/enums/I18N.ts. This file can be configured in multiple languages. (2) Modify selenium-ide-trunk/packages/selenium-ide/src/main/store/index.ts, interface StorageSchema and add 2 new fields: language: the language selected by the user, languageMap: all enumeration Maps of the corresponding language (3) Modify selenium-ide-trunk/packages/selenium-ide/src/main/session/controllers/System/index.ts and add 3 new methods: getLanguage: get the current language, setLanguage: set the language, getLanguageMap: get the corresponding Language all enumeration Map (4) Add an interface callable by the rendering process: selenium-ide-trunk/packages/side-api/src/commands/system/getLanguage.ts to obtain the current language (5) Add an interface callable by the rendering process: selenium-ide-trunk/packages/side-api/src/commands/system/getLanguageMap.ts to obtain all enumeration maps of the corresponding language (6) Add an interface callable by the rendering process: selenium-ide-trunk/packages/side-api/src/commands/system/setLanguage.ts to set the language (7) Modify selenium-ide-trunk/packages/selenium-ide/src/browser/windows/Splash/renderer.tsx to add a RadioGroup for language selection (8) Replace label and innerHtml in the selenuimide page with variables. If the component has Session parameters, use Session.store.get('languageMap') to replace label or innerHtml. If the component does not have Session parameters, use window.sideAPI.system.getLanguageMap(). Replace label or innerHtml

The selenium ide script file (.side) is exported to the back-end test platform and generates the corresponding test case function. The following is the newly added and modified file content. This function can be used without affecting the original function of selenium ide. It is just for the convenience of my work. And the added functionality

(1) Add a new file: selenium-ide-trunk/packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Project/OutPutSettings.tsx for .side export to the back-end test platform and generate corresponding tests Example (2) Modify selenium-ide-trunk/packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Project/ProjectTab.tsx to access the OutPutSettings component (3) Modify selenium-ide-trunk/packages/side-api/src/models/state/index.t ConfigSettingsGroup to add an enumeration outPut (4) Modify selenium-ide-trunk/packages/selenium-ide/src/main/session/controllers/Playback/index.ts. It just adds a method openBrowser, which does not affect the original function. It is used to click on the linkUrl of selenium ide. Through The browser opens the page and does not use electron to open the page. (5) Back-end testing platform GitHub address: https://github.com/fernandozw/WebUiAutomation

2. Fixed some of the bugs I found, the following are the modified file contents

(1) Modify selenium-ide-trunk/packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Suites/Editor/SuiteEditor.tsx: name cannot be entered in Chinese, you can copy and paste, this bug has been fixed: Modify The input box event is onBlur, value={suite.name}->defaultValue={suite.name} (2) Modify selenium-ide-trunk/packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Suites/Editor/SuiteEditor.tsx:timeout (timeout time) to set the input to empty, and the value is NAN, Then you can't input Heqingkong. This bug has been fixed. Change timeout: parseInt(e.target.value) to ->Math.max(parseInt(e.target.value || "0"), 0) (3) Modify selenium-ide-trunk/packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Project/ProjectSettings.tsx. Since both timeout and delay are bound to project.delay, timeout and delay will follow. The value of project.delay changes together. When the test case is actually played back, no matter what the value of project.delay is set to, the Step Timeout is always 5000 milliseconds because selenium-ide-trunk/packages/side-runtime/src/webdriver. The implicitWaitme parameter of the constructor of WebDriverExecutor in ts was not assigned a value, so the value of 5000 milliseconds was used, so I modified selenium-ide-trunk/packages/side-model/src/types.ts, added a new field timeout, and modified selenium -ide-trunk/packages/side-api/src/commands/projects/update.ts Shape’s updates parameter, a new enumeration is added: timeout, and selenium-ide-trunk/packages/selenium-ide/src is modified /main/session/controllers/Driver/index.ts build method, which introduces the constructor parameter implicitWait of WebDriverExecutor, whose value is timeout (4) Modify selenium-ide-trunk/packages/selenium-ide/src/browser/windows/ProjectEditor/tabs/Project/ProjectTab.tsx and comment out This code will cause the page to display abnormally

3.International renderings

(1)Language selection page english

英文选择

chinese

选择页面

(2)Project Editor english

主页面英文

chinese

主页面

4.Export .side file

导出

5.Fixed bugs and listed some pictures

CONFIG->PROJECT->Step Timeout

项目配置

SUITES->Name & Timeout

集合

6.Modified Selenium ide project

selenium-ide-trunk.zip

Guys, if you think my new features are useful, I can join the community to develop this project together. After all, there are many test engineers in China using Selenium ide

toddtarsi commented 5 months ago

Holy shit! Hell yes!!! 💪

Can you make a PR from this and I'd love to review it. I promise not to be too obnoxious haha 😅

This is awesome, thank you!!!!

fernandozw commented 5 months ago

Brother, a PR has been initiated

老铁,pr已经发起!

toddtarsi commented 5 months ago

@fernandozw - I am closing this issue because you are addressing it yourself (and doing an amazing job!)

github-actions[bot] commented 4 months ago

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.