Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: debug with selector option added #8066

Merged
merged 9 commits into from
Dec 19, 2023

Conversation

Bayheck
Copy link
Collaborator

@Bayheck Bayheck commented Nov 2, 2023

Purpose

The purpose of this PR is to allow passing selector to a t.debug call. Something like this t.debug(Selector). Then the selector will be shown in debug mode and highlighted.

Approach

So overall, the main goal was to pass the selector argument from server-side debug call to client-side selector-input-contaner.

  1. src/test-run/index.ts Inside this file we have _internalExecuteCommand method. There is debug command type handling block. Inside of it we call _enqueueSetBreakpointCommand to which we pass command.selector as a second argument. This way we transfer Selector from debugCommand to breakpointCommand.
  2. After the breakpointCommand is added to driverTaskQueue we can work with it on client-side.
  3. On client-side we pass selector to _debugSelector method of SelectorInputContainer class.
  4. In _debugSelector method we:
    - remove any previously highlighted elements,
    - get Selector name and assign it to this.value for SelectorInputContainer,
    - execute Selector to get elements for highlighting and indication,
    - highlight and indicate elements of the Selector

References

https://github.com/DevExpress/testcafe-private/issues/163

Pre-Merge TODO

  • Write tests for your proposed changes
  • Make sure that existing tests do not fail

@need-response-app need-response-app bot added the STATE: Need response An issue that requires a response or attention from the team. label Nov 2, 2023
@Bayheck Bayheck temporarily deployed to CI November 2, 2023 17:18 — with GitHub Actions Inactive
@Bayheck Bayheck temporarily deployed to CI November 2, 2023 17:28 — with GitHub Actions Inactive
@PavelMor25 PavelMor25 removed the STATE: Need response An issue that requires a response or attention from the team. label Nov 3, 2023
…red DebugCommand and execute-client-function
Copy link
Collaborator

@Aleksey28 Aleksey28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job! Please look at my comments

src/test-run/commands/observation.js Outdated Show resolved Hide resolved
src/test-run/commands/observation.js Outdated Show resolved Hide resolved
src/test-run/commands/observation.js Outdated Show resolved Hide resolved
src/client/ui/selector-inspector-panel/index.js Outdated Show resolved Hide resolved
src/test-run/commands/service.js Outdated Show resolved Hide resolved
src/test-run/index.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@Aleksey28 Aleksey28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more thing

src/test-run/commands/observation.js Show resolved Hide resolved
Copy link
Collaborator

@Aleksey28 Aleksey28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, merge after the tests turn green

@aleks-pro
Copy link
Collaborator

Please, do not merge. We need add documentation first.

@aleks-pro aleks-pro changed the title Add: debug with selector option added feat: debug with selector option added Dec 19, 2023
@aleks-pro aleks-pro merged commit 61d6b4b into DevExpress:master Dec 19, 2023
21 checks passed
Copy link

Release v3.5.0-rc.1 addresses this.

Copy link

Release v3.5.0-rc.1 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants