Skip to content

Commit

Permalink
Merge pull request #1698 from jdi-testing/issue_1495-plugin-crash-whe…
Browse files Browse the repository at this point in the history
…n-select-element

Issue 1495: fix plugin crash when select 1 element from context menu
  • Loading branch information
KateDronova authored Apr 2, 2024
2 parents 86531eb + b59be58 commit 6344ef8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "JDN — Page Object Generator",
"description": "JDN – helps Test Automation Engineer to create Page Objects in the test automation framework and speed up test development",
"devtools_page": "index.html",
"version": "3.15.17",
"version": "3.15.18",
"icons": {
"128": "icon128.png"
},
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jdn-ai-chrome-extension",
"version": "3.15.17",
"version": "3.15.18",
"description": "jdn-ai chrome extension",
"scripts": {
"start": "webpack --watch --env devenv",
Expand Down
5 changes: 4 additions & 1 deletion src/pageServices/contentScripts/contextmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,10 @@ export const runContextMenu = () => {
elementMenu.hide();
return sendMessage({
message: ScriptMsg.ElementSelect,
param: _element,
param: {
chosenElem: _element,
otherElems: predictedElements,
},
});
},
},
Expand Down
3 changes: 2 additions & 1 deletion src/pageServices/scriptMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ export const updateMessageHandler = (
copyLocator(framework, value, pageObjectName, option)();
},
[ScriptMsg.ElementSelect]: (payload) => {
dispatch(elementSetActive(payload.element_id));
dispatch(elementGroupUnsetActive(payload.otherElems));
dispatch(elementSetActive(payload.chosenElem));
},
[ScriptMsg.ElementGroupSetActive]: (payload) => {
const locators = payload.map((jdnHash: string) => selectLocatorByJdnHash(state, jdnHash));
Expand Down

0 comments on commit 6344ef8

Please sign in to comment.