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

[mochitest] Add a test for pause on next #5446

Closed
jasonLaster opened this issue Feb 16, 2018 · 11 comments
Labels

Comments

@jasonLaster
Copy link
Contributor

@jasonLaster jasonLaster commented Feb 16, 2018

We should add a mochitest for pause on next.

It can be similar to this test:
https://github.com/devtools-html/debugger.html/blob/release-17/src/test/mochitest/browser_dbg-breaking.js#L1

Basically go to a page, click the pause button, then eval a function, assert we're paused

@jasonLaster jasonLaster added the testing label Feb 16, 2018
@lukaszsobek

This comment has been minimized.

Copy link
Member

@lukaszsobek lukaszsobek commented Feb 16, 2018

/claim

@claim

This comment has been minimized.

Copy link

@claim claim bot commented Feb 16, 2018

Thanks for claiming the issue! 👋

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

🦊 Debugger team!

@AlexWang-16

This comment has been minimized.

Copy link
Contributor

@AlexWang-16 AlexWang-16 commented Apr 9, 2018

/claim

@claim

This comment has been minimized.

Copy link

@claim claim bot commented Apr 9, 2018

Thanks for claiming the issue! 👋

!!! Please check your email and confirm the invitation

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

🦊 Debugger team!

@AlexWang-16

This comment has been minimized.

Copy link
Contributor

@AlexWang-16 AlexWang-16 commented Apr 9, 2018

I've claimed this issue, but I also see that @lukaszsobek has claimed this issue previously. The issue currently indicates it is not in progress, hence my claim. I want to confirm that I haven't jumped on top of someone else already working on this issue. Is it still good for the taking?

@jasonLaster

This comment has been minimized.

Copy link
Contributor Author

@jasonLaster jasonLaster commented Apr 9, 2018

@AlexWang-16 it's all yours

@AlexWang-16

This comment has been minimized.

Copy link
Contributor

@AlexWang-16 AlexWang-16 commented Apr 16, 2018

@jasonLaster I have a few questions regarding this bug that I'd appreciate some clarification on:

  1. When you say 'click pause', is that equivalent towaitForPaused()? Or are you expecting for a breakpoint to be set? I'm having trouble wrapping my head about how I can invoke the debugger's commands programmatically.

  2. Can you elaborate on what 'eval a function' means? I'm looking into evaluating the debugee and it tells me to use invokeInTab(), but I'm not quite sure how to use it (i.e. what I can actually invoke).

It mentions something about ContentTask, but does not provide links for me to read more about it. So I have no context on what I can do next.

Thanks in advance.

@jasonLaster

This comment has been minimized.

Copy link
Contributor Author

@jasonLaster jasonLaster commented Apr 17, 2018

  1. When you say 'click pause', is that equivalent towaitForPaused()? Or are you expecting for a breakpoint to be set? I'm having trouble wrapping my head about how I can invoke the debugger's commands programmatically.

i am refering to clicking on the pause button in the top right

  1. Can you elaborate on what 'eval a function' means? I'm looking into evaluating the debugee and it tells me to use invokeInTab(), but I'm not quite sure how to use it (i.e. what I can actually invoke).

invokeInTab takes a function to call. If you do that the debugger should pause. Usually, i open a page and walk through the steps i want the test to do. invokeInTab is similar to using the console!

@AlexWang-16

This comment has been minimized.

Copy link
Contributor

@AlexWang-16 AlexWang-16 commented Apr 17, 2018

Thanks for the tips. I've tried to replicate pausing the debugger by hand and I can't seem to get it into the state where I can click the pause button. What's the best way to do this?

no-pause-button

@jasonLaster

This comment has been minimized.

Copy link
Contributor Author

@jasonLaster jasonLaster commented Apr 17, 2018

oh interesting... this must be true for you remove-command-bar-options

check with dbg.features in the console

@AlexWang-16

This comment has been minimized.

Copy link
Contributor

@AlexWang-16 AlexWang-16 commented Apr 22, 2018

I've made some progress on this test, but I'm having some issues simulating clicking the pause button on the debugger. I'm wondering if you might have some tips on how to tackle this.

What I have so far is:

  1. Initialize debugger to docs-scripts.html
  2. open simple1.js using selectSource()
  3. Press the pause key by invoking pressKey()
  4. Invoke doEval() using invokeInTab()
  5. Assert debugger is paused.

The result is that the test fails stating that the debugger was not paused.

Other things I've tried:
clickElement(dbg, "pause") - The selector "pause" does not exist

clickElement(dbg, ".pause.active") I get cyclical reference error

• using pressKey(dbg, "pauseKey") to pause the debugger, but it doesn't seem to be working

await waitForDispatch(dbg, "BREAK_ON_NEXT"); I found this command by manually clicking the pause button during the test to see what the printout would be. The test waits for this command to dispatch, but nothing happens and the test times out.

@AlexWang-16 AlexWang-16 mentioned this issue Apr 22, 2018
1 of 1 task complete
@claim claim bot removed the 👷‍♀ in progress label May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.