Skip to content

Commit

Permalink
Merge pull request #1397 from jdi-testing/bugfix_1372
Browse files Browse the repository at this point in the history
issue_1372: Added active status for created custom locator
  • Loading branch information
arslanbekova authored Jul 20, 2023
2 parents 258c47c + 29c5aee commit aec184f
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 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",
"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.13.528",
"version": "3.13.529",
"icons": {
"128": "icon128.png"
},
Expand Down
4 changes: 2 additions & 2 deletions 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.13.528",
"version": "3.13.529",
"description": "jdn-ai chrome extension",
"scripts": {
"start": "webpack --watch --env devenv",
Expand Down
3 changes: 2 additions & 1 deletion src/features/locators/components/LocatorCopyButton.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { Button, Tooltip } from "antd";
import { CopySimple } from "phosphor-react";
import React, { useState } from "react";
import { copyToClipboard, getLocatorString } from "../../../common/utils/copyToClipboard";
import { copyToClipboard } from "../../../common/utils/copyToClipboard";
import { CopyTitle } from "../../../common/types/common";
import { getLocatorString } from "../../../common/utils/helpers";

export const LocatorCopyButton = ({ element }) => {
const [copyTooltipTitle, setTooltipTitle] = useState(CopyTitle.Copy);
Expand Down
4 changes: 2 additions & 2 deletions src/features/locators/reducers/addCustomLocator.thunk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ActionReducerMapBuilder, createAsyncThunk } from "@reduxjs/toolkit";
import { Locator, LocatorsState, ValidationStatus } from "../types/locator.types";
import { generateId, getElementFullXpath } from "../../../common/utils/helpers";
import { addLocatorToPageObj } from "../../pageObjects/pageObject.slice";
import { addLocators, setScrollToLocator } from "../locators.slice";
import { addLocators, setScrollToLocator, setActiveSingle } from "../locators.slice";
import { getLocatorValidationStatus, evaluateXpath, evaluateCssSelector, generateSelectorByHash } from "../utils/utils";
import { PageObjectId } from "../../pageObjects/types/pageObjectSlice.types";
import { sendMessage } from "../../../pageServices/connector";
Expand Down Expand Up @@ -74,9 +74,9 @@ export const addCustomLocator = createAsyncThunk(
}

const dispatch = thunkAPI.dispatch;

dispatch(addLocators([newLocator]));
dispatch(addLocatorToPageObj({ pageObjId: pageObjectId, locatorId: newLocator.element_id }));
dispatch(setActiveSingle(newLocator));
dispatch(setScrollToLocator(newLocator.element_id));

return newLocator;
Expand Down

0 comments on commit aec184f

Please sign in to comment.