Skip to content

Commit

Permalink
Merge branch 'master' into issue_1344
Browse files Browse the repository at this point in the history
  • Loading branch information
MariiaNebesnova committed Jul 24, 2023
2 parents fb6368e + aec184f commit 2f0f119
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
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.

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 2f0f119

Please sign in to comment.